aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkResourceCache.h
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2014-10-22 11:20:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-22 11:20:40 -0700
commit171e5b73a862418f4acd61faf8cecfbc8f58694c (patch)
tree72751a8762d7d354d84feb533522eef2d9951ba5 /src/core/SkResourceCache.h
parent9bb7539a59ab15749fe26fecfec05330cffae684 (diff)
SkResourceCache::Key namespace support.
Add a unique-per-subclass namespace tag to make Keys from different domains comparable. Also drop the SkPictureShader cache and convert to using the global resource cache instead. R=reed@google.com,mtklein@google.com,robertphillips@google.com Review URL: https://codereview.chromium.org/668223002
Diffstat (limited to 'src/core/SkResourceCache.h')
-rw-r--r--src/core/SkResourceCache.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/SkResourceCache.h b/src/core/SkResourceCache.h
index c50b370eaf..c16913fbe7 100644
--- a/src/core/SkResourceCache.h
+++ b/src/core/SkResourceCache.h
@@ -31,8 +31,9 @@ public:
void* writableContents() { return this + 1; }
// must call this after your private data has been written.
+ // nameSpace must be unique per Key subclass.
// length must be a multiple of 4
- void init(size_t length);
+ void init(void* nameSpace, size_t length);
// This is only valid after having called init().
uint32_t hash() const { return fHash; }
@@ -49,8 +50,9 @@ public:
}
private:
- int32_t fCount32; // 2 + user contents count32
+ int32_t fCount32; // local + user contents count32
uint32_t fHash;
+ void* fNamespace; // A unique namespace tag. This is hashed.
/* uint32_t fContents32[] */
const uint32_t* as32() const { return (const uint32_t*)this; }