aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLRenderTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLRenderTarget.cpp')
-rw-r--r--src/gpu/gl/GrGLRenderTarget.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index e1a4eb0bae..9500e7d6fe 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -195,11 +195,21 @@ bool GrGLRenderTarget::canAttemptStencilAttachment() const {
}
void GrGLRenderTarget::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
- // Don't log the backing texture's contribution to the memory size. This will be handled by the
- // texture object.
+ // Don't check this->fRefsWrappedObjects, as we might be the base of a GrGLTextureRenderTarget
+ // which is multiply inherited from both ourselves and a texture. In these cases, one part
+ // (texture, rt) may be wrapped, while the other is owned by Skia.
+ bool refsWrappedRenderTargetObjects =
+ this->fRTFBOOwnership == GrBackendObjectOwnership::kBorrowed;
+ if (refsWrappedRenderTargetObjects && !traceMemoryDump->shouldDumpWrappedObjects()) {
+ return;
+ }
+
+ // Don't log the framebuffer, as the framebuffer itself doesn't contribute to meaningful
+ // memory usage. It is always a wrapper around either:
+ // - a texture, which is owned elsewhere, and will be dumped there
+ // - a renderbuffer, which will be dumped below.
- // Log any renderbuffer's contribution to memory. We only do this if we own the renderbuffer
- // (have a fMSColorRenderbufferID).
+ // Log any renderbuffer's contribution to memory.
if (fMSColorRenderbufferID) {
size_t size = GrSurface::ComputeSize(this->config(), this->width(), this->height(),
this->msaaSamples(), GrMipMapped::kNo);