summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* QRegion: remove some toplevel const from return typesMarc Mutz2014-09-102-8/+39
| | | | | | | | | | | | | It has no effect and inhibits move semantics. After this change, two and five more copies are moves in QtGui and QtWidgets, resp. Keep the old form for compilers that mangle the return type. Change-Id: I6257683144110230079fe9095303907ecc858c94 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qpa: Make screen geometry updates (full and available geometry) atomicTor Arne Vestbø2014-09-106-53/+30
| | | | | | | | | | | | | | | | | Updating the geometry and available geometry in two steps means that QScreen will be in an inconsistent state when emitting the geometry change signal, as the available geometry has not been updated yet. Piggy-backing changes to the availableGeometry based on the virtual geometry changing does not make sense, so we now tie geometry and availableGeometry (and their size variants) to their own separate geometryChanged and availableGeometryChanged signals. Change-Id: Iee0ced642cbb91c470cb54bc507d2c0512482c13 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Destroy the QOpenGLTextureBlitter in the destructorJørgen Lind2014-09-101-0/+3
| | | | | | | if it has not already been destroyed Change-Id: If9a29da25eb23d5d65204eecabe095df215737ee Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Add an option to share between TLWsLaszlo Agocs2014-09-103-3/+26
| | | | | | Task-number: QTBUG-41191 Change-Id: I510d1631926ed0d9e371703d22229aed92432aa6 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* QRegion: remove check for null ptr after "new" operatorMaks Naumov2014-09-091-2/+1
| | | | | | | Change-Id: Iebba0b1f024e22cd36a04c53377b3958638b389e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Enhance the VAO docsLaszlo Agocs2014-09-081-0/+10
| | | | | | | | Make it clear that the class is usable regardless of the OpenGL version the app is targeting. It may just do nothing. Change-Id: I50e68a46e36ef1f4694016311af93c6f8719ce4f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove GLdouble and GL_DOUBLE typedefs for OpenGL ES 2.Gunnar Sletta2014-09-052-6/+2
| | | | | | | | | We have no business defining types which come from another library. These originally stem from the S60 port without further explanation and Qt and its examples today compile without them, so remove them. Change-Id: I683ea897c00ab3a1f7c809c45352fe590ae9a41f Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Accessibility: Improve line boundary helper functionsFrederik Gladhorn2014-09-041-4/+92
| | | | | | | | | These functions are supposed to make it easy for third parties (and QLineEdit) to implement the textAt/Before/AfterOffset functions. Before the functions were ignoring newlines completely and thus only somewhat useful. Change-Id: I7136b9502a7fa6f8ad9ad7236761a34c1a7fd4da Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Use QPlatformTheme::SystemIconFallbackThemeName in static QString ↵Albert Astals Cid2014-09-031-1/+1
| | | | | | | | | fallbackTheme() Instead of QPlatformTheme::SystemIconThemeName Change-Id: Id318944730cd1b8014380a972eb28fd8aab1f382 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QImage: add a qMove()Marc Mutz2014-09-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | The color table is passed by value (good for C++11), so when the argument is assigned to the member variable, that's a good spot for a move assignment. However, the argument is also declared const. The standard says that top-level const is ignored, but some compilers (I know about SunCC) think differently, so we cannot remove it. Instead, we do a const_cast. It is well-defined: Even though apparently the argument was declared as const, the standard says the const is not there, and no sane compiler would put the argument copy into read-only memory. Add a reminder to remove the top-level const from the signature come Qt 6. Change-Id: Iac18846ba669de0a30da620685ad1438c267e193 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QOpenGL2GradientCache::getBuffer: calculate hash value outside critical sectionMarc Mutz2014-09-021-1/+1
| | | | | | | | | | | | The code doesn't touch any member variables, so it doesn't need mutex protection. Reducing the time spent under the mutex allows a higher speedup (Amdahl's Law), so do it. Also made the mutex locker const to indicate it is never unlock()ed again. Change-Id: Ic50b827c0e34d39cbddc7ec83675b568a9c33f6d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* QTextEngine: remove unnecessary assignment in LayoutData::reallocate()Maks Naumov2014-09-021-2/+1
| | | | | Change-Id: I82e34d5525354fc20ca9aba6df3767e3fee51bf8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QIconLoader: enable an easy case of transactional processingMarc Mutz2014-09-021-3/+4
| | | | | | | | | It's easy to do the work on the side and then commit. This is strongly exception safe, but in Qt, we don't care. But transactional code, when this easy to achieve, is also clearer. Change-Id: I30f1badec7745d62a09af4eede234cb312b373aa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix no-opengl buildLaszlo Agocs2014-09-011-0/+6
| | | | | | Change-Id: I577bd5d10e52571c95c9e646327264cf95ac6eb1 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix advance of zero-width spaces in fonts that omits the glyphAllan Sandfeld Jensen2014-09-012-7/+21
| | | | | | | | | | | | | | | Some fonts appear to include zero-width space in the CMAP table, but not include an actual definitions of the glyph they point to. The missing glyph causes a warning, but isn't handled making the character end up being giving the same metrics as whatever character it came after. This patch adds explicit handling of missing glyphs, and also caches their missing state when caching is enabled. Task-number: QTBUG-40912 Change-Id: I06fba9c01df59548e750e36babfdd5a6bafd6bd0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Avoid trying convert to RGB32(ARGB32) when image already RGB32 while writing ↵Maks Naumov2014-08-311-1/+1
| | | | | | | | | | | | XPM image "sourceImage.format() != QImage::Format_RGB32 || sourceImage.format() != QImage::Format_ARGB32 || sourceImage.format() != QImage::Format_ARGB32_Premultiplied)" This condition always "true". Change-Id: I67b3dfac135985a75bcd697b4c1a84ec3c0b66f5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* Code cleaning in qt_gl_resolve_extensionsAllan Sandfeld Jensen2014-08-281-34/+42
| | | | | | | | | Moves feature checks so OpenGL vs OpenGLES is only tested one way and extensions so they are not tested if already required by their version. Change-Id: Ia77f6ea924559fa7a428beb6316ae392063dfc4f Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Use ctor-init-list in QRegionPrivate(QRect) ctorMarc Mutz2014-08-261-5/+6
| | | | | | Change-Id: I531b862db7bdec0a504c6022c1a15635aaf3fc8d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QRegionPrivate: remove copy ctor and assignment operatorMarc Mutz2014-08-261-17/+0
| | | | | | | | They're identical to the compiler-generated ones, and probably inhibit move operators here and there. Change-Id: I918f2946f6b6aa49aa883420dc87df44013938a5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Document loading of high resolution versions of images.Friedemann Kleint2014-08-265-14/+55
| | | | | | Task-number: QTBUG-38858 Change-Id: I87ee18b66e137f5f5c01d77910f1a7f256b85e18 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Mention supportedMimeTypes() in QImageReader documentation.Friedemann Kleint2014-08-261-2/+3
| | | | | Change-Id: Iaa07a463e07982352fe2c7dd77d691a390a65f35 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QEvent check for QT_NO_GESTURES in new debug code.Dyami Caliri2014-08-251-0/+4
| | | | | | | | Latest changes to QEvent break compiling with -no-feature-gestures. Change-Id: Ibbddd73a4f567051c3793a7aaf438240add6583a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* QOpenGLTextureBlitter: Do not call vao functions if it failed to createLaszlo Agocs2014-08-251-7/+7
| | | | | | | | Follow the good practice of checking for isCreated() before calling VAO functions like bind(). Use also the vao binder where applicable. Change-Id: Ib827f3bce838396bf2e08f9480fa63801d4d3a50 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Support QOpenGLWidget and QQuickWidget on AndroidLaszlo Agocs2014-08-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | It gets somewhat complicated due to the fact that a RasterGLSurface window (i.e. any widget window since 5.3) may behave either like an OpenGLSurface or a RasterSurface, and the expected behavior may change on each backingstore sync. This does not fit designs where the platform window implementation is separated and there is different behavior for raster and GL windows. Therefore QAndroidPlatformOpenGLWindow is now made capable of behaving like the raster one, based on a flag communicated from the widget stack via QWindowPrivate (since the plugin knows nothing about widgets). This means that widget windows that do not have renderToTexture children (QOpenGLWidget, QQuickWidget) will go through the raster path, while the ones that have will behave like an OpenGL window with the actual rendering happening in QPlatformBackingStore::composeAndFlush(). The surface type is RasterGLSurface in both cases nonetheless. Task-number: QTBUG-37907 Change-Id: I6f9261fc0fd993afcda7f30d379c5410069033d3 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Initialize textureId in platform backing storeLaszlo Agocs2014-08-251-0/+1
| | | | | | | | | | | | | Setting it initially to 0 is very important, otherwise we will do a glDeleteTextures with the undefined value. The result sometimes goes unnoticed and sometimes causes bizarre issues: For example in the 'textures' example one face of one cube out of the six did go blank from time to time since the corresponding texture was deleted by the backingstore. Change-Id: Id19eb2164471b542b08a277a65edfcb5d0f8248d Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix composition for translucent AlwaysStackOnTop widgetsLaszlo Agocs2014-08-241-1/+1
| | | | | | | | | | | | | | | Writing out the alpha is re-enabled too early. When blitting the AlwaysStackOnTop widgets as the last step of the composition, they need the exact same settings as the backingstore content, meaning blending but without writing out alpha. Move the glColorMask call to fix this. This will avoid issues with semi-transparent AlwaysStackOnTop widgets when the top-level has alpha enabled too. Task-number: QTBUG-40910 Change-Id: Id6d0d684cfa78bf79b65a097efd92de575e73b2c Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Do not resolve core functions on GLES in texture helperLaszlo Agocs2014-08-231-0/+64
| | | | | | | | | | | | | As the spec for eglGetProcAddress says, some implementations may not return function pointers for core functions. Similarly to how we cannot get OpenGL 1.0/1.1 functions with WGL for example. To make sure QOpenGLTexture does not just crash with such implementations, we simply use the statically exported functions in -opengl es2 builds. Change-Id: I213bfcc21e58888b17e0ebcd0a26f26f77517e40 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QIconLoader: don't inherit QObjectMarc Mutz2014-08-231-1/+1
| | | | | | | | | QIconLoader did not use the services from QObject and the Q_OBJECT macro was missing, too, so external code couldn't have used it in a qobject_cast or inherits(), either. Change-Id: I1f33dd540fa2ded48d871d848a77eee743a4e3c0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: replace an inefficient QList with a QVectorMarc Mutz2014-08-232-3/+4
| | | | | | | | | | QIconDirInfo is larger than a pointer, so holding it in a QList is horribly inefficient. Fix by holding it in a QVector instead. Change-Id: I6551d2d2941447e600a33c3d68edf46db002d96c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: mark virtual overridesMarc Mutz2014-08-231-2/+2
| | | | | Change-Id: I72f20b5935d56d7c090fdd685e2bedc0778db505 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: mark a helper type as movableMarc Mutz2014-08-231-0/+2
| | | | | | | | QIconDirInfo is held in Qt containers, so reap the performance benefit of a movable type. Change-Id: I317c69ec46d324623b21a33043856e22f60e21b1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: replace while(!empty()) delete takeLast() with qDeleteAll()Marc Mutz2014-08-231-6/+2
| | | | | | | | | | There's no calling back into QIconLoaderEngine from the QIconLoaderEngineEntry dtors, so don't bother slicing off one element by one from the container as they are deleted, the more so as m_entires is either move-assigned or deleted right after these loops. Change-Id: Ic9ffa442ef0b0c59e19eb91d164183ea5c3bab67 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: don't re-evaluate container.size() all the time (II)Marc Mutz2014-08-231-2/+4
| | | | | | | | Experience shows that the compiler does not recognize the size() call as a constant expression, so help it along. Change-Id: I688244f37c555365566cd1a59dc601974316a2e6 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: don't re-evaluate container.size() all the timeMarc Mutz2014-08-231-1/+3
| | | | | | | | Experience shows that the compiler does not recognize the size() call as a constant expression, so help it along. Change-Id: I60cd1754f8be123c62e3b47f6f721f42a69fe3c5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: remove another unused variableMarc Mutz2014-08-231-1/+0
| | | | | Change-Id: I2b11944d1964878ff5f6f666f33a97ea842ffea7 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: remove an unused variableMarc Mutz2014-08-231-1/+0
| | | | | Change-Id: I4f1fee2da9358f63c4d3c9e46b8d69b4a1b280c7 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Replacement for QWS_DBLCLICK_DISTANCEPelle Johnsen2014-08-211-1/+5
| | | | | | | | | | | | | | Add QT_DBL_CLICK_DIST to replace QWS_DBLCLICK_DISTANCE for controlling the distance for detecting double clicks, which can be very useful on embedded devices [ChangeLog][QtGui] environment variable QT_DBL_CLICK_DIST customizes the amount of movement allowed when detecting a double click. Task-number: QTBUG-40841 Change-Id: I0a7534ad6cd6387d127eb49021a92d414d45670e Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Debug logging support for QNativeGestureEventShawn Rutledge2014-08-211-1/+8
| | | | | | | | | | The most useful information is what kind of gesture the event represents, but it was missing until now. Also added a line of documentation about the NativeGesture event type. Change-Id: I1ba3c951dcc5751e937d762d9b647ab0bf8d93b8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* Outline drawing should not override the default freetype loadflagsAllan Sandfeld Jensen2014-08-211-1/+1
| | | | | | | | | | We set FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH as the default load flags for freetype fonts, but due to using = instead of =| the default flags gets overridden when outline drawing sets FT_LOAD_NO_BITMAP. Change-Id: I26b45aa2bbf613689d278eb07ae028ef9757023c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove QPlatformScreenPageFlipper.Robin Burchell2014-08-195-226/+0
| | | | | | | | | | | | | | | | Use of this was removed from QtWayland quite a long time ago, which was the only public user of this API. Furthermore, it isn't easily possible to implement any use of this API without full control of the graphics stack (a very rare occurrence) and there is no public demonstration of this. There is ongoing research to provide a better replacement for this in the form of QPlatformHardwareCompositor. Change-Id: I80d666a5b465aa80f73fed6c44838ce7210bbd30 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* If a tess/compute shader compilation fails, print its type correctlyGiuseppe D'Angelo2014-08-181-7/+18
| | | | | Change-Id: I7536b596b890ed304846572b3068b3e932c0f594 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Giuseppe D'Angelo2014-08-196-4/+22
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-126-4/+22
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
| | * Fix rendering alpha-blended text which needs to be clipped at the top.Simon Sasburg2014-08-111-1/+1
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-34148 Change-Id: I9c0694e67cc9883db318c1a1558bdf6e08088db4 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| | * Font Database: Add support for private, system UI font familiesGabriel de Dietrich2014-08-112-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We introduce QPlatformFontDatabase::isPrivateFontFamily() to allow testing for private, system UI font families. Both QFontComboBox and QFontDialog need to filter out those private font families which, by definition, should be hidden from the end user. (The textedit example had to be updated to fix the issue where the default font would be private. In 5.4, we will be adding an equivalent, public API in QFontDatabase, and a better solution for the textedit example and QTexEdit in general). In particular, on OS X and iOS, private fonts are used for the system UI font. Those have their font family name prefixed by a dot. QCoreTextFontDatabase knows about this, and makes sure those are tested positive as private font families. In order to have a cleaner layer separation, we moved the QPA theme font resolution from the platform theme classes into QCoreTextFontDatabase for both Cocoa and iOS QPA plugins. In both cases, we use CoreText's CTFontCreateUIFontForLanguage(), that nicely maps to the HITheme API we were using so far on Mac. That means one HITheme dependency less. We also cache the font descriptors we get for these font for each time QCTFD::populateFamilies() gets called. (While not common, this currently happens in auto-tests, like tst_QFontDatabase, and could happen in actual applications -- specially when adding and removing application fonts.) Change-Id: Ic6f0b60f9f597afee1a43596a669742dc546b97f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * Initialize member.Gunnar Sletta2014-08-081-0/+1
| | | | | | | | | | | | | | | Change-Id: I9ed8d5a7aeb40886bafbd9eb2003e88e5d796cc9 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| | * Both HiQualAA and normal AA should mean antialiasing in rasterengine.Gunnar Sletta2014-08-071-1/+1
| | | | | | | | | | | | | | | Change-Id: I1970c96e7681e4059984d837e12f044f138e6d7e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| | * Doc: Placed Qt OpenGL class convention in code block.Jerome Pasion2014-08-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | -QDoc tried to autolink where it should not. -The syntax looks much better in a code block than in a paragraph. Change-Id: I21d08cbb1537186d09b52898d7b70a5c0794256c Task-number: QTBUG-35019 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| | * Do not add QOffscreenSurface windows to the global listLaszlo Agocs2014-08-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOffscreenSurface has to stay usable even after returning from app.exec(). Hence close()ing the underlying hidden window, that is used on platforms that do not provide real offscreen surfaces, is wrong. Normally all QWindows are closed (and thus destroy()'ed) when quitting the application, meaning the the offscreen surface cannot be made current anymore after returning from exec(). This is an unnecessary limitation and makes certain cleanup operations impossible. Backport of ba79f36cb1319a279068adb6d02a8993cbc62613 from dev. This is necessary for the 5.3 series too to avoid issues on exit in QQickWidget apps, on OS X in particular. Task-number: QTBUG-40505 Task-number: QTBUG-39908 Change-Id: Iea1489378a18f29ff84ba8f13a6dad2d66d2b315 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| | * OpenGL: destroy QGLContext allocated by QGLContext::fromOpenGLContextDavid Fries2014-08-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGLContext already uses ownContext to identify when it "owns" QOpenGLContext and will delete QOpenGLContext when needed. In the other way QGLContext::fromOpenGLContext creates a QGLContext for QOpenGLContext, and is now using qGLContextDeleteFunction to identify if QOpenGLContext "owns" QGLContext by QGLContext only passing a delete function when QOpenGLContext should delete QGLContext, and by QOpenGLContext calling deleteQGLContext() from destory() to do the destruction avoiding the previous leak and sometimes crash on exit. Change-Id: I65e791776e99b456e4d0c70fc5b5cdb33c975893 Task-number: QTBUG-40286 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>