diff options
author | robertphillips <robertphillips@google.com> | 2016-08-31 14:04:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-31 14:04:06 -0700 |
commit | 8abb370aca280516f4861c6c942ec453aad018fa (patch) | |
tree | b7e1c12fab48df526ba92763add2aca80806d554 /include/gpu/GrGpuResource.h | |
parent | bde96c6263112de755a2573f6f5f02703386f328 (diff) |
Have GrSurfaceProxys and GrGpuResources draw from the same pool of unique ids
The idea here is that, for wrapped Proxy objects, we want the uniqueID to reflect that of the wrapped object. For this to work the IDs for the non-wrapped versions can't conflict with GrGpuResource's pool of IDs.
Split off of: https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2301523003
Review-Url: https://codereview.chromium.org/2301523003
Diffstat (limited to 'include/gpu/GrGpuResource.h')
-rw-r--r-- | include/gpu/GrGpuResource.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h index fb7cb8c94d..9305c16758 100644 --- a/include/gpu/GrGpuResource.h +++ b/include/gpu/GrGpuResource.h @@ -180,7 +180,7 @@ public: * not change when the content of the GrGpuResource object changes. This will never return * 0. */ - uint32_t getUniqueID() const { return fUniqueID; } + uint32_t uniqueID() const { return fUniqueID; } /** Returns the current unique key for the resource. It will be invalid if the resource has no associated unique key. */ @@ -217,6 +217,8 @@ public: **/ virtual void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const; + static uint32_t CreateUniqueID(); + protected: // This must be called by every non-wrapped GrGpuObject. It should be called once the object is // fully initialized (i.e. only from the constructors of the final class). @@ -279,9 +281,6 @@ private: #ifdef SK_DEBUG friend class GrGpu; // for assert in GrGpu to access getGpu #endif - - static uint32_t CreateUniqueID(); - // An index into a heap when this resource is purgeable or an array when not. This is maintained // by the cache. int fCacheArrayIndex; |