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

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

Issue 1810323002: Cache render targets that render to wrapped textures Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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: src/gpu/gl/GrGLTextureRenderTarget.h
diff --git a/src/gpu/gl/GrGLTextureRenderTarget.h b/src/gpu/gl/GrGLTextureRenderTarget.h
index 02db8bc08634994fec3842dbd449cb9f75e64f8e..1d7507f3d0a82695e22a2396d34d6e1834ea4b3f 100644
--- a/src/gpu/gl/GrGLTextureRenderTarget.h
+++ b/src/gpu/gl/GrGLTextureRenderTarget.h
@@ -26,12 +26,13 @@ public:
// We're virtually derived from GrSurface (via both GrGLTexture and GrGLRenderTarget) so its
// constructor must be explicitly called.
GrGLTextureRenderTarget(GrGLGpu* gpu,
+ SkBudgeted budgeted,
const GrSurfaceDesc& desc,
const GrGLTexture::IDDesc& texIDDesc,
const GrGLRenderTarget::IDDesc& rtIDDesc)
- : GrSurface(gpu, texIDDesc.fLifeCycle, desc)
- , GrGLTexture(gpu, desc, texIDDesc, GrGLTexture::kDerived)
- , GrGLRenderTarget(gpu, desc, rtIDDesc, GrGLRenderTarget::kDerived) {
+ : GrSurface(gpu, budgeted, desc)
+ , GrGLTexture(gpu, budgeted, desc, texIDDesc, GrGLTexture::kDerived)
+ , GrGLRenderTarget(gpu, budgeted, desc, rtIDDesc, GrGLRenderTarget::kDerived) {
this->registerWithCache();
}
@@ -47,11 +48,12 @@ protected:
GrGLRenderTarget::onRelease();
GrGLTexture::onRelease();
}
+ bool refsWrappedResources() const override;
private:
- // GrGLRenderTarget accounts for the texture's memory and any MSAA renderbuffer's memory.
size_t onGpuMemorySize() const override {
- return GrGLRenderTarget::onGpuMemorySize();
+ return GrGLTexture::onGpuMemorySize() +
+ GrGLRenderTarget::onGpuMemorySize();
}
};

Powered by Google App Engine
This is Rietveld 408576698