Commit Graph

38253 Commits

Author SHA1 Message Date
Jędrzej Nowacki
b28502182b Handle errors in moc generate.sh script
The script was happily ignoring all errors, relaying on a user reading
output.

Change-Id: I85edd228a40b5459c4649ab0c0bbbe3042a3abf5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-12-12 06:21:24 +00:00
Thiago Macieira
58f2aa907f Work around GCC bug in generating 64-bit population of SSE register
We know what code we want it to generate, so I just replaced the
_mm_set1_epi64x() with the code we want it to generate. Except that GCC
sees through and tries to "optimize" my code... so that asm() statement
makes it separate the two operations.

This generates optimal code for both 32- and 64-bit.  64-bit:
        vmovq   %rdi, %xmm0
        vpbroadcastq    %xmm0, %ymm0
32-bit:
        vmovq   8(%esp), %xmm0
        vpbroadcastq    %xmm0, %ymm0

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80820 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87976

Change-Id: I42a48bd64ccc41aebf84fffd15664109b97fe42b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-12 03:44:31 +00:00
Thiago Macieira
3df79b2953 Add an SSSE3 implementation of qt_memfill24
Brought to you by the PSHUFB instruction, introduced in SSSE3
(implementation also uses PALIGNR just because we can).

The tail functionality makes use of the fact that the low half of
"mval2" ends in the correct content, so we overwrite up to 8 bytes close
to the end.

Change-Id: Iba4b5c183776497d8ee1fffd15646a620829c335
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-12 03:44:28 +00:00
Allan Sandfeld Jensen
33177b0456 Add a qt_memfill24 implementation
This function gets called from qt_rectfill_quint24, which is used by the
RGB666, ARGB6666_Premultiplied, ARGB8555_Premultiplied, and RGB888
formats.

Together-with: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Iba4b5c183776497d8ee1fffd1564585fdee835c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-12 03:44:11 +00:00
Tor Arne Vestbø
db0616097f Actually make QT_MAX_CACHED_GLYPH_SIZE the max glyph size
This effectively means we'll start drawing text with a pixel size
of 64 using cached glyphs, whereas before we would treat this as
the cutoff and draw it using painter paths.

Change-Id: Ie58212ef9217c8f8a69a92e48a8788f191b99415
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-11 23:41:37 +00:00
Thiago Macieira
986e49992c Use Q_DECL_VECTORCALL in a few more places
There were a few functions that passed vectors in parameters but did not
mark as vectorcall.

I've taken the opportunity to de-macroify one macro, but I'm not going
to do it for the rest.

Change-Id: I42a48bd64ccc41aebf84fffd1564bfc21faa2a14
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-11 19:05:01 +00:00
Thiago Macieira
40894d1a60 Add AVX2 versions of qt_memfill32 and qt_memfill64
The implementation is almost the same 4-way-unrolled loop, but because
of the wider registers, we fill 128 bytes per loop. Unlike the SSE2
implementation, the AVX2 version uses unaligned stores and won't try to
align in the prologue, matching glibc's __memset_avx2 (also unaligned).

Change-Id: Iba4b5c183776497d8ee1fffd15637ccb2a7b83bc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-11 19:04:59 +00:00
Thiago Macieira
a440aada72 Add SSE2 qt_memfill64
Implemented by merging with the qt_memfill32 implementation in a
non-inlining function.

Change-Id: I343f2beed55440a7ac0bfffd15636f8ba995a2bd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-11 19:04:58 +00:00
Thiago Macieira
12e843581a QResource: quick refactor of registerSelf for files to support LFS
This commit adds sufficient support for large files in resources, but
not completely because the rest Qt is not ready for it (and not
tested). We've had the QT_MMAP macro in qplatformdefs.h for a while, so
let's use it and use qsizetype where we can.

This also the check that the file existed before opening it (you can
only open it if it exists), plus a few nullptr updates.

Change-Id: I42a48bd64ccc41aebf84fffd15653ffdabb0e66b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-11 19:02:59 +00:00
Alberto Mardegan
9ee29b826c QCommonStyle: fetch flat property from style option
The same information is available both from the QGroupBox API and from
the QStyleOption; we should prefer the latter, because this makes it
easier to use QStyle from QQuick.Controls (where a QGroupBox is not
instantiated).

Change-Id: I05ed1e3406676bde5d124d395d43caa0961c4f2d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-11 14:04:10 +00:00
Christian Ehrlicher
e56c79dc9d QTreeWidget: mark is/setFirstItemColumnSpanned() as deprecated
Deprecate the QTreeWidget functions is/setFirstItemColumnSpanned() to
stay in sync with the other deprecated functions
(selected/expanded/hidden) so they can get removed in Qt6.
Also add a small unit test for them.

Change-Id: Ie1cb5d7163c2d56d653c21e841ccaf7d38569787
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-11 06:46:42 +00:00
Thiago Macieira
f56ca2c4f6 QResource: de-inline registerSelf for files
No other changes, aside from the coding style update to make sure the
coding style bot won't complain.

Change-Id: Iae320a2868db402a993dfffd15689a8a6ac202e8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-11 03:58:55 +00:00
Thiago Macieira
57b4b45cbd RCC: introduce compression algorithm "best"
This compression algorithm is permitted in the XML sources, which
instructs RCC to apply the best compression algorithm it has available.
If we have Zstandard available, that's its level 19 (levels 20 and up
are experimental). If not, we apply zlib compression level 9.

And apply this technique for the XDG MIME database that is built-in to
QtCore.
             Payload size  Compr. time
 Previously        313916    17.9ms
 Zlib -9           310899    53.6ms
 Zstd -14          253364    63.3ms (plus 4.0 ms on L1 heuristic check)
 Zstd -19          230647   642.5ms

Change-Id: I343f2beed55440a7ac0bfffd1562de44dbaf09cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-11 03:57:41 +00:00
Thiago Macieira
2c9ac4fc3f RCC: Add support for Zstandard compression
[ChangeLog][RCC] RCC now supports compressing content using the
Zstandard (https://zstd.net) algorithm. Compared to zlib, it compresses
better for the same CPU time, so this algorithm is the default. To go
back to the previous algorithm, pass command-line option
--compress-algo=zlib. Compression levels range from 1 (fastest, least
compression) to 19 (slowest, best compression). Level 0 tells the
library to choose an implementation-defined default.
\
The default compression level is "heuristic" (level -1): under this
mode, RCC will attempt a very fast compression (level 1) and check if
the file was sufficiently compressed. If it was, then RCC will compress
again using an implementation-defined level.

The following are the 4 biggest files we store as resources in qtbase:
 Orig Size Name
   2197605 src/corelib/mimetypes/mime/packages/freedesktop.org.xml
   2462423 tests/auto/corelib/tools/qchar/data/NormalizationTest.txt
   6878748 tests/auto/other/qcomplextext/data/BidiCharacterTest.txt
   7959972 tests/auto/other/qcomplextext/data/BidiTest.txt

The current RCC (zlib, level -1 "default" and level 9), produces for
those files:
                        L(-1)    Compr.   L9      Compr.    Decomp.
 Name                   Ratio  CPU time   Ratio  CPU time   CPU time
BidiCharacterTest.txt   16.9:1  106.1ms   17.2:1  789.3ms     5.1ms
BidiTest.txt             6.3:1  228.0ms    6.1:1 1646.3ms    10.9ms
freedesktop.org.xml      7.0:1   17.5ms    7.1:1   53.6ms     2.6ms
NormalizationTest.txt    5.8:1   41.2ms    5.9:1  256.4ms     3.4ms

Zstandard produces the following for levels 1 ("check"), 14 ("store")
and 19 ("best"):
                       L1     Compr.   L14    Compr.    L19    Compr.     Decomp
 Name                  Ratio  time     Ratio  time      Ratio  CPU time   time
BidiCharacterTest.txt  15.8:1  8.0ms   26.1:1 168.9ms   49.2:1 2504.7ms    3.8ms
BidiTest.txt            8.2:1 17.0ms    8.7:1 323.9ms   14.9:1 1700.9ms   12.1ms
freedesktop.org.xml     6.7:1  4.0ms    8.7:1  63.3ms    9.5:1  642.5ms    1.7ms
NormalizationTest.txt   5.7:1  5.0ms    7.5:1  54.0ms    8.4:1  447.3ms    3.0ms

This shows use of zstd at the default RCC level settings always produce
smaller outputs compared to the current zlib-based defaults, with
roughly 50% CPU increase. It also produces better results at less CPU
time than the best compression zlib has to offer.

More importantly, the decompression time reduces in all cases (the
numbers listed are for max compression, with slightly better results for
the defaults).

For the sake of comparison, the same files compressed with libxz at
levels 3 and 6:
                        Level 3         Level 6           Decompr.
 Name                   Ratio   CPU     Ratio  CPU        time
BidiCharacterTest.txt   28.5:1 109.1ms  42.9:1 1390.5ms   16.7ms
BidiTest.txt            10.7:1 281.0ms  18.4:1 2333.1ms   43.6ms
freedesktop.org.xml      9.1:1  62.0ms  10.2:1  499.1ms   12.0ms
NormalizationTest.txt   10.2:1  75.5ms  13.2:1  417.6ms   14.7ms

LZMA at level 3 consumes roughly the same CPU time as Zstd at level 14
and produces incrementally smaller results, but the decompression time
increases considerably. It's not a good trade-off for the Qt resource
system.

Change-Id: I343f2beed55440a7ac0bfffd1562d754bd71d964
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-11 03:57:37 +00:00
Thiago Macieira
f25bc30d8d QResource: add support for resources compressed with Zstandard
See next commit for details on why this is a good idea.

[ChangeLog][Important Behavior Changes] The Qt resource system now
supports compressing content using the Zstandard (https://zstd.net)
algorithm. Compared to zlib, it compresses better for the same CPU time,
so this algorithm is the default. QResource::isCompressed() returns true
for either compression algorithm. Use QResource::compressionAlgorithm()
to find out which algorithm to decompress. QFile will automatically
decompress using the correct algorithm.

Change-Id: I343f2beed55440a7ac0bfffd1562e9a8f94933a7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-11 03:57:35 +00:00
Thiago Macieira
163b5c0278 RCC: Modernize the compression algorithm selection
Instead of using compression level -2 to indicate no compression,
introduce CompressionAlgorithm::None and an equivalent XML attribute.
This commit includes some extra error checking for RCC.

Change-Id: I343f2beed55440a7ac0bfffd1562d64b024463ba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-11 03:57:32 +00:00
Qt Forward Merge Bot
c18c63033e Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-12-11 00:47:12 +00:00
Qt Forward Merge Bot
a2fd99c430 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I91e684e74c36467efda8ded6ed19791baa0c1a1f
2018-12-11 01:00:13 +01:00
Ryan Chu
75ee55e22a Docker Provisioning: Update the SHA-1 tag of server images
This update is used to free the dependencies of the specific Ubuntu
packages. It ensures that test server is using the latest version of the
Ubuntu packages to test network changes.

Change-Id: I3257f435e6da02e3c6d5a141ece9c5d025e13065
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-10 22:41:20 +00:00
Jesus Fernandez
b3008f8e25 Use QScopedPointer instead of new/delete
Change-Id: I0651ad0244c1b4d3126a1dd3304f247f92240ffa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-12-10 22:14:56 +00:00
Ivan Komissarov
177577932e qwindowsxpstyle: Add std::nothrow to new
There is no sense in testing the 'buf' pointer against null, as the
memory was allocated using the throwing 'new' operator. However, since
this function already can fail in other cases, the 'buf' pointer can be
checked for nullptr after the nothrow new.

Task-number: QTBUG-71156
Change-Id: Ibca5d672544d3980dd8890474e3e2fbf7443e05d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-10 21:15:09 +00:00
Christian Ehrlicher
b688c7e99a DropSite example: fix documentation
The DropSite documentation mentioned the foreach keyword which was
removed some times ago in the code. Therefore also remove the
corresponding documentation snippet.

Change-Id: Id9dd3f01dbdd37eeda43fabe12b60ef9e0b32d10
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-12-10 18:38:56 +00:00
Edward Welbourne
d43ac840e5 Specify the date-time spec when setting max time
QDateTimeEdit::setMaximumTime() constructed a QDateTime from the given
time and its current max date without propagating its existing spec;
it thus got a local time.  All other QDateTimeEdit methods setting
bounds do propagate the spec.  So bring setMaximumTime() in line with
the others.

Fixes: QTBUG-71311
Change-Id: Ic97d22185f76bed46bc8d2884b131942874d9a0a
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-10 15:39:20 +00:00
Sergio Martins
8576354b88 QtDbus: Remove unused QStrings [-Wclazy-unused-non-trivial-variable]
Change-Id: Iea776554aa5e01ecc6fa08ac2c8fb7b720d57126
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-10 13:05:41 +00:00
Sergio Martins
f5ba938e17 QtGui: Remove unused brushes [-Wclazy-unused-non-trivial-variable]
Change-Id: If7e5340ec8acdfd70ea919286da5940db7a4def9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-12-10 13:05:38 +00:00
Sergio Martins
19d7bd3d63 Fix a couple of unused QStrings
This is needed so we can add Q_WARN_UNUSED to QString.
The xcb one might even be a bug.

Change-Id: Ia2d2563bdd10aa747014410df4990597969f4634
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-12-10 13:05:18 +00:00
Richard Moe Gustavsen
826b09f0c5 Fix build of static plugins with resources
This patch reverts 388c4ef9f7. The reason is that it generates a symbol
(resource_init_function) based on the name of the pro-file. But if different
plugins are built from a pro-file with the same name, you end up linking in
many symbols with the same name as well. Which one that ends up being used at
runtime will typically depend on the linking order of the plugins.

This problem will happen if you build an app for iOS that uses both controls 1
and controls 2. In that case, both QML plugins are built from a "controls.pro"
file. At runtime, only one of the plugins will be imported correctly.

This patch therefore reverts 388c4ef9f7, but at the same time, to not
re-introduce the problem it fixed, we instead genereate both a debug and release
version of the plugin_resources.cpp file. That way we can still depend on the
TARGET variable for generating both the resource_init_function symbol and the
cpp file.

Fixes: QTBUG-62647
Fixes: QTBUG-71386
Fixes: QTBUG-72108
Change-Id: I3d8c53132458b30ed9f47a259f1f8e4fa4d44130
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-10 12:18:52 +00:00
Andy Shaw
e25d7b1441 Add a means to specify the protocol type, to aid websockets over proxy
When a PAC script is used on macOS, it will only allow connections for
http/https, although a proxy can be used for ws/wss. Therefore we need
to add a means of setting the protocol type for this sort of connection
so that we can pass on the necessary information to the PAC script.

Change-Id: I3fa29fa85a529bd88d9565daa58fe9d748b61a92
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-10 12:16:48 +00:00
Sergio Martins
3464e1e5c7 Add a few qAsConst() to range-for to prevent detachments
places indicated by clazy

As a drive-by, fixed minor styling issues in the affected lines.

Change-Id: I88d3fc0c8573cde0e61f19a18dd9ea697ee40c34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-12-10 11:47:28 +00:00
Lars Knoll
fc85a6b6b9 QTypeInfo: use C++11 type traits to deduce if a type is static or complex
All types that can be trivially copied and destructed are by definition
relocatable, and we should apply those semantics when moving them in
memory.

Types that are trivial, are by definition not complex and should be
treated as such.

[ChangeLog][QtCore] Qt Containers and meta type system now use C++11
type traits (std::is_trivial, std::is_trivially_copyable and
std::is_trivially_destructible) to detect the class of a type not
explicitly set by Q_DECLARE_TYPEINFO. (Q_DECLARE_TYPEINFO is still
needed for QList.)

Done-with: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Change-Id: Iebb87ece425ea919e86169d06cd509c54a074282
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-10 08:13:58 +00:00
Joerg Bornemann
6a221f3d05 Fix qmake's detection for conflicting source files for nmake
Consider the following source tree:
  foo/narf.cpp
  bar/narf.c
  bar/gnampf.cpp

The .pro file has
  SOURCES += foo/narf.cpp bar/gnampf.cpp
The file bar/narf.c is not supposed to be built for whatever reason.

QMake's nmake Makefile generator generates inference rules of the form

  {.\foo}.cpp{debug\}.obj::
  ...

for every source subdirectory and every source file extension.
Thus, we have

  {.\foo}.cpp{debug\}.obj::
  {.\bar}.cpp{debug\}.obj::
  {.\bar}.c{debug\}.obj::

Depending on the exact execution order of the inference rules (which
depends on the names of the files) the latter rule might get picked,
and we're erronously compiling bar/narf.c even though it's not
referenced in the .pro file.

Conclusion: QMake's detection of conflicting source files must
consider the base names of source files, and not the exact file names.

Fixes: QTBUG-72059
Change-Id: I50c2725ae2a7421053369a10680230f571af00ea
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-10 06:46:15 +00:00
Joerg Bornemann
ed90c306f2 Fix addition of the wasm platform plugin
Add the plugin; do not replace the whole SUBDIRS value.

Fixes: QTBUG-70375
Change-Id: Id40a69f54dfde5eb88894323c7e1146b6cad5a75
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-12-10 06:45:03 +00:00
Andy Shaw
d391d4db49 Fusion: Don't draw the background of the lineedit when drawing the frame
Since only the frame is being drawn here, it should only draw the
outline. Otherwise it will override any background drawing done via a
stylesheet.

Change-Id: I408fc44743747ad369c700b3d52935bfc8826f11
Fixes: QTBUG-71950
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-12-10 06:28:13 +00:00
Lorn Potter
45c358b0da threads: disable threads examples for nothread builds
Change-Id: I2c253de973f5399c5ed68194b969ccebe457c689
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-10 05:36:08 +00:00
Qt Forward Merge Bot
9c325e0a3c Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12 2018-12-10 02:11:37 +00:00
Steve Mokris
ba304af284 Refresh QGuiApplication's devicePixelRatio cache when screens change
Task-number: QTBUG-63548
Change-Id: Id934cda6e15449c00c80a646055899f49580da88
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-12-10 01:45:29 +00:00
Qt Forward Merge Bot
0a88c5e92b Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: If49df791f73e9edf616baa094e0f301a44cb853d
2018-12-10 01:00:19 +01:00
Tor Arne Vestbø
161c569314 macOS: Reset font glyph caches when application theme changes
Our glyph caches on 10.14 are based on the application appearance, so when
the application goes from dark to light or light to dark, we need to reset
and re-populate the glyph-caches to account for the new appearance.

Change-Id: If019d8cfa33ffb2b14747444b2ff74b288992f55
Fixes: QTBUG-71018
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-09 23:22:14 +00:00
Dmitry Shachnev
8d7542acad Do not use arc4random_buf() on GNU/kFreeBSD
It is not available in the GNU C Library.

Change-Id: I36dc92fca283c126669885b75406c8e57f563ce3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-09 18:19:59 +00:00
Samuel Gaist
b2297e595c QUrlQuery: Implement initializer list constructor
[ChangeLog][QtCore][QUrlQuery] QUrlQuery now provides an
initializer list constructor. It can be created using a list of
key/value pairs.

Fixes: QTBUG-68645
Change-Id: Ief5939aa477718f6dd3580f2c60f95ff3aa892ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-09 11:35:27 +00:00
Qt Forward Merge Bot
fc11604964 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I10ae61ec6867b38601d85d6fc34e1f6a6ba0cc11
2018-12-09 01:00:43 +01:00
Thiago Macieira
d36a4fc197 Optimize further the loading of 8 Latin 1 characters
This is important when AVX is enabled, which makes the VMOVQ load and
the VPMOVZXBW instruction be combined into a single VPMOVZXBW with
direct memory access. This is guaranteed to only read 8 bytes, so it's
safe even close to the end of a page. Clang and ICC do combine the
instructions like we want and I have filed a request for GCC to do so
too[1].

AVX was first introduced in 2011, so plenty of computers today would
benefit from this.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87317

Change-Id: I8f261579aad648fdb4f0fffd1553e08e90df3171
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-08 20:28:56 +00:00
Tor Arne Vestbø
2e715c31ed Allow overriding the maximum cached glyph size via the environment
Useful for testing.

Change-Id: I8cfd4453018cba0301287ad6a1c15a88cdc33c1c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-08 15:27:16 +00:00
Tor Arne Vestbø
e12aad05f0 Add manual test case for verifying our text rendering
Allows comparing Qt's text rendering to the native rendering.

Change-Id: I56f015fb64df3f70c33db58891876c325cbbc55d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-08 15:27:06 +00:00
Allan Sandfeld Jensen
a71f50edc6 Revert "Ensure alignment of image-data"
This reverts commit ae8389e19c.

The result of malloc should be aligned in any case, and
this change conflicts with the use of realloc on the data elsewhere.

Change-Id: I01773132b240614a2656dd3013490b0df9cd14a7
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-08 08:53:54 +00:00
Christian Ehrlicher
25231c4048 QToolButton: Don't elide text if an icon is present
The previous fix which adds an automatic text elision when the
QToolButton is not large enough brought up an inconsistency between
QToolButton::sizeHint() and QCommonStyle::drawControl().
Fix it by syncing the magic numbers between QToolButton::sizeHint() and
QCommonStyle::drawControl().

Fixes: QTBUG-72226
Change-Id: If4a76792cb97bcdb918e18c6b29cb637730acec0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-12-08 07:25:32 +00:00
Shawn Rutledge
c4ee125891 Set QScroller's parent to its widget, for memory management
If the widget to which the scroller was assigned is deleted, the
QScroller ought to be deleted too, to avoid filtering events and then
following a dangling pointer while trying to react.

Fixes: QTBUG-71232
Change-Id: I62680df8d84fb630df1bd8c482df099989457542
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
2018-12-08 07:18:15 +00:00
Qt Forward Merge Bot
f8c5c13564 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ied1194730e75a6f30839bbf5429aa2699230288e
2018-12-08 01:01:00 +01:00
Oswald Buddenhagen
501ff0a18c untangle the egl-x11 relationship in the build system
egl-x11 is used in two places:
- the eglfs-x11 plugin, which has a hard dependency on xcb-xlib
- the xcb-egl plugin, which has a soft dependency on xcb-xlib

that means that the egl-x11 configure test needs to be untangled from
xcb, and that eglfs-x11 should be a separate feature with a proper
dependency declaration.

when the plugins that need egl-x11 are not built, it also makes no sense
to build the respective integration in the egl_support module (even if
it's possible to coax it into building), so adjust things accordingly.

Change-Id: Ic729d0b7c893dd00844567329205c24ea2703033
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-12-07 23:49:15 +00:00
Oswald Buddenhagen
3ee7aa72b7 configure: atomize xcb-* tests properly
xcb is a dependency which should be detected upfront.
same for xlib.

this also removes calls to functions coming from the dependencies from
the tests (both because these calls prove nothing, and because at some
point we will stop linking transitive deps).

Change-Id: Iac77305eab33ea8ff5c71302cef980eb908d8403
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-12-07 23:49:04 +00:00