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

Unified Diff: include/private/GrSurfaceProxy.h

Issue 2301523003: Have GrSurfaceProxys and GrGpuResources draw from the same pool of unique ids (Closed)
Patch Set: update to ToT Created 4 years, 4 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 | « include/gpu/GrGpuResource.h ('k') | include/private/GrTextureProxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/GrSurfaceProxy.h
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 01c52675a4a037c3c2d4ececfef673c7aa602111..ad2ea919735bd64edd69b458ed167524da8b406e 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -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; }
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | include/private/GrTextureProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698