Chromium Code Reviews| Index: include/private/GrSurfaceProxy.h |
| diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h |
| index 01c52675a4a037c3c2d4ececfef673c7aa602111..6b754a8dae76cfd846dd21254678e9293c6eb57c 100644 |
| --- a/include/private/GrSurfaceProxy.h |
| +++ b/include/private/GrSurfaceProxy.h |
| @@ -26,7 +26,7 @@ public: |
| int height() const { return fDesc.fWidth; } |
| GrPixelConfig config() const { return fDesc.fConfig; } |
| - uint32_t uniqueID() const { return fUniqueID; } |
| + uint32_t getUniqueID() const { return fUniqueID; } |
|
bsalomon
2016/08/31 17:53:18
Can we go the other way :)
robertphillips
2016/08/31 19:11:38
Done.
|
| /** |
| * @return the texture proxy associated with the surface proxy, may be NULL. |
| @@ -41,11 +41,21 @@ public: |
| virtual const GrRenderTargetProxy* asRenderTargetProxy() const { return nullptr; } |
| protected: |
| + // Deferred version |
| GrSurfaceProxy(const GrSurfaceDesc& desc, SkBackingFit fit, SkBudgeted budgeted) |
| : fDesc(desc) |
| , fFit(fit) |
| , fBudgeted(budgeted) |
| - , fUniqueID(CreateUniqueID()) { |
| + , fUniqueID(GrGpuResource::CreateUniqueID()) { |
| + } |
| + |
| + // Wrapped version |
| + GrSurfaceProxy(const GrSurfaceDesc& desc, SkBackingFit fit, |
| + SkBudgeted budgeted, uint32_t uniqueID) |
| + : fDesc(desc) |
| + , fFit(fit) |
| + , fBudgeted(budgeted) |
| + , fUniqueID(uniqueID) { |
| } |
| virtual ~GrSurfaceProxy() {} |
| @@ -54,10 +64,9 @@ protected: |
| const GrSurfaceDesc fDesc; |
| const SkBackingFit fFit; // always exact for wrapped resources |
| const SkBudgeted fBudgeted; // set from the backing resource for wrapped resources |
| - const uint32_t fUniqueID; |
| + const uint32_t fUniqueID; // set from the backing resource for wrapped resources |
| private: |
| - static uint32_t CreateUniqueID(); |
| // See comment in GrGpuResource.h. |
| void notifyAllCntsAreZero(CntType) const { delete this; } |