diff options
author | 2014-10-08 11:21:33 -0700 | |
---|---|---|
committer | 2014-10-08 11:21:33 -0700 | |
commit | 0f9e8a720c583956ed6e291d018f40fa624bb40d (patch) | |
tree | 873cd17784e2f6859258ddc146df4a8362479fae /include | |
parent | ddb5eca198736a320b8318eb5f6dfd6d0b6ad1d3 (diff) |
Revert of Use presence of a content key as non-scratch indicator (patchset #5 id:80001 of https://codereview.chromium.org/639873002/)
Reason for revert:
breaking nanobench on ubuntu
Original issue's description:
> Use presence of a content key as non-scratch indicator
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/9eefe0851eeaa8ded05b4774ebcb38ed201d5dbf
TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2889
Review URL: https://codereview.chromium.org/642493003
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrGpuResource.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h index b01f0e9c34..afd9275d47 100644 --- a/include/gpu/GrGpuResource.h +++ b/include/gpu/GrGpuResource.h @@ -71,7 +71,7 @@ public: } 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 @@ private: // 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 @@ public: */ 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 |