Commit Graph

95 Commits

Author SHA1 Message Date
Robin Burchell
ca9ed9619f Improve performance of Qt::mightBeRichText by using QStringRef
I noted this taking around 1% of QtQuick Text creation with a few simple bindings
which is quite considerable, so hopefully improvements here will add up gradually.

Also add a benchmark measuring changes:

                  Test                 |      From      |       To       |        Details
+--------------------------------------+----------------+----------------+-----------------------+
  mightBeRichText:br-invalidspace      | 14466.00 instr | 10563.00 instr | -26.98% FASTER! :)
  mightBeRichText:br-nospace           | 18581.00 instr | 14635.00 instr | -21.24% FASTER! :)
  mightBeRichText:br-space             | 18470.00 instr | 14377.00 instr | -22.16% FASTER! :)
  mightBeRichText:documentation-header | 16336.00 instr | 12992.00 instr | -20.47% FASTER! :)
  mightBeRichText:empty                | 2618.00 instr  | 2618.00 instr  | more or less the same
  mightBeRichText:invalid closing tag  | 11102.00 instr | 7159.00 instr  | -35.52% FASTER! :)
  mightBeRichText:no tags              | 12503.00 instr | 8581.00 instr  | -31.37% FASTER! :)
  mightBeRichText:simple               | 17316.00 instr | 14074.00 instr | -18.72% FASTER! :)
  mightBeRichText:simple2              | 14394.00 instr | 10745.00 instr | -25.35% FASTER! :)
+--------------------------------------+----------------+----------------+-----------------------+
             Overall result            |                                        -201.81% :)

Change-Id: I1817a69959d176b381bcbf27b72bb751885c3e9b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-11 12:30:31 +00:00
Liang Qi
990969655c Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	config_help.txt
	configure
	src/corelib/io/qprocess_wince.cpp
	src/plugins/platforms/windows/qwindowstheme.cpp
	src/plugins/platforms/xcb/qxcbbackingstore.cpp
	tests/auto/corelib/tools/qtimezone/BLACKLIST
	tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
2016-05-12 08:33:08 +02:00
Allan Sandfeld Jensen
e91abaa48e Optimize convert_Indexed8_to_X32
Basic optimization of conversion from indexed8.

Task-number: QTBUG-35747
Change-Id: Ic9d32789769eadb05fbecfebf2d2f2c87d66610b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-04-27 22:01:32 +00:00
Lars Knoll
00ca784be6 Always build JPEG and GIF support as plugins
Our handling of plugins when Qt is build statically is
nowadays good enough, so we don't need to build the
JPEG and GIF support directly into Qt for static builds.
Let's simply always build them as plugins.

Also simplify the logic in configure, and get rid of the
no-gif, no-jpeg and no-png config variables.

[ChangelLog][Build system] JPEG and GIF image support is now
always built as a plugin. Removed -imageformat-[jpeg|gif]
arguments to configure.

Change-Id: Ic01559ff406c966807b3be8761252e8802adcdf7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-04-07 09:08:41 +00:00
Friedemann Kleint
f720619e0d Remove Windows CE from tests (others).
Remove #ifdef sections for Q_OS_WINCE, wince .pro file clauses and
CE-specific files.

Task-number: QTBUG-51673
Change-Id: Ibf599204f5c0daaef086edaf8fac86853db3ee14
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-31 06:14:04 +00:00
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
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
Jani Heikkinen
f776595cc1 Updated license headers
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>
2016-01-21 18:55:18 +00:00
Friedemann Kleint
a2a00eb044 Tests: Fix single-character string literals.
Use character literals where applicable.

Change-Id: I1a026c320079ee5ca6f70be835d5a541deee2dd1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-13 18:14:27 +00:00
Friedemann Kleint
51e501fa8d Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.
Change-Id: I1955320e7639760b4383a53f37a506c8055933ef
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-09-01 16:57:46 +00:00
Friedemann Kleint
50b9e30970 qtbase tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases.
Fix usage of API that is marked deprecated.

Change-Id: Ie31b6ee029c5b5f015fe52fb9bcd8e94b22d6cd0
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-08-31 19:56:59 +00:00
Friedemann Kleint
574c2e7fee QGraphicsView tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0.
Fix usage of API that is marked deprecated.

Change-Id: Ib9a45e93084fb5b0d0d3aefd64b755dff7c696d6
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2015-08-22 05:55:24 +00:00
Liang Qi
0aa2d318b1 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/corelib/global/qglobal.cpp
	src/corelib/global/qglobal.h
	src/corelib/global/qsysinfo.h
	src/corelib/global/qsystemdetection.h
	src/corelib/kernel/qobjectdefs.h
	src/plugins/plugins.pro
	tests/auto/widgets/itemviews/qlistview/qlistview.pro

Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
2015-07-01 11:05:26 +02:00
Oswald Buddenhagen
d32f47b703 fix usage of wince scope
Fix style issues along the way.

Change-Id: Ic6a6de28e198eb0b14c198b802e78845703909b9
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-05 10:29:10 +00:00
Marc Mutz
87d57d1994 Fix users of QTextLayout::additionalFormats to use the new API
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>
2015-05-30 10:56:24 +00:00
Allan Sandfeld Jensen
041cbe4b38 Add missing RGB32 <-> RGB30 convertions
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>
2015-04-30 19:27:39 +00:00
Allan Sandfeld Jensen
7432c7c08a Cleanup and optimization of qimage smoothscale
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>
2015-04-15 11:25:41 +00:00
Allan Sandfeld Jensen
59f168c5e5 Optimize fallback RGB888 to RGB32 conversion
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>
2015-03-03 13:38:17 +00:00
Allan Sandfeld Jensen
22b5c39e8e Optimize generic conversion and remove now obsolete direct conversions
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>
2015-02-13 13:20:52 +00:00
Marc Mutz
09205f662e QtGui: assorted migrations to QString::asprintf
Change-Id: Ibb177b22064efcad56ace60935e9c8759a87a3c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-12 19:39:54 +00:00
Jani Heikkinen
83a5694dc2 Update copyright headers
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>
2015-02-11 06:49:51 +00:00
Allan Sandfeld Jensen
89edf43c44 Generate SSE4.1 versions of premultiplying methods where convenient
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>
2015-02-04 19:37:22 +00:00
Tor Arne Vestbø
c5db8fc74a Make it more obvious that Q_WS_ is dead code, and should perhaps be ported
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>
2015-02-03 11:49:14 +00:00
Allan Sandfeld Jensen
9be87085d8 Only use 32bit version of qPremultiply
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>
2015-02-02 11:14:00 +00:00
Lars Knoll
bcf6a3eb34 Remove unused class QPaintBuffer
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>
2015-01-28 15:44:18 +00:00
Matti Paaso
974c210835 Update license headers and add new license files
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3
- Removed LICENSE.GPL

Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-24 12:26:19 +02:00
Jędrzej Nowacki
82d4c4a039 Add missing to gui/kernel benchmarks.
kernel.pro was not updated.

Change-Id: Ibe11aaf5d6e788dacd2a2d33088fb9445334fb4e
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-07-28 08:39:33 +02:00
Jędrzej Nowacki
21a58910b2 Remove useless QMetaType benchmarks
Cost of a type lookup for core built-in types is really small, just few
cpu instructions, but the benchmark was testing create() and destroy()
functions (in a different fashion) which by definition allocate and
de-allocate memory. These memory operations are significantly more
expensive which obfuscate the results.

Change-Id: I33c679f57e6c2b57e98328f076dfe249ab7bcde8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-28 08:39:29 +02:00
Friedemann Kleint
eb66916082 Fix some compiler warnings in benchmark tests.
main.cpp(332) : warning C4307: '*' : integral constant overflow
tst_qpainter.cpp(1293) : warning C4305: '+=' : truncation from 'double' to 'float'
tst_qpainter.cpp(1474) : warning C4305: '+=' : truncation from 'double' to 'float'
tst_qtbench.cpp(155) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
main.cpp(68) : warning C4189: 'fontHeight' : local variable is initialized but not referenced

Change-Id: If6aadd50df7c5cf7d0f33791c9247730a47ddd27
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-07-14 10:55:55 +02:00
Friedemann Kleint
27797cb37a MSVC: Fix the compilation of benchmark tests with strict string literals.
Introduced by 9f0e5d00ab .

Change-Id: I704501bd7e543d971f9b8c9e75746b5749126c5f
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-07-10 09:02:04 +02:00
Allan Sandfeld Jensen
5f59207bd3 Optimize drawing to and from generic formats
When drawing to and from the less common formats most of the cpu time
is spend in conversion. The conversion method is rather slow due to
using variable shifts and masks that the compiler does not have a chance
to optimize.

This patch changes the conversion methods to being templates fed by
constexpr methods. This allows the compiler to fully optimize the methods
yielding 2x->5x speedups.

The reliance on constexpr however means the optimized methods are only
used under C++11.

Change-Id: I2ec77c4c1c03f12ee463a694a2b59db0f0b52db1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-31 00:24:48 +01:00
Oswald Buddenhagen
882bf3475c expand tabs and related whitespace fixes in *.{cpp,h,qdoc}
the diff -w for this commit is empty.

Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-13 22:46:50 +01:00
Thorbjørn Martsum
03c5eacfbb resizeToContents - QTableView - faster hint when view is hidden
In some situations we can get into resizeSections in a hidden
QHeaderView. If the headerView is hidden then we look at all the
rows, and that can be extemely expensive for a large model.

This patch limits the sizeHint with only looking at a maximum
1000 rows. Though this is more inaccurate it is also faster -
and it is not much different from what QTreeView does.

Change-Id: Ief4b54c5a3c5a0db02e8b595c9b9b3162633ee67
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-09 06:44:54 +02:00
Axel Waggershauser
b11317a643 Whitespace cleanup: remove trailing whitespace
Remove all trailing whitespace from the following list of files:
*.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README
excluding 3rdparty, test-data and auto generated code.

Note A): the only non 3rdparty c++-files that still
have trailing whitespace after this change are:
* src/corelib/codecs/cp949codetbl_p.h
* src/corelib/codecs/qjpunicode.cpp
* src/corelib/codecs/qbig5codec.cpp
* src/corelib/xml/qxmlstream_p.h
* src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
* src/tools/uic/ui4.cpp
* tests/auto/other/qtokenautomaton/tokenizers/*
* tests/benchmarks/corelib/tools/qstring/data.cpp
* util/lexgen/tokenizer.cpp

Note B): in about 30 files some overlapping 'leading tab' and
'TAB character in non-leading whitespace' issues have been fixed
to make the sanity bot happy. Plus some general ws-fixes here
and there as asked for during review.

Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-16 20:22:50 +01:00
Oliver Wolff
5dbd42a62e Check for network module when building according benchmarks
Change-Id: I5e4cb3ef6fdb5de772d13029c11170d0f0eb3ee5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:21:08 +01:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
Stephen Kelly
ee7dbf97bb Benchmarks: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Iba4b7f8ff7a1c7974d144b955cbf064e43b36ec7
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 18:19:28 +01:00
Oswald Buddenhagen
586adeabe4 add and use qtHaveModule() function
this is much more elegant than the so far propagated !isEmpty(QT.foo.name).
also replace feature-specific tests (no-gui and no-widgets) and the
obsolete contains(QT_CONFIG, foo) syntax.

Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-12-21 19:05:02 +01:00
Oswald Buddenhagen
5ea41a2efa properly syncqt-ize harfbuzz headers
we were already installing them into QtCore/private, so turn them into
proper private headers to start with. this cleans up our project files.

Change-Id: I0795f79e03b60b5854de9e4dc339e9b5a5e6fd87
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-04 13:57:55 +01:00
hjk
c527dd44be Examples: Install to $$[QT_INSTALL_EXAMPLES]/$submodule/$example
This makes the structure of the examples after an 'make install'
similar to the one in a 'developer build'.

Change-Id: I9120bd741fab332e64e30adc01cefe87e5633454
Reviewed-by: Martin Smith <martin.smith@digia.com>
2012-11-26 14:35:23 +01:00
Marc Mutz
2ec2edc24d normalise signal/slot signatures [QtGui tests]
Change-Id: I42e11de9ef1d8a04b2a8e200afb84f2245f3361a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-22 08:41:27 +02:00
Stephen Kelly
c153f471d2 Remove QImageReader benchmark dependency on QtWidgets.
The QLabel is not actually used.

Change-Id: Ia3f43b734fa52ad002111943ed1ba55b9e8a678c
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-10-16 15:29:15 +02:00
Pierre Rossi
9adf7fb708 Revert "Handle additional format ranges when itemizing."
This reverts commit 101d04681f.
That change seems to have introduced a few regressions, and
Creator hits an assertion that it introduced because it assumes
the additionalFormats consists of well-formed ranges
(QTCREATORBUG-7995).

Change-Id: Ic4ae761e6e7f6df8a6b5ca565ceb250647420c15
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-10 23:27:03 +02:00
Pierre Rossi
101d04681f Handle additional format ranges when itemizing.
This is useful when the additional formats are used on a
text layout using a raw font. It can also come in handy for
input methods operating on a QTextDocument.
We now consider all format range edges to generate the
associated items. The capitalization can be overridden via
the additionnal formats mechanism.

Adds an autotest that checks that this works with font capitalization.

Change-Id: I782d2c48d05b0dfbad480a9ca77198465292b358
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-08 17:22:56 +02:00
Iikka Eklund
be15856f61 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 19:20:11 +02:00
Sean Harmer
51d40d7e9b Make gui/math3d classes use float rather than qreal
This corrects the mismatch between using floats for internal storage
and qreal in the API of QVector*D which leads to lots of implicit
casts between double and float.

This change also stops users from being surprised by the loss of
precision when using these classes on desktop platforms and removes
the need for the private constructors taking a dummy int as the final
argument.

The QMatrix4x4 and QQuaternion classes have been changed to use float
for their internal storage since these are meant to be used in
conjunction with the QVector*D classes. This is to prevent unexpected
loss of precision and to improve performance.

The on-disk format has also been changed from double to float thereby
reducing the storage required when streaming vectors and matrices. This
is potentially a large saving when working with complex 3D meshes etc.

This also has a significant performance improvement when passing
matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no
longer have to iterate and convert the data to floats. This is
an operation that could easily be needed many times per frame.

This change also opens the door for further optimisations of these
classes to be implemented by using SIMD intrinsics.

This needs to be applied in conjunction with

https://codereview.qt-project.org/#change,33548

Task-number: QTBUG-21035
Task-number: QTBUG-20661
Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-07 13:27:38 +02:00
Milian Wolff
0102f34f1e Optimize QTextLayout/QTextEngine usage outside of QTextDocument.
When QTextLayout is used in a QTextDocument, many code paths use
special caches and thus greatly outperform the raw QTextLayout version
that operates directly on a QString.

This patch brings some of these optimizations also to the raw version.
We now also use a QFormatCollection in such cases and enable the
functionality of QTextEngine::indexAdditionalFormats() and
QTextEngine::resolveAdditionalFormats(). Thanks to that, we can greatly
speed up QTextEngine::format(), which now uses an amort O(1) hash table
lookup instead of a O(N) linear search.

The added benchmark shows a gain in the order of one magnitude:

./tst_bench_QText formattedLayout:long-many

before applying the patch:
378.19 msecs per iteration (total: 37,820, iterations: 100)
after applying the patch:
25.80 msecs per iteration (total: 2,580, iterations: 100)

Note: This change is source-incompatible for applications using the private
QTextEngine API.

Task-number: QTBUG-8389
Change-Id: Ifcf7a8902a394428979ea06a6d955f886ee739c7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-05 03:02:59 +02:00
Thiago Macieira
672b5b7ab6 Set the Qt API level to compatibility mode in all tests.
Qt 5.0 beta requires changing the default to the 5.0 API, disabling
the deprecated code. However, tests should test (and often do) the
compatibility API too, so turn it back on.

Task-number: QTBUG-25053
Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-01 15:37:46 +02:00
Rohan McGovern
650cdb62bd Make benchmarks compile without QtWidgets
Ensure benchmarks which need QtWidgets are gracefully disabled when
that module is unavailable.

Fixed one unnecessary usage of "QT+=widgets".

Change-Id: I8031b5dca585749f0f4d22e0637adc3f57f4e418
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-07-30 10:43:50 +02:00
Sergio Ahumada
59339941e0 Fix some spelling errors
Change-Id: I19d3b2e9a5180b13deb828b55195404ef20be295
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-07-11 14:52:37 +02:00