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

Unified Diff: include/private/GrSurfaceProxy.h

Issue 2301523003: Have GrSurfaceProxys and GrGpuResources draw from the same pool of unique ids (Closed)
Patch Set: Add test 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
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; }

Powered by Google App Engine
This is Rietveld 408576698