From 0a5fa484fd58d27088f8696bdc11c8cc8f2b4866 Mon Sep 17 00:00:00 2001 From: ericrk Date: Tue, 15 Sep 2015 14:16:10 -0700 Subject: Add onMemoryDump to GrContext Adds an entry point to GrContext to allow enumeration and tracing of GPU resources via the newly added SkTraceMemoryDump. Plan is for Chrome to call this on each of its GrContexts. Dumps both the total size of GPU resources, as well as the total purgeable size. BUG=526261 Review URL: https://codereview.chromium.org/1313743002 --- src/gpu/gl/GrGLStencilAttachment.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gpu/gl/GrGLStencilAttachment.cpp') diff --git a/src/gpu/gl/GrGLStencilAttachment.cpp b/src/gpu/gl/GrGLStencilAttachment.cpp index d72729dc10..15e531be84 100644 --- a/src/gpu/gl/GrGLStencilAttachment.cpp +++ b/src/gpu/gl/GrGLStencilAttachment.cpp @@ -8,6 +8,7 @@ #include "GrGLStencilAttachment.h" #include "GrGLGpu.h" +#include "SkTraceMemoryDump.h" size_t GrGLStencilAttachment::onGpuMemorySize() const { uint64_t size = this->width(); @@ -33,3 +34,11 @@ void GrGLStencilAttachment::onAbandon() { INHERITED::onAbandon(); } + +void GrGLStencilAttachment::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, + const SkString& dumpName) const { + SkString renderbuffer_id; + renderbuffer_id.appendU32(this->renderbufferID()); + traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_renderbuffer", + renderbuffer_id.c_str()); +} -- cgit v1.2.3