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

Unified Diff: src/core/SkResourceCache.h

Issue 1683883002: Add request cache to SkFontHost_fontconfig. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make method 'const'. Created 4 years, 10 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 | « no previous file | src/core/SkResourceCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkResourceCache.h
diff --git a/src/core/SkResourceCache.h b/src/core/SkResourceCache.h
index a748133c964d74a2b8e3422c6e3c5563da9ddd3b..548f17fe87a496ca168c29bd4145131cd99ae87f 100644
--- a/src/core/SkResourceCache.h
+++ b/src/core/SkResourceCache.h
@@ -29,14 +29,18 @@ class SkTraceMemoryDump;
class SkResourceCache {
public:
struct Key {
- // Call this to access your private contents. Must not use the address after calling init()
- void* writableContents() { return this + 1; }
-
- // must call this after your private data has been written.
- // nameSpace must be unique per Key subclass.
- // sharedID == 0 means ignore this field : does not support group purging.
- // length must be a multiple of 4
- void init(void* nameSpace, uint64_t sharedID, size_t length);
+ /** Key subclasses must call this after their own fields and data are initialized.
+ * All fields and data must be tightly packed.
+ * @param nameSpace must be unique per Key subclass.
+ * @param sharedID == 0 means ignore this field, does not support group purging.
+ * @param dataSize is size of fields and data of the subclass, must be a multiple of 4.
+ */
+ void init(void* nameSpace, uint64_t sharedID, size_t dataSize);
+
+ /** Returns the size of this key. */
+ size_t size() const {
+ return fCount32 << 2;
+ }
void* getNamespace() const { return fNamespace; }
uint64_t getSharedID() const { return ((uint64_t)fSharedID_hi << 32) | fSharedID_lo; }
« no previous file with comments | « no previous file | src/core/SkResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698