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

Unified Diff: include/gpu/GrGpuResource.h

Issue 579403003: Move IOType to GrGpuRef and rename that to GrIORef. Template GrPendingIORef on IOType. (Closed) Base URL: https://skia.googlesource.com/skia.git@ref
Patch Set: rebase again Created 6 years, 3 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 | include/gpu/GrGpuResourceRef.h » ('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 32f4b9396a91b486417be4592adf69f93e57e510..f20bad3e9f57580ba416711a337bac071aada82c 100644
--- a/include/gpu/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -33,11 +33,17 @@ class GrContext;
*
* The latter two ref types are private and intended only for Gr core code.
*/
-class GrGpuRef : public SkNoncopyable {
+class GrIORef : public SkNoncopyable {
public:
- SK_DECLARE_INST_COUNT_ROOT(GrGpuRef)
+ SK_DECLARE_INST_COUNT_ROOT(GrIORef)
- virtual ~GrGpuRef();
+ enum IOType {
+ kRead_IOType,
+ kWrite_IOType,
+ kRW_IOType
+ };
+
+ virtual ~GrIORef();
// Some of the signatures are written to mirror SkRefCnt so that GrGpuResource can work with
// templated helper classes (e.g. SkAutoTUnref). However, we have different categories of
@@ -75,7 +81,7 @@ public:
}
protected:
- GrGpuRef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) {}
+ GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) {}
private:
void addPendingRead() const {
@@ -111,13 +117,13 @@ private:
// This class is used to manage conversion of refs to pending reads/writes.
friend class GrGpuResourceRef;
- template <typename T> friend class GrPendingIOResource;
+ template <typename, IOType> friend class GrPendingIOResource;
};
/**
* Base class for objects that can be kept in the GrResourceCache.
*/
-class GrGpuResource : public GrGpuRef {
+class GrGpuResource : public GrIORef {
public:
SK_DECLARE_INST_COUNT(GrGpuResource)
@@ -242,7 +248,7 @@ private:
GrResourceKey fScratchKey;
- typedef GrGpuRef INHERITED;
+ typedef GrIORef INHERITED;
};
#endif
« no previous file with comments | « no previous file | include/gpu/GrGpuResourceRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698