From 8abb370aca280516f4861c6c942ec453aad018fa Mon Sep 17 00:00:00 2001 From: robertphillips Date: Wed, 31 Aug 2016 14:04:06 -0700 Subject: 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 --- include/gpu/GrGpuResource.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/gpu/GrGpuResource.h') 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; -- cgit v1.2.3