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

Unified Diff: include/gpu/GrGpuResource.h

Issue 642493003: Revert of Use presence of a content key as non-scratch indicator (Closed) Base URL: https://skia.googlesource.com/skia.git@pp
Patch Set: 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 | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »
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 8800f0afa6439841a4738bad6957e82e91066991..0d523249e9cbd7c933b65d1557ccf02c69140e77 100644
--- a/include/gpu/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -71,7 +71,7 @@
}
protected:
- GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) { }
+ GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0), fIsScratch(kNo_IsScratch) { }
bool internalHasPendingRead() const { return SkToBool(fPendingReads); }
bool internalHasPendingWrite() const { return SkToBool(fPendingWrites); }
@@ -118,7 +118,16 @@
// This class is used to manage conversion of refs to pending reads/writes.
friend class GrGpuResourceRef;
- friend class GrResourceCache2; // to check IO ref counts.
+
+ // This is temporary until GrResourceCache is fully replaced by GrResourceCache2.
+ enum IsScratch {
+ kNo_IsScratch,
+ kYes_IsScratch
+ } fIsScratch;
+
+ friend class GrContext; // to set the above field.
+ friend class GrResourceCache; // to check the above field.
+ friend class GrResourceCache2; // to check the above field.
template <typename, GrIOType> friend class GrPendingIOResource;
};
@@ -181,12 +190,6 @@
*/
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.
- */
- const GrResourceKey* getContentKey() const;
-
/**
* Gets an id that is unique for this GrGpuResource object. It is static in that it does
* not change when the content of the GrGpuResource object changes. This will never return
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698