diff options
author | 2018-03-29 13:40:02 -0400 | |
---|---|---|
committer | 2018-03-29 18:08:15 +0000 | |
commit | cf6da8c0f29877249a55949efd8b952b5b9bc01d (patch) | |
tree | 9f4bcd3033dd85d378da916e7f45ab583524c595 /src/gpu/gl/GrGLTexture.cpp | |
parent | 9c6f6a52764281f6c61c2daf21f4737df5df53c7 (diff) |
Dump additional details about the gpu resources.
GpuResources now dump optional string values that describe the type and
category of the resource. The type provides a description of the kind
of resource it is (e.g. texture, buffer object, stencil, etc.) and the
category describes what the resource is currently tasked to do (e.g.
path masks, images, scratch, etc.)
This CL also refactors the dump logic in an attempt to consolidate
duplicated code into GrGpuResources.cpp.
Bug: b/74435803
Change-Id: I83cae825f41e6450a21398ab3ecea349c7c61c15
Reviewed-on: https://skia-review.googlesource.com/115989
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLTexture.cpp')
-rw-r--r-- | src/gpu/gl/GrGLTexture.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp index 61bce35061..69b214de27 100644 --- a/src/gpu/gl/GrGLTexture.cpp +++ b/src/gpu/gl/GrGLTexture.cpp @@ -138,21 +138,16 @@ void GrGLTexture::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const // Dump as skia/gpu_resources/resource_#/texture, to avoid conflicts in the // GrGLTextureRenderTarget case, where multiple things may dump to the same resource. This // has no downside in the normal case. - SkString dumpName("skia/gpu_resources/resource_"); - dumpName.appendU32(this->uniqueID().asUInt()); - dumpName.append("/texture"); + SkString resourceName = this->getResourceName(); + resourceName.append("/texture"); // As we are only dumping our texture memory (not any additional memory tracked by classes // which may inherit from us), specifically call GrGLTexture::gpuMemorySize to avoid // hitting an override. - size_t size = GrGLTexture::gpuMemorySize(); - traceMemoryDump->dumpNumericValue(dumpName.c_str(), "size", "bytes", size); - - if (this->isPurgeable()) { - traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size", "bytes", size); - } + this->dumpMemoryStatisticsPriv(traceMemoryDump, resourceName, "Texture", + GrGLTexture::gpuMemorySize()); SkString texture_id; texture_id.appendU32(this->textureID()); - traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_texture", texture_id.c_str()); + traceMemoryDump->setMemoryBacking(resourceName.c_str(), "gl_texture", texture_id.c_str()); } |