summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Make QScreenPrivate constructor a bit clearerTor Arne Vestbø2014-09-241-5/+5
| | | | | | | | Easier to read/understand that the screen properties are initialized from the platformScreen. Change-Id: I3084c3ac30a08cb4e154536f949475459212d2de Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Frederik Gladhorn2014-09-249-22/+62
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-239-22/+62
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| | * QGuiApplication: clear font database on cleanupTim Blechmann2014-09-121-0/+1
| | | | | | | | | | | | | | | | | | Change-Id: If196c5e93b7ed68c6a0f6be7414f9efc8195f168 Task-number: QTBUG-40865 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| | * Add missing private headers warningSamuel Gaist2014-09-043-5/+29
| | | | | | | | | | | | | | | Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Recreate child windows when changing screensDyami Caliri2014-08-282-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting a new screen, the code calls QWindow::destroy(), which recursively destroys all child windows. It then calls create() on the top-level window, leaving child windows destroyed. This causes crashes if you have embedded native widgets. Task-number: QTBUG-40817 Change-Id: Iaace2589f48bbfd5faaf5ff95357ff43b310504a Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| | * Fix handling QT_IM_MODULE=nonePekka Vuorela2014-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Was added with 19a39a4 to allow no input context to be created. Broken by commit 24c10b0. Especially if compose input context didn't get compiled, the first input context found was loaded. Also made Xcb integration use compose plugin by default. Change-Id: I992eaa8b383320e4ab725bb7b79f561f4f841458 Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
| | * Android: use correct size when leaving fullscreenPaul Olav Tvete2014-08-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Android, fullscreen means enabling "immersive mode", which results in the screen available geometry changing. When restoring normal mode, oldAvailableGeometry == oldGeometry, which means that the fullscreen branch would be chosen even though the state is not fullscreen. By doing the maximized test first, we will default to non-fullscreen geometry for non-fullscreen windows. Task-number: QTBUG-39977 Change-Id: Ifc7e8b4de7e96d8c00603ce0cd136b95f58012bb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| | * Make QWindowContainer handle drag'n'dropAllan Sandfeld Jensen2014-08-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drag'n'drop events were not propagated by a the QWindowContainer to the embedded QWindow. This patch makes the widget accept the events and pass them on Task-number: QTBUG-40603 Change-Id: I97320fbcad27f7c6aa48c95c90bb42dda634764e Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| | * Fix QT_NO_ANIMATION buildSérgio Martins2014-08-131-0/+4
| | | | | | | | | | | | | | | Change-Id: Ia589e703206d6ca675a392e634e2a445dcf4cca3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | emulate mouse move in default implementation of QPlatformCursor::setPosJoerg Bornemann2014-09-231-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QCursor::setPos() is called and the platform plugin doesn't implement QPlatformCursor::setPos, a warning is printed. Additionally, we now emulate a mouse move to have a default implementation that's actually useful. QPlatformCursor::pos() now returns the position that was set by QPlatformCursor::setPos(), or other facilities that generate mouse events, for example the Tslib plugin. Change-Id: Ifc539202765f311baad085f72347aeb732f7b2ba Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | | Fix spin box with fine grained wheel eventsAllan Sandfeld Jensen2014-09-231-1/+10
|/ / | | | | | | | | | | | | | | | | | | | | Only step the value in the spin box when we have accumulated one wheel tick worth of wheel delta. Also fixes the obsolete contructors of QWheelEvent so they set the non obsolete properties. Change-Id: Ic6ea4b37afa8eec85a6ca7bdc0d919bf8fb02608 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Respect the PM_SmallIconSize setting for icons in a menu on OS XAndy Shaw2014-09-201-1/+1
| | | | | | | | | | | | | | | | | | When a platform menu is used then it would hard code the icon size to 16x16. Instead of using the hard coded value then PM_SmallIconSize should be used instead. Change-Id: I27540ebc4397501e8f57686a118c28cd7167c0a1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Keep a source of propagated mouse eventsAlexander Volkov2014-09-191-1/+2
| | | | | | | | | | | | | | | | | | Synthesized mouse events should not cause mouse events which look like they were obtained from the system. So set the source of generated events from the original event. Change-Id: I862829446ac6ef664e1b8e4a5b54ed11926a1d4b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Set a missing source for mouse events synthesized by QtAlexander Volkov2014-09-191-1/+2
| | | | | | | | | | | | | | | | Mouse events synthesized from touch events by Qt should be marked as Qt::MouseEventSynthesizedByQt. Change-Id: I73612621a0248440b3b773f1280395c05c55e4aa Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Change the state of only the left mouse button when sending fake mouse eventsAlexander Volkov2014-09-161-2/+3
| | | | | | | | | | | | | | | | Mouse events synthesized from touch events affect only the left mouse button. So preserve the state of other buttons. Change-Id: I628d41089db39f0c983aa95f311a842111b8c39c Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Fix high dpi support in QOpenGLWindowLaszlo Agocs2014-09-151-3/+4
| | | | | | | | | | Change-Id: I0be29fb25d854e09ae961cade0c8490586788394 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Use default surface format in QOffscreenSurfaceLaszlo Agocs2014-09-141-0/+1
| | | | | | | | | | Change-Id: I3b2f790089e6d1bcfe92f2f732489c08afa766cd Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | 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>
* | 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>
* | 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>
* | 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>
* | 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>
* | 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>
* | 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>
* | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Giuseppe D'Angelo2014-08-192-0/+5
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-122-0/+5
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Initialize member.Gunnar Sletta2014-08-081-0/+1
| | | | | | | | | | | | | | | Change-Id: I9ed8d5a7aeb40886bafbd9eb2003e88e5d796cc9 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.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>
* | | Forward menu button events to Qt if there is no visible menubar.BogDan Vatra2014-08-162-3/+10
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-32334 Change-Id: If1b4517f233b04d4c6c165cbfe62c8cf7b624c60 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | | Fix compilation of QPixelFormat with old clangFrederik Gladhorn2014-08-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The enum would break on old clang trying to cast it to strings when building webkit. In file included from /work/build/qt/qtbase/lib/QtGui.framework/Versions/5/Headers/qimage.h:48: /work/build/qt/qtbase/lib/QtGui.framework/Headers/qpixelformat.h:78:33: error: use of overloaded operator '+' is ambiguous (with operand types 'int' and 'QPixelFormat::FieldWidth') Change-Id: I614cf89d0832dea505001d55188b4c748e948ef9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Android: don't kill the app without warningPaul Olav Tvete2014-08-131-3/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the back key was pressed when no window was visible, such as during startup, the app would be killed without notice. This change makes sure that we always give the app a chance to intercept the back key before killing the application. [ChangeLog][Android] Back key no longer kills the application when no window is visible. Task-number: QTBUG-39688 Change-Id: If9373e8d26ff323d8c8a274fb30820ecc4ca66ab Reviewed-by: BogDan Vatra <bogdan@kde.org>
* | Make the expose region local on all platformsLaszlo Agocs2014-08-122-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QExposeEvent::region() reports a region in a random coordinate system. The behavior is undocumented and the platform plugins do different things. xcb, offscreen and ios are correct. These set the region in local coordinates, which is the most logical interpretation of the expose region. windows is almost correct, except for one occurrence. cocoa and others need changes: passing in geometry() as the exposed region is always wrong. The patch documents the expected behavior both for QExposeEvent and internally in QWindowSystemInterface. The problematic plugins are fixed to use local coordinates. Task-number: QTBUG-40470 Change-Id: I6ded3154d14254fa71d4292d8e1b5e6cf696c81a Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Use NAmE spelling of grey (gray)Marc Mutz2014-08-091-1/+1
| | | | | | | | | | | | | | These occurrences are only in docs or code comments. Change-Id: Ia114466a85c01e2b978396c329153044921fb20b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QPixelFormat: don't inherit itMarc Mutz2014-08-092-282/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of abusing inheritance to provide convenience constructors, use simple inline constructor functions. The name got a lower-case q to indicate a free function. The usual fromXYZ() static methods were deemed not fitting in this case in the initial round of review, since they implied some kind of conversion while these functions are simply constructors of formsts, which contain no data. This also solves the problem that some of these ctors could have been called with just one argument and were therefore candidates for hidden QPixelFormat temporary injection. QPixelFormatRgb was renamed to qPixelFormatRgba to explain the third argument at the call site better. There seem to be no users of this class in qt5.git at this time. Change-Id: Ib4fe8ceb2d30744127b116a748724a3406400eb8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QPixelFormat is better taken by-valueMarc Mutz2014-08-091-2/+2
| | | | | | | | | | | | | | Being a better quint64, it can be passed in registers, so take them as value args. Change-Id: I8eb96a2594d910b538b651fb3ca567c0c124dd3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* | QPixelFormat: implement some oneliners in the class bodyMarc Mutz2014-08-091-15/+6
| | | | | | | | | | | | | | | | There's little point in duplicating the complex declaration (thanks to C++11), just define the relational operators and the default ctor where they're declared. Change-Id: Ie91545b2581c89edd434c911eb05705e2d16debe Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | QPixelFormat: don't use bit fieldsMarc Mutz2014-08-091-101/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC at least is generating horrible code for them, so do the bit twiddling ourselves. This is not premature optimization, because it might be the seed for a QBitField class, as suggested by Andrei Alexandrescu on GN2013. The assembler code of default and copy ctors is unchanged between the old and new versions. Accessors such as redSize() are virtually identical (with an and and a mov exchanging place). The interesting thing is what happend in operator== and the set-all-fields ctor. These are the disassemblies of functions wrapping op== and the ctor, resp.: bool pf_comparison(QPixelFormat, QPixelFormat): .cfi_startproc | .cfi_startproc movl %esi, %edx | cmpq %rsi, %rdi xorl %eax, %eax | sete %al xorl %edi, %edx | ret andl $15, %edx | .cfi_endproc jne .L53 | movl %esi, %edx | xorl %edi, %edx | testw $1008, %dx | jne .L53 | movl %esi, %edx | pushq %rbx | .cfi_def_cfa_offset 16 | .cfi_offset 3, -16 | movl %edi, %ebx | movzbl %dh, %ecx | movzbl %bh, %edx | xorl %ecx, %edx | andl $252, %edx | jne .L40 | movq %rdi, %rcx | movq %rsi, %rdx | shrq $16, %rcx | shrq $16, %rdx | movl %ecx, %ebx | xorl %edx, %ebx | movl %ebx, %r8d | andl $63, %r8d | jne .L40 | xorl %ecx, %edx | testw $4032, %dx | jne .L40 | movq %rsi, %rcx | movabsq $16911433728, %rdx | xorq %rdi, %rcx | testq %rdx, %rcx | jne .L40 | movq %rdi, %rdx | movq %rsi, %rcx | shrq $32, %rdx | shrq $32, %rcx | movl %edx, %ebx | xorl %ecx, %ebx | movl %ebx, %r8d | andl $252, %r8d | jne .L40 | movq %rsi, %r9 | movq %rdi, %r8 | shrq $40, %r9 | shrq $40, %r8 | xorl %r9d, %r8d | andl $127, %r8d | jne .L40 | xorl %ecx, %edx | andl $98304, %edx | jne .L40 | movq %rsi, %rcx | movq %rdi, %rdx | shrq $48, %rcx | shrq $48, %rdx | xorl %ecx, %edx | andl $126, %edx | jne .L40 | shrq $48, %rdi | movq %rcx, %rax | xorl %edi, %eax | testw $-128, %ax | sete %al | .p2align 4,,10 | .p2align 3 | .L40: | popq %rbx | .cfi_restore 3 | .cfi_def_cfa_offset 8 | .L53: | rep | ret | .cfi_endproc | That one is pretty obvious. Hint: the right one is the new version. QPixelFormat pf_unwieldy_ctor(QPixelFormat::ColorModel, ...) .cfi_startproc | .cfi_startproc movq %rbp, -32(%rsp) | movq %rbx, -40(%rsp) movq %r12, -24(%rsp) | .cfi_offset 3, -48 andl $15, %edi | movzbl 8(%rsp), %ebx movq %r13, -16(%rsp) | andl $63, %esi movq %r14, -8(%rsp) | movq %rbp, -32(%rsp) andl $63, %esi | movq %r12, -24(%rsp) movl 48(%rsp), %r11d | andl $63, %edx movzbl 8(%rsp), %r10d | .cfi_offset 6, -40 andl $63, %edx | .cfi_offset 12, -32 .cfi_offset 6, -40 | movl 16(%rsp), %ebp .cfi_offset 12, -32 | movl 32(%rsp), %r11d .cfi_offset 13, -24 | andl $63, %ecx .cfi_offset 14, -16 | movl 40(%rsp), %r10d movzbl 16(%rsp), %r14d | movq %r13, -16(%rsp) movzbl 24(%rsp), %r13d | andl $63, %r8d andl $63, %ecx | andl $63, %ebx movzbl 32(%rsp), %r12d | .cfi_offset 13, -24 movzbl 40(%rsp), %ebp | movl 48(%rsp), %r13d andl $63, %r8d | andl $63, %r9d movl %r11d, %eax | movq %rbx, %r12 movq %rbx, -40(%rsp) | movl 24(%rsp), %ebx .cfi_offset 3, -48 | andl $1, %ebp andl $63, %r9d | andl $1, %r11d andl $3, %eax | andl $15, %r10d andl $63, %r10d | movq %rdi, %rax xorl %ebx, %ebx | andl $15, %eax andl $1, %r14d | salq $4, %rsi andl $1, %r13d | salq $10, %rdx andl $1, %r12d | andl $1, %ebx andl $15, %ebp | salq $16, %rcx cmpl $2, %r11d | salq $22, %r8 cmovne %eax, %ebx | salq $28, %r9 andl $63, %esi | salq $34, %r12 movq %rdi, %rax | salq $40, %rbp salq $4, %rsi | salq $41, %rbx andl $15, %eax | salq $42, %r11 andl $63, %edx | salq $43, %r10 salq $10, %rdx | cmpl $2, %r13d orq %rsi, %rax | movq %r14, -8(%rsp) andl $63, %ecx | .cfi_offset 14, -16 salq $16, %rcx | movzbl 56(%rsp), %r14d orq %rdx, %rax | je .L45 andl $63, %r8d | andl $3, %r13d orq %rcx, %rax | salq $47, %r13 salq $22, %r8 |.L44: andl $63, %r9d | orq %rsi, %rax salq $28, %r9 | orq %rdx, %rax orq %r8, %rax | movq %r14, %rdx andl $63, %r10d | movq -8(%rsp), %r14 movq %r14, %rcx | orq %rcx, %rax salq $34, %r10 | andl $63, %edx orq %r9, %rax | orq %r8, %rax andl $1, %ecx | salq $49, %rdx movq %r13, %rdx | orq %r9, %rax orq %r10, %rax | orq %r12, %rax salq $40, %rcx | movq -24(%rsp), %r12 andl $1, %edx | orq %rbp, %rax movq -16(%rsp), %r13 | movq -32(%rsp), %rbp salq $41, %rdx | orq %rbx, %rax orq %rcx, %rax | movq -40(%rsp), %rbx movq %r12, %rcx | orq %r11, %rax orq %rdx, %rax | orq %r10, %rax andl $1, %ecx | orq %rdx, %rax movq %rbp, %rdx | orq %r13, %rax salq $42, %rcx | movq -16(%rsp), %r13 andl $15, %edx | ret movq -32(%rsp), %rbp | .p2align 4,,10 salq $43, %rdx | .p2align 3 orq %rcx, %rax |.L45: movq %rbx, %rcx | xorl %r13d, %r13d orq %rdx, %rax | jmp .L44 movzbl 56(%rsp), %edx | .cfi_endproc andl $3, %ecx | salq $47, %rcx | movq -40(%rsp), %rbx | movq -24(%rsp), %r12 | movq -8(%rsp), %r14 | andl $63, %edx | orq %rcx, %rax | salq $49, %rdx | orq %rdx, %rax | ret | .cfi_endproc | Without bothering to understand the details, they look pretty similar, with the new version being slightly shorter. But that may not mean anything. Change-Id: I31e84c9109ccd0c7282351b2e2802407a9b360b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add default format to QSurfaceFormatLaszlo Agocs2014-08-085-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add defaultFormat() and setDefaultFormat() statics to QSurfaceFormat. These define the default values for the requestedFormat members of QOpenGLContext, QWindow and QOpenGLWidget (and implicitly QOpenGLWindow, QQuickWindow, etc.) This replaces QQuickWindow::setDefaultFormat() which can now be removed. The main inspiration here is not the convenience (avoiding setFormat() calls for all windows/widgets), but robustness: by setting the format once at the start of the application, all windows and contexts, including the internal share context used by QOpenGLWidget and QQuickWidget, will use the same format, eliminating the possibility of failing due to trying to share between incompatible contexts. Furthermore, since such a functionality is anyway mandatory for QQuickWindow (due to the possibility of creating windows from QML code), extending it to QSurfaceFormat and QOpenGLContext/QWindow is the next logical step. Change-Id: Ie94486adc489d17fecfcebb7050fecedffd2688b Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Fix the docs for resizeGL in QOpenGLWindowLaszlo Agocs2014-08-081-3/+9
| | | | | | | | | | | | | | | | Some of it was blindly copied from QOpenGLWidget and it does not apply. Change-Id: I73f358f74d286d3757a3a77a9bfe06887d57514a Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Avoid repaints and swapbuffers when the platform window is already goneLaszlo Agocs2014-08-071-1/+2
| | | | | | | | | | | | | | | | | | | | On Linux at least the qopenglwindow example sometimes shows "QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined" when closing the window and exiting the application. This patch avoids this by not triggering repaints anymore when the platform window is destroyed. Change-Id: I54bd41e5c1471f7cdfec89f8ec3be48d1438be39 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | QPlatformMenu: add overloaded function 'showPopup' that takes a target rectRichard Moe Gustavsen2014-08-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When showing an edit menu on touch platforms, you need to specify a target rect for where to place the menu. The target rect is normally a rectangle that encompasses the whole text selection. Using this information the OS will place the menu so that is doesn't obscure the selection itself, or fall outside the screen (or overlaps e.g the keyboard). Since we don't know the size of the menu, or if the OS will end up placing the menu above or below the pos we give it, we need to do it the correct way and forward the whole target rect instead. Change-Id: I638586e9d0dd14c430a22c403c6dce099192a075 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Add debug operator for QTouchEvent::TouchPointShawn Rutledge2014-08-062-23/+33
| | | | | | | | | | | | | | | | | | | | dfde72e4361d82a782cb4da08ddcd0d8e8c40b07 added debug support for QWindowSystemInterface::TouchPoint, which is useful only near the QPA interface; but in qtdeclarative it's useful to be able to log individual touch points too. Change-Id: I237d354d7018e6326e586ae3355c8aa6f781eff8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Be consistent in GrayScale vs Grayscale namingAllan Sandfeld Jensen2014-08-062-8/+8
| | | | | | | | | | | | | | | | | | The enum GrayScale was renamed Grayscale without similarly changing the helper class for the same enum. Change-Id: Ie1b34a68654f22a843ce4cfc2ddc1bf06af8dea1 Reviewed-by: Axel Rasmussen <axel.rasmussen1@gmail.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Document the destroy/create behavior of QOpenGLContext::create()Laszlo Agocs2014-08-061-0/+3
| | | | | | | | | | | | | | | | | | This is not obvious since in some other classes with similar design subsequent create() calls are ignored. In some others it results in a warning. In case of QOpenGLContext it leads to recreating. Therefore it must be documented. Change-Id: I16efa73ebae15b3ffc26832d8d5cc2cd5d0ed469 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | QPalette: add move constructorMarc Mutz2014-08-062-2/+15
| | | | | | | | | | | | | | | | | | | | As with many other implicitly shared classes, efficient move semantics requires setting the d-pointer to nullptr, which then needs to be checked for in the dtor and the copy assignment operator. Change-Id: I654d181a1dfdd9a16e2f9fb96b57475cdd0b4561 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | QPixelFormat: have field 'unused' have the correct number of bitsMarc Mutz2014-08-051-1/+2
| | | | | | | | | | | | | | 4+6*6+3*1+4+2+6+8 = 63, not 64, so make 'unused' have 9 bits width. Change-Id: I06e66074a09e93538fac01182c5a0d009d9b6583 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | QPixelFormat: make data fields private instead of protectedMarc Mutz2014-08-051-1/+1
| | | | | | | | | | | | | | The convenience subclasses use the QPixelFormat ctor, not the data fields directly. Change-Id: I011299837cfb3b7006bc8425848989e5739b6082 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>