summaryrefslogtreecommitdiffstats
path: root/util/gradientgen/WEBGRADIENTS_LICENSE.txt
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-06-10 15:57:52 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-12-14 11:31:46 +0100
commit5b4b437b30b320e2cd7c9a566999a39772e5d431 (patch)
treebfaf7959a37e840ee886d0471134a133eefc7685 /util/gradientgen/WEBGRADIENTS_LICENSE.txt
parent4522b17159a29ffd12c4d93be8a6e8e1a05dccd0 (diff)
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>
Diffstat (limited to 'util/gradientgen/WEBGRADIENTS_LICENSE.txt')
-rw-r--r--util/gradientgen/WEBGRADIENTS_LICENSE.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/util/gradientgen/WEBGRADIENTS_LICENSE.txt b/util/gradientgen/WEBGRADIENTS_LICENSE.txt
new file mode 100644
index 0000000000..1a4d527a4d
--- /dev/null
+++ b/util/gradientgen/WEBGRADIENTS_LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 itmeo
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.