The first is "exact", not "more": qCalculateBlockSize. It ensures that
there's no overflow in multiplying, adding the header size or when
converting back to an int.
The second is the replacement for qAllocMore: it calculates the block
size like the first, but increases the block size to accommodate future
appends. The number of elements that fit in the block is also returned.
Task-number: QTBUG-41230
Change-Id: I52dd43c12685407bb9a6ffff13f5da09f816e667
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Basic optimization of conversion from indexed8.
Task-number: QTBUG-35747
Change-Id: Ic9d32789769eadb05fbecfebf2d2f2c87d66610b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This benchmark requires QtScript1 headers, and can not build as is.
Change-Id: I98e57ca2db82270a0887462d7959ff00e352166b
Reviewed-by: hjk <hjk@theqtcompany.com>
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>
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>
I wrote a script to help find the files, but I reviewed the
contributions manually to be sure I wasn't claiming copyright for search
& replace, adding Q_DECL_NOTHROW or adding "We mean it" headers.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Not that we require it, but since The Qt Company did it for all files
they have copyright, even if they haven't touched the file in years
(especially not in 2016), I'm doing the same.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b4c9d53039846
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)
Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The file exists but it isn't listed in TESTDATA. This is only a problem
when the target is a another system as is the case with Qt for QNX.
Tests fail because the file isn't deployed.
Noticed this while testing the changes for custom spacing of JSON
output.
Task-number: QTBUG-47437
Change-Id: I098c34d2ab9027956d9233b24f30b5192ecfe96f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Use character literals where applicable.
Change-Id: I1a026c320079ee5ca6f70be835d5a541deee2dd1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Fix usage of API that is marked deprecated.
Change-Id: Ib9a45e93084fb5b0d0d3aefd64b755dff7c696d6
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Instead, we use the binary MySQL encoding and copy the data directly
into the QVariant of the desired type. This gets rid of the temporary
string allocations and greatly improves the performance of the added
benchmark. On my machine, the results are:
Before:
0.562 msecs per iteration (total: 563, iterations: 1000)
1,922,479.330 instructions per iteration (total: 1,922,479,330, iterations: 1000)
After:
0.381 msecs per iteration (total: 381, iterations: 1000)
774,132.957 instructions per iteration (total: 774,132,958, iterations: 1000)
Note that the same could be applied to floating point data types in
the future. Additionally, special support for MYSQL_TIME structure
coult be added to get rid of the string conversions there.
To ensure everything keeps working, a new auto test is added as well
that verifies the select statements and insertions of integral data
into a MySql table works as intended.
[ChangeLog][QtSql] Improve performance when reading integer values
from MySQL databases via prepared statements.
Change-Id: I21dd9277661971ded934546f09535014b63f8eb8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Otherwise you cannot link it statically against QtCore.
Change-Id: I4ac35602cea2192974f3e96ecad35edac976ce27
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
QTextLayout::additionalFormats setters and getters using QList<FormatRange> have
been deprecated; port to the QVector versions.
Moved op== definition for FormatRange needed in tst_qsyntaxhighlighter.cpp
to a friend declaration in FormatRange itself, because MSVC 2008 doesn't find
it otherwise.
Change-Id: Ibab6589df057f02377d895079b56395859e3401e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Completes the inplace converters so that we can rely on inplace
conversions to succede as long as the image depth is the same.
Change-Id: Ia1ae34b5de1bc16e87ff5403bdacfcae44a22791
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Cleaning up smoothscale code. Upscaling is improved using existing
optimized interpolation methods, and downscale is given SSE4.1
optimized versions.
Change-Id: I7cdc256c26850948aef7dae26fda1622be6b8179
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
According to I/O API, QIODevice and its inherited classes should be
able to process a full 64-bit offsets and lengths. This requires
64-bit parameters in operations with internal buffers. Rework
QRingBuffer to avoid implicit truncation of numbers and fix some
64-bit issues in code.
Change-Id: Iadd6fd5fefd2d64e6c084e2feebb4dc2d6df66de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Improves the conversion from RGB888 to RGB32 on platforms without SIMD
versions. This includes the fallback used on non-neon ARM devices.
Besides image conversion the routine is also used for decoding JPEG.
On x86 this version is within 0.7x of the speed of the SSSE3 version.
Change-Id: Id131994d7c3c4f879d89e80f9d6c435bb5535ed7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
There are many direct QImage conversions that doesn't need to be direct
but only are because they are faster than the generic conversion. This
patch optimizes the generic conversions and then removes all the direct
conversions that are now no faster than the generic.
Change-Id: I3dc5f44cc7f6358fd66420e9974eebaf2c7ca59c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Outdated header.LGPL removed (use header.LGPL21 instead)
Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)
Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination
Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
The autovectorized versions of premultiplying conversions are almost
twice as fast with SSE4.1 as with SSE2. Therefore this patch lets
compilers that can make those versions convenient without duplicating
code do that and lets us use them when available.
Change-Id: I699035963abe55a38b9ef8ba7b4a8c961c8dfcdd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
We still have a bunch of Q_WS_ ifdefs in our code, which are easy to
mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming
the ifdefs we make it clear that the code in question is dead.
In incremental follow-ups, we can then selectively either remove, or
port, the pieces that are dead code.
Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
With auto-vectorization enabled in QtGui, the 32bit version of
qPremultiply is faster than the 64bit version since it can be vectorized
wider (4x on 128bit as opposed to 2x). Since all our important 64bit
targets have SIMD, that makes the 64bit version pointless.
Change-Id: I4e9070a3a3c8e2b54f17a95ba0aee0405cbb8ec9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The class hasn't been used for a while anymore. Since it's
private, simply remove it from QtGui.
Change-Id: Ia0911d1c8b8836d963a51c8e354c96bc1ee4093f
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
There's a change in Qt 5.4.0 that makes Qt compile with its own set of
D-Bus headers, which means QT_CFLAGS_DBUS may be empty. Thus, we can't
compile or link if we're using the actual libdbus-1 API to build the
test.
This commit makes these unit tests use the same dynamic loading
mechanism.
Change-Id: I56b2a7320086ef88793f6552cb54ca6224010451
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This covers the only real additions over QVector: push and pop. Really, there
isn't too much specific to benchmark here, but we're interested in one specific
case: that of pushing and popping a single item repeatedly.
With the current QVector behavior, this causes constant deallocation, which
makes it morbidly slow. This behavior will be reviewed in a subsequent commit.
Results (not that anyone really cares) for me:
PASS : tst_QStack::qstack_push()
RESULT : tst_QStack::qstack_push():
1.9 msecs per iteration (total: 61, iterations: 32)
PASS : tst_QStack::qstack_pop()
RESULT : tst_QStack::qstack_pop():
8.2 msecs per iteration (total: 66, iterations: 8)
PASS : tst_QStack::qstack_pushpopone()
RESULT : tst_QStack::qstack_pushpopone():
80 msecs per iteration (total: 80, iterations: 1)
Change-Id: I3530888abbfcfcef39318d6be6d5b07306a4704e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Wait for the subprocess to print "ready" before assuming that it is
ready to receive calls. waitForStarted() will return as soon as the
child is running, but it may not have registered on D-Bus yet.
This also solves the synchronization problem more elegantly than how
tst_qdbusmarshall.cpp was trying to do it.
Change-Id: I548dfba2677cc5a34ba50f4310c4d5baa98093b2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The executables are not in the same dir as on Unix, so we need to use
QFINDTESTDATA to find them. The DESTDIR setting prevents qmake from
placing the executables in a "debug/" subdir.
Change-Id: I1d6d10e6f6f109f55fd9809dcf83da0386f38772
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
No need to loop twice to add the "native" entries, since they are added
by the helper function anyway.
Change-Id: I9caabc6fc4973a90b483840815769b1351947a89
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The enum was made public in f84b00c6d2, but this
makes it follow the convention to camel case acronyms too before it's too late
to change it.
Change-Id: Ibb81e9221cb73fe0502d0a26f2d73512dd142f08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QMetaType::type(const char *) requires that the string argument is
0-terminated. This new overload makes it possible to query the type
of a string with an explicit length.
In particular, QByteArrays constructed by QByteArray::fromRawData(),
for example from a substring of a normalized method signature (the
"int" part of "mySlot(int"), can now be queried without making a copy
of the string.
Also, Qt5 meta-objects represent type names as QByteArray literals,
which can be fed directly to this new QMetaType::type() overload (no
need to call strlen).
Change-Id: I60d35aa6bdc0f77e0997f98b0e30e12fd3d5e100
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>