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

Unified Diff: src/gpu/gl/GrGLRenderTarget.h

Issue 1862043002: Refactor to separate backend object lifecycle and GpuResource budget decision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix unrelated GrBuffer::onGpuMemorySize() lack of override keyword compile error Created 4 years, 8 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 | « src/gpu/gl/GrGLPathRange.cpp ('k') | src/gpu/gl/GrGLRenderTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLRenderTarget.h
diff --git a/src/gpu/gl/GrGLRenderTarget.h b/src/gpu/gl/GrGLRenderTarget.h
index d1365efd420c10af802bd173fd534a4d443871cd..edf35a1a5c7cee1f3f1e85318d11f258a13893e3 100644
--- a/src/gpu/gl/GrGLRenderTarget.h
+++ b/src/gpu/gl/GrGLRenderTarget.h
@@ -24,9 +24,9 @@ public:
struct IDDesc {
GrGLuint fRTFBOID;
+ GrBackendObjectOwnership fRTFBOOwnership;
GrGLuint fTexFBOID;
GrGLuint fMSColorRenderbufferID;
- GrGpuResource::LifeCycle fLifeCycle;
GrRenderTarget::SampleConfig fSampleConfig;
};
@@ -61,21 +61,15 @@ public:
GrBackendObject getRenderTargetHandle() const override { return fRTFBOID; }
- /** When we don't own the FBO ID we don't attempt to modify its attachments. */
- bool canAttemptStencilAttachment() const override {
- return kCached_LifeCycle == fRTLifecycle || kUncached_LifeCycle == fRTLifecycle;
- }
+ bool canAttemptStencilAttachment() const override;
// GrGLRenderTarget overrides dumpMemoryStatistics so it can log its texture and renderbuffer
// components seperately.
void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const override;
protected:
- // The public constructor registers this object with the cache. However, only the most derived
- // class should register with the cache. This constructor does not do the registration and
- // rather moves that burden onto the derived class.
- enum Derived { kDerived };
- GrGLRenderTarget(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&, Derived);
+ // Constructor for subclasses.
+ GrGLRenderTarget(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&);
void init(const GrSurfaceDesc&, const IDDesc&);
@@ -86,8 +80,7 @@ protected:
size_t onGpuMemorySize() const override;
private:
- // This ctor is used only for creating wrapped render targets and is only called for the static
- // create function CreateWrapped(...).
+ // Constructor for instances wrapping backend objects.
GrGLRenderTarget(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&, GrGLStencilAttachment*);
GrGLGpu* getGLGpu() const;
@@ -103,9 +96,7 @@ private:
GrGLuint fTexFBOID;
GrGLuint fMSColorRenderbufferID;
- // We track this separately from GrGpuResource because this may be both a texture and a render
- // target, and the texture may be wrapped while the render target is not.
- LifeCycle fRTLifecycle;
+ GrBackendObjectOwnership fRTFBOOwnership;
// when we switch to this render target we want to set the viewport to
// only render to content area (as opposed to the whole allocation) and
« no previous file with comments | « src/gpu/gl/GrGLPathRange.cpp ('k') | src/gpu/gl/GrGLRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698