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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
... 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>
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>
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>
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>
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>
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>