Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: src/core/SkBitmapCache.cpp

Issue 668223002: SkResourceCache::Key namespace support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: unused SkPictureShader headers Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/ImageCacheBench.cpp ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapCache.cpp
diff --git a/src/core/SkBitmapCache.cpp b/src/core/SkBitmapCache.cpp
index 13ec5aa96126dd4a0fe7ef39b54b19c9ebbc943f..193a5ae53627fffc223b563a23a34c01b3ae9004 100644
--- a/src/core/SkBitmapCache.cpp
+++ b/src/core/SkBitmapCache.cpp
@@ -28,6 +28,9 @@ static SkIRect get_bounds_from_bitmap(const SkBitmap& bm) {
return SkIRect::MakeXYWH(origin.fX, origin.fY, bm.width(), bm.height());
}
+namespace {
+static unsigned gBitmapKeyNamespaceLabel;
+
struct BitmapKey : public SkResourceCache::Key {
public:
BitmapKey(uint32_t genID, SkScalar scaleX, SkScalar scaleY, const SkIRect& bounds)
@@ -36,7 +39,8 @@ public:
, fScaleY(scaleY)
, fBounds(bounds)
{
- this->init(sizeof(fGenID) + sizeof(fScaleX) + sizeof(fScaleY) + sizeof(fBounds));
+ this->init(&gBitmapKeyNamespaceLabel,
+ sizeof(fGenID) + sizeof(fScaleX) + sizeof(fScaleY) + sizeof(fBounds));
}
uint32_t fGenID;
@@ -69,6 +73,7 @@ struct BitmapRec : public SkResourceCache::Rec {
return SkToBool(result->getPixels());
}
};
+} // namespace
#define CHECK_LOCAL(localCache, localName, globalName, ...) \
((localCache) ? localCache->localName(__VA_ARGS__) : SkResourceCache::globalName(__VA_ARGS__))
« no previous file with comments | « bench/ImageCacheBench.cpp ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698