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

Unified Diff: include/gpu/GrGpuResource.h

Issue 705413002: Remove GrResourceKey from GrResourceCache (Closed) Base URL: https://skia.googlesource.com/skia.git@content
Patch Set: update Created 6 years, 1 month 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/gpu/GrGpuResource.cpp » ('j') | src/gpu/GrGpuResource.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrGpuResource.h
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h
index d3341d9bea55f78d4c5cdc9470d1ed208059a166..315e491a86ff4f2063c141bf96e5116e2da76840 100644
--- a/include/gpu/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -76,6 +76,8 @@ protected:
bool internalHasPendingWrite() const { return SkToBool(fPendingWrites); }
bool internalHasPendingIO() const { return SkToBool(fPendingWrites | fPendingReads); }
+ bool internalHasRef() const { return SkToBool(fRefCnt); }
+
private:
void addPendingRead() const {
this->validate();
@@ -172,16 +174,18 @@ public:
*/
virtual size_t gpuMemorySize() const = 0;
- bool setCacheEntry(GrResourceCacheEntry* cacheEntry);
+ // TODO(bsalomon): Move this stuff to GrGpuResourcePriv.
+ bool setContentKey(const GrResourceKey& contentKey);
+ void setCacheEntry(GrResourceCacheEntry* cacheEntry);
GrResourceCacheEntry* getCacheEntry() const { return fCacheEntry; }
bool isScratch() const;
-
/**
* If this resource can be used as a scratch resource this returns a valid
* scratch key. Otherwise it returns a key for which isNullScratch is true.
+ * The resource may currently be used as content resource rather than scratch.
+ * Check isScratch().
*/
const GrResourceKey& getScratchKey() const { return fScratchKey; }
-
/**
* If this resource is currently cached by its contents then this will return
* the content key. Otherwise, NULL is returned.
@@ -258,7 +262,11 @@ private:
GrResourceCacheEntry* fCacheEntry; // NULL if not in cache
const uint32_t fUniqueID;
+ // TODO(bsalomon): Remove GrResourceKey and use different simpler types for content and scratch
+ // keys.
GrResourceKey fScratchKey;
+ GrResourceKey fContentKey;
+ bool fContentKeySet;
typedef GrIORef<GrGpuResource> INHERITED;
friend class GrIORef<GrGpuResource>; // to access notifyIsPurgable.
« no previous file with comments | « no previous file | src/gpu/GrGpuResource.cpp » ('j') | src/gpu/GrGpuResource.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698