Commit Graph

27619 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
6cc050c969 Avoid qMin in format conversions when possible
Calling qMin often prevents effective vectorization, and it is only
necessary when converting from formats with mixed color-channel widths.

Change-Id: I2a0f3f3fb528d45be1fd025758f9d915ee1736c0
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-03-01 16:34:46 +00:00
Marc Mutz
fc78bc2c06 QGenericMatrix<N,M,T>: mark as relocatable, depending on T
Inherit the type-classification from the underlying type,
but, for BC reasons, force isStatic = true, so QList does
not change its memory layout in an incompatible way.

Change-Id: I11003cdd24968f903fbd86aa2f5c17287e057c1f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-03-01 16:08:52 +00:00
Alex Trotsenko
4d0672ed42 Integrate network sockets into the multichannel infrastructure
Change-Id: I96974a7460c29b46cae8a28aadb3e50cdcdb7beb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2016-03-01 15:35:36 +00:00
Tor Arne Vestbø
e6b8d742a7 Fix detectProcessorFeatures() fallback path on ARM
Change-Id: Ifcad547caf2d2a7ad7aa1ccb4fbed08810905cee
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-03-01 15:28:57 +00:00
Lars Knoll
35405858a3 Cleanups
Remove the different flags when trying to resolve opengl
functions. Rather we simply try hard to find a matching method
by resolving over possible suffixes when we can't find the standard
name.

Change-Id: Ic73085faec3bd406f5214ed4219eb7b796651d8d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-01 14:46:40 +00:00
Lars Knoll
d98bfedfe4 Generate more compact code to resolve the QOpenGLExtraFunctions
Similar to the parent commit, this reduces binary size significantly.

Change-Id: Idd6753ec5e04ec84d93bf6f86b5c71550b90ae9b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-01 14:46:37 +00:00
Lars Knoll
095b338732 Generate more compact code to resolve the QOpenGLFunctions
Use a similar mechanism as in QOpenGLVersionFunctions and resolve
the methods in a loop. This requires some macro magic but significantly
reduces the size of the generated code.

Change-Id: If5f5e5551af0d1aed4b4ce7ce82932d8988dab59
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-01 14:46:33 +00:00
Lars Knoll
a900645c2a Remove some now unused code
The old Resolver class to resolve GL symbols is not
being used any longer, get rid of it.

Change-Id: I835860eb1c42aea05458ca32cf652659500312da
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-01 14:46:31 +00:00
Lars Knoll
8115a3b444 Get rid of the gles3helper class
Since the backends can now resolve all possible GL
functions, there's no need for the special handling
for GLES that this class did anymore.

Change-Id: Ib48aecc9a892f3c883d76ffc82217f346dbb3adc
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-01 14:46:29 +00:00
Lars Knoll
5e9a5246fb Ensure we can query all GL functions in all platform plugins
This is required to simplify our code in the opengl classes
and makes it possible to remove OS dependent code paths in
Qt Gui.

Change-Id: Ice09440840c86b2d6ac8d3955d273846695338d4
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-01 14:46:26 +00:00
Lars Knoll
c69622fc60 Resolve GLES3 function pointers at construction time
Remove the wrapper methods resolving themselves at first run
also here and instead resolve all GL entry points when the
QOpenGLExtraFunctions object gets constructured.

Keep the gles3helper for now until all backends are fixed
to be able to resolve these methods directly.

Change-Id: I194bd4465605f57d27c79808a016592c101ac04c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-01 14:46:22 +00:00
Lars Knoll
4a6c39b1dd Inline versionStatus() and make it constexpr
Saves another 20-30k for QtGui

Change-Id: I2a6980713ab1c45144c70ba9835c6e85f736279b
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-03-01 14:46:19 +00:00
Lars Knoll
29d8159c44 Avoid repeated QByteArray creation when resolving opengl functions
Add an getProcAddress(const char *) overload to QOpenGLContext,
and refactor the QPA interface to take a const char *. Like this
we can avoid lots of mallocs when resoving GL methods.

Change-Id: Ic45b985fbaa0da8d32ba3e3b485351173352ca6f
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-03-01 14:46:14 +00:00
Lars Knoll
7ee585bbff Don't resolve GL 1 symbols in the texture helper
We already have these symbols resolved in QOpenGLFunctions,
so simply use those.

Change-Id: I6047181dbe47be9b0a83656af454d0ca1f3df6eb
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-03-01 14:46:11 +00:00
Lars Knoll
8611d442fc Simplify part of the resolving code in QOpenGLFunctions
Directly resolve the GL symbols in the constructor instead
of wrapping them in another method that resolves on
first call.

Simplifies the code and reduces the the size of QtGui
by around 50k.

Change-Id: If1fc575d0113d3d9b48ad1918429254c827e42c7
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-03-01 14:46:08 +00:00
Lars Knoll
c8f9a22f8b Inline the constructors for QOpenGLFunctions_X_Backend
They are private classes and only called from non inline code in
Qt, so the change is safe.

Reduces the size of QtGui by another 10k.

Change-Id: I67e0592089b9ac89d3f2ab4456024ad7c5a55eca
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-03-01 14:46:05 +00:00
Lars Knoll
95a8a745e0 Significantly reduce the size of generated code for the opengl wrappers
Use some macro magic to declare the opengl symbols and use that
to call getProcAddress in a loop instead of doing it individually
for each method.

Cuts the amount of generated object code down from 300 to around 50k.

Change-Id: I386d278fde41a1a30827c6232e79f9156090f8b0
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-03-01 14:46:01 +00:00
Lars Knoll
f9c16f3962 De-inline the code resolving the GL symbols
Saves around 200k in QtGui.so.

Change-Id: I1a020445093a5612ed64ca98bf51435580478cda
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-03-01 14:45:58 +00:00
Eskil Abrahamsen Blomfeldt
b4b829d928 Report correct font underline position on OS X
Text was sometimes drawn without a proper gap between the baseline
and underline.

[ChangeLog][Text][OS X] Fixed underline position.

Change-Id: I9b28d1ac39e18e8d98de92b354a1d635100853a9
Task-number: QTBUG-33708
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-03-01 12:15:00 +00:00
Eskil Abrahamsen Blomfeldt
1d5c29da59 Use correct underline thickness on OS X
While the calculated underline thickness would be approximately
correct for many fonts and sizes, it was sometimes incorrect,
e.g. for 18 pt Helvetica. Found while investigating QTBUG-33708.

Change-Id: Ic1d8f2d809c02235d8f15f0414536e04c2a7b844
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-03-01 12:14:56 +00:00
Eskil Abrahamsen Blomfeldt
ddef89b323 Use correct decoration for fallback font engines
The font engine itself specifies the line thickness, underline position
etc. so we need to pass in the correct one, not the multi engine
(which will just return whatever engine #0 prefers.)

Change-Id: I2b2b92e7881df8a8310aedbc6efa304c3210c095
Task-number: QTBUG-33708
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-03-01 12:14:51 +00:00
Liang Qi
d35d847be3 Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev 2016-03-01 12:06:48 +00:00
Frederik Gladhorn
ae2d11df10 Add changelog for 5.6.0
Change-Id: Ib3177028cf1cbd124ebf1449d5e00039f38b1a92
Reviewed-by: Tuukka Turunen <tuukka.turunen@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-03-01 11:23:43 +00:00
Friedemann Kleint
defd302f64 qt_handleMouseEvent(): Scale coordinates.
Fix tst_qwindow::testInputEvents() to pass when High DPI scaling is in effect.

FAIL!  : tst_QWindow::testInputEvents() Compared values are not the same
   Actual   (window.mousePressLocalPos): QPointF(6,17)
   Expected (local)                    : QPointF(12,34)
.\tst_qwindow.cpp(771) : failure location

Task-number: QTBUG-46615
Change-Id: I1ccacc807f3390b6ab26a369d13fd7896e64cbca
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-03-01 11:05:53 +00:00
Andy Shaw
bd43dcae8a Only copy the data if the image is not null
If the image was unable to do the smooth scaling due to running out of
memory then it will return a null QImage, so this should be checked before
copying the data to prevent a crash.

Change-Id: I82a6443ce2d701c45110b5dd3c5ed4813d078312
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-03-01 10:12:33 +00:00
Maurice Kalinowski
cb6d751efa Fix tests for platforms without process support
Change-Id: I2d1cefdb5ff574635a75b54499efc392aba84434
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-03-01 09:27:13 +00:00
Tim Blechmann
495e8c2054 corewlan: avoid unnecessary currentInterface.serviceActive checks
currentInterface.serviceActive is relatively expensive and causes
significant spikes in cpu load. Luckily, we can easily memorize
the result.

Change-Id: Ic7983b63bba5507bc1e34b0644e73365dc44f200
Task-number: QTBUG-45798
Task-number: QTCREATORBUG-15741
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-03-01 09:20:41 +00:00
Tim Blechmann
c2530c7d20 Windows QPA: QWindowsWindow - always treat WM_ERASEBKGND as handled
under certain conditions, a WM_ERASEBKGND message is sent, to a window
without update region. in this case we declare the message as 'handled'
to avoid flickering.

Task-number: QTBUG-48235
Change-Id: I2ed27e020db4b54ec93a445cb219de00f38a62fd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-03-01 09:20:31 +00:00
Venugopal Shivashankar
d7d4a3ecfc Doc: Add the missing \l command and the target section title
Change-Id: I8478467a074ecff9834850c36961ae8e218cea02
Task-number: QTBUG-51290
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
2016-03-01 08:56:48 +00:00
Marc Mutz
3e58e15c3d QJsonPrivate::q_littleendian: mark as primitive/movable, depending on T
Inherit the type-classification from the underlying type.

This amends commit 4889269ff0,
which introduced a QVector<QJsonPrivate::offset>, but failed
to mark the payload as primitive.

Change-Id: I525a0456a550e0694b33b36b4aa71475aeac192b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-01 08:48:52 +00:00
Allan Sandfeld Jensen
45ac7c962b Merge convert from routines
These four methods do not need to be separate, the compiler can figure
generate the optimal version from the template arguments.

Change-Id: I45b30a9c2f2ce4da46c47f2e6e1fbd7561213c4a
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-03-01 08:37:14 +00:00
Marc Mutz
1a42124839 Q{File,Font,Color,Message}DialogOptions are no value classes
These classes are only held in QSharedPointer, so optimize for that:

1. Disable default ctor, copy ctor and assignment operator,
   destructor and swap for public users.
2. Add create() to return an instance in a shared pointer.
3. Allocate public and private classes in one memory block,
   use QSharedPointer::create() to also add the QSharedPointer
   control block to the same memory allocation.

As a consequence, this reduces the creation of a Q*DialogOptions
into a shared pointer by two memory allocations.

Add a macro to enable atomic updates to QtQuick and other users
outside QtBase.

[ChangeLog][QtGui]
[QFileDialogOptions/QFontDialogOptions/QMessageDialogOptions/QColorDialogOptions]
This class no longer has value semantics, but needs to be held
in QSharedPointer (as it always was). To copy an instance, use
the clone() method.

Change-Id: I4c81220e0a8286a310df1c224a30eca34824c4e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-03-01 07:41:46 +00:00
Liang Qi
24cd4a7190 Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: Ic7aaa06f4a14b1aed61faa1a6e7f527ee0eeb96b
2016-03-01 08:23:55 +01:00
Gabriel de Dietrich
8b94ceaff8 QMacStyle and QCocoaTheme: Fix selected item color for non-native menubar
Change-Id: I3b55e9ce896383338cf6ed768d912ca1835b7742
Task-number: QTBUG-28960
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-02-29 22:52:06 +00:00
Gabriel de Dietrich
717ff94639 QMenuBar: Acknowledge AA_DontUseNativeMenuBar
Change-Id: I756f4181d66ef6e79ab7b7be8a23a10171a9f30c
Task-number: QTBUG-28960
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-02-29 22:51:57 +00:00
Allan Sandfeld Jensen
1dd0c4bf1a SSSE3 optimized store of 24-bit formats
Using shuffle and align storing our quint24 format can be done much
faster. This in particular improves conversions to RGB888.

Change-Id: I179748706a33a43fd6f60f5c40287317418c8867
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-02-29 19:39:27 +00:00
Laszlo Agocs
31a880f1f3 Remove lib/fonts symlinking from configure
The fonts directory is removed in 5.7. Avoid creating a broken
symlink.

Change-Id: I95d1970737f54810006c084436411fc95743f72d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-29 18:58:00 +00:00
Joerg Bornemann
6f75c189e1 Fix crash in QProcess::waitForFinished on Windows
Suppose the user connects QProcess::readyReadStandardOutput with a
slot that calls QCoreApplication::processEvents.
Assume the event loop did not handle events between QProcess::start
and QProcess::waitForFinished. The process writes to stdout and exits.
QProcessPrivate::waitForFinished calls drainOutputPipes which calls
QWindowsPipeWriter::waitForReadyRead. This in turn will trigger
_q_processDied via the readyRead signal and processEvents.
_q_processDied will delete the pid object and set pid to null.
After drainOutputPipes returns, _q_processDied is called again but it
must not be called if pid is already destroyed.

Prevent calling _q_processDied if pid is null.

Task-number: QTBUG-48697
Change-Id: Iee047938ee1529057a1a43d71f4e882750903c7e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-29 17:52:58 +00:00
Friedemann Kleint
c7e213334b tst_QDialog: Instantiate test dialog on the stack.
Remove the member variable and instantiate only where needed
on the stack to prevent it from interfering with windows created
by other tests.

Remove flag Qt::X11BypassWindowManagerHint as it does not seem
to have any effect.

Task-number: QTBUG-51516
Change-Id: I3bf88bf148f365c57aaf989671f8b9c3c3f0d8e2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-02-29 15:04:40 +00:00
Friedemann Kleint
837d75eed5 qt_handleTouchEvent(): Scale coordinates when converting touch points.
Remove outdated static functions to convert touch points and use
QWindowSystemInterfacePrivate::fromNativeTouchPoints().

Fix tst_QWidget::underMouse() to pass when High DPI scaling is in effect.

.\tst_qwidget.cpp(9000) : failure location
FAIL!  : tst_QWidget::underMouse() 'childWidget1.underMouse()' returned FALSE. ()
.\tst_qwidget.cpp(10161) : failure location

Task-number: QTBUG-46615
Change-Id: Ie73dba610da357e7be396f2ea0229987f7503462
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-02-29 15:04:26 +00:00
Timur Pocheptsov
aeb169a488 Cocoa integration - avoid using dangling pointers
While re-parenting a widget on a mouse down, it's possible that NSWindow
lives longer than QCocoaWindow (because self.grabbingMouse == YES),
on mouse release event self.platformWindow is not nil yet, but is not a valid
pointer already. Bail out early before touching it.

Change-Id: Iea1025a82386d4b9dc21b3cbd3a5b248b2dd3620
Task-number: QTBUG-42059
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-02-29 14:36:08 +00:00
Liang Qi
a224dfc9d1 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	tests/auto/corelib/io/qprocess/tst_qprocess.cpp

Change-Id: Ib6955eb874b516b185b45d6c38cec646fbaa95f4
2016-02-29 12:34:31 +01:00
Joerg Bornemann
d345783e4d Remove superfluous Windows CE special cases from tst_qprocess.cpp
Use default timeouts for wait functions. The increased timeouts will
only have an effect if the tests fail.
Print process errors if the process could not be started, while we're at
it.
Contract consecutive "#ifndef Q_OS_WINCE" blocks.

Change-Id: I6324e4c5b91b89ebb2580635b88705bbda922907
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-29 10:01:40 +00:00
Gabriel de Dietrich
f253f4c331 Track target widget when wheel events are received
This issue is reproducible on OS X when using a Magic Mouse
or a combination of Magic Trackpad and regular mouse. In these
cases it's possible to start a scrolling gesture on one widget
and move the mouse cursor over another widget.

Although we send the wheel event phase information, we never
made any use of it. This means that a widget would start
scrolling even though it never received a ScrollBegin event.

In this patch, we make sure the scrolling cycle is respected
and that once a widget starts scrolling, it'll be recieving
all the wheel events until a ScrollEnd event reaches the
application.

For those input devices not supporting a proper phase cycle,
we introduce a new (undocumented) phase value, NoScrollPhase.
If the wheel event phase is NoScrollPhase, then we ignore
the current scroll widget and proceed as usual. This value
is the default for wheel events. It's up to the platform
plugin to set the proper phase value according to the data
received from the OS.

Finally, we fix a few of QWheelEvent constructors to properly
initialize the phase and source properties.

Task-number: QTBUG-50199
Change-Id: I3773729a9c757e2d2fcc5100dcd79f0ed26cb808
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-29 08:19:51 +00:00
Marc Mutz
be84480785 QtTest: eradicate all Q_FOREACH loops
... by replacing them with C++11 ramge-for loops.

In one case, I took the liberty to remove a useless
if(isEmpty()) check around a for loop. Now that we
don't use Q_FOREACH anymore, we don't incur the copy
for empty containers anymore. Left the indention of
the loop level to avoid code churn.

Saves 1.8KiB in text size on optimized GCC 5.3 Linux
AMD64 builds.

Change-Id: I1b1fb34847f6a631f0d580fd5261c7f5fed8475c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-29 07:57:51 +00:00
Marc Mutz
a7885c9756 QVector: preserve capacity in clear()
This is what std::vector implementations usually do,
because it minimizes memory fragmentation and useless
allocations since no user will call clear() unless
she intends to append new data afterwards.

Fix calls to resize(0) that show how existing code
tried to work around the issue.

Adjust test. Port from QVERIFY(==) to QCOMPARE as a
drive-by.

[ChangeLog][QtCore][QVector] clear() now preserves
capacity. To shed capacity, call squeeze() or swap
with a default-constructed QVector object, see the
documentation for an example.

Change-Id: I9cebe611a97e027a89e821e64408a4741b31f1f6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-29 07:57:47 +00:00
Marc Mutz
9132d1516a QRegion: use new begin()/end() instead of rect()
Saves ~100b in text size on optimized GCC 5.3 Linux AMD64 builds.

Change-Id: If2bbd2baac6f4ab66ad436028a8013ce0fa97a33
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-28 19:07:11 +00:00
Marc Mutz
79cbff60dd QtGui: use new QRegion::begin()/end() instead of rect()
Saves ~1100b in text size on optimized GCC 5.3 Linux AMD64 builds.

Change-Id: I928be44314dde06d5fdd2486a3417870bda64af4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-28 19:07:07 +00:00
Marc Mutz
d8f0a8a8a4 QRegion: use new begin()/end() in op<<(QDataStream)
Saves 132b in text size on optimized GCC 5.3 Linux AMD64 builds.

Change-Id: I435395c60802f446302ca6b2529d87c4cacb6304
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-28 19:06:49 +00:00
Marc Mutz
77164e4cc0 QRegion: make iterable
Virtually all code in Qt that inspects a QRegion does
so by calling rects(), which returns a QVector<QRect>.

But rects() has a problem: A QRegion that contains just
one rectangle internally is not represented by a QVector,
and the mere act of calling rects() makes QRegion create
one.

So, expose the fact that QRegion is a container of QRects
to users by providing iterators and begin()/end(), which
can be nothrow, since for the one-rectangle case, instead
of vectorize()ing the region, we just return pointers to
(and one past) the 'extent' rectangle.

As a consequence, the iterator type is just const QRect*,
but I think that whatever containers QRegion may use under
the hood in the future, it will be certainly one that is
layout-compatible with a C array.

No mutable iterators are provided, since QRegion maintains
a running bounding-rect, so a mutable iterator would have
to call into QRegion for every change, which doesn't make
sense.

[ChangeLog][QtGui][QRegion] Is now iterable as a container
of QRects: added {c,}{r,}{begin,end}().

Change-Id: I2fa565fac0c1d26e2c0937604b23763cd4e23604
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-28 19:06:44 +00:00