diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-14 15:27:24 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-08-17 10:56:41 +0200 |
commit | 55dff384c1c8361a65feed452584d40ad9e1bcb0 (patch) | |
tree | 5f4816526f33e8b2f8e13e9890084f8210de097b /src/quick/util | |
parent | 7a5987b360b63a479737edd7c8677c507d72d93c (diff) |
Use qHashMulti in qHash(QQuickPixmapKey)
Amends 9cc4568de330e0075c960a5431ecd69a1f9a761d (and others).
Change-Id: Ic67a34ffb903d79882d4a74415f52db5a79d30d6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickpixmapcache.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 891e3836b0..bc5890a54a 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -1028,13 +1028,9 @@ inline bool operator==(const QQuickPixmapKey &lhs, const QQuickPixmapKey &rhs) lhs.options == rhs.options; } -inline size_t qHash(const QQuickPixmapKey &key) +inline size_t qHash(const QQuickPixmapKey &key, size_t seed) noexcept { - return qHash(*key.url) ^ (key.size->width()*7) ^ (key.size->height()*17) ^ (key.frame*23) ^ - (key.region->x()*29) ^ (key.region->y()*31) ^ (key.options.autoTransform() * 0x5c5c5c5c); - // key.region.width() and height() are not included, because the hash function should be simple, - // and they are more likely to be held constant for some batches of images - // (e.g. tiles, or repeatedly cropping to the same viewport at different positions). + return qHashMulti(seed, *key.url, *key.region, *key.size, key.frame, key.options.autoTransform()); } class QQuickPixmapStore : public QObject |