qt5base-lts/tests/auto/gui
Giuseppe D'Angelo 5b4b437b30 WebGradients: redo implementation
The previous implementation was *extremely* expensive. It
relied on loading a binary JSON file from resources (which
involved decompressing it), then extracting information out of
it to build a gradient.  Already-loaded gradients were kept in
a local cache, which had to be mutex protected.

Instead, this patch extends the gradient generator to build
static arrays filled with the web gradient data, sitting in
.rodata.

These arrays are used when building QGradient objects with a
web gradient. No explicit mutex protection is necessary, since
accesses will just read from the arrays.

As benefits, this patch removes:

* the binary json representation from QtGui's resources (~4KB
compressed, ~50KB uncompressed)
* the overhead of reading from the JSON for each used web
gradient;
* the startup costs of registering the webgradients in the
resources;
* all the overhead of mutex locking when building such
gradients;
* all the runtime memory allocations to load, parse and cache
the web gradients (including the memory + CPU spike on first
load due to the uncompression of the JSON data, as well as a
couple of deep copies).

Change-Id: If5c3d704430df76ce8faf55ee75ebd4639ba09c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-12-14 11:31:46 +01:00
..
image Merge remote-tracking branch 'origin/5.14' into 5.15 2019-11-08 09:11:02 +01:00
itemmodels QStandardItemModel: do not reset persisten index in setItem() 2019-12-14 08:46:05 +01:00
kernel Merge remote-tracking branch 'origin/5.14' into 5.15 2019-12-04 01:00:07 +01:00
math3d Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
painting WebGradients: redo implementation 2019-12-14 11:31:46 +01:00
qopengl unblacklist passing tests 2019-07-08 11:01:42 +00:00
qopenglconfig Deprecate conversion functions between QList and QSet 2019-05-07 14:15:44 +00:00
qvulkan Merge remote-tracking branch 'origin/5.10' into dev 2017-10-17 10:34:24 +02:00
rhi RHI: new native texture API 2019-12-05 10:04:46 +01:00
text Merge remote-tracking branch 'origin/5.14' into 5.15 2019-12-10 13:51:40 +02:00
util QDoubleValidator: Fix thousand separator handling 2019-12-05 11:30:24 +01:00
gui.pro Introduce the Qt graphics abstraction as private QtGui helpers 2019-06-13 10:13:45 +02:00