OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrGLTextureRenderTarget.h" | 8 #include "GrGLTextureRenderTarget.h" |
9 | 9 |
10 #include "SkTraceMemoryDump.h" | 10 #include "SkTraceMemoryDump.h" |
11 | 11 |
12 // GrGLTextureRenderTarget must dump both of its superclasses. | 12 // GrGLTextureRenderTarget must dump both of its superclasses. |
13 void GrGLTextureRenderTarget::dumpMemoryStatistics( | 13 void GrGLTextureRenderTarget::dumpMemoryStatistics( |
14 SkTraceMemoryDump* traceMemoryDump) const { | 14 SkTraceMemoryDump* traceMemoryDump) const { |
15 GrGLRenderTarget::dumpMemoryStatistics(traceMemoryDump); | 15 GrGLRenderTarget::dumpMemoryStatistics(traceMemoryDump); |
16 | 16 |
17 // Also dump the GrGLTexture's memory. Due to this resource having both a | 17 // Also dump the GrGLTexture's memory. Due to this resource having both a |
18 // texture and a | 18 // texture and a |
19 // renderbuffer component, dump as skia/gpu_resources/resource_#/texture | 19 // renderbuffer component, dump as skia/gpu_resources/resource_#/texture |
20 SkString dumpName("skia/gpu_resources/resource_"); | 20 SkString dumpName("skia/gpu_resources/resource_"); |
21 dumpName.appendS32(this->getUniqueID()); | 21 dumpName.appendS32(this->uniqueID()); |
22 dumpName.append("/texture"); | 22 dumpName.append("/texture"); |
23 | 23 |
24 // Use the texture's gpuMemorySize, not our own, which includes the | 24 // Use the texture's gpuMemorySize, not our own, which includes the |
25 // renderbuffer as well. | 25 // renderbuffer as well. |
26 size_t size = GrGLTexture::gpuMemorySize(); | 26 size_t size = GrGLTexture::gpuMemorySize(); |
27 | 27 |
28 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "size", "bytes", size); | 28 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "size", "bytes", size); |
29 | 29 |
30 if (this->isPurgeable()) { | 30 if (this->isPurgeable()) { |
31 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size", | 31 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size", |
(...skipping 11 matching lines...) Expand all Loading... |
43 // wrapped FBO. | 43 // wrapped FBO. |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
47 GrGLTextureRenderTarget* GrGLTextureRenderTarget::CreateWrapped(GrGLGpu* gpu, | 47 GrGLTextureRenderTarget* GrGLTextureRenderTarget::CreateWrapped(GrGLGpu* gpu, |
48 const GrSurfaceD
esc& desc, | 48 const GrSurfaceD
esc& desc, |
49 const GrGLTextur
e::IDDesc& texIDDesc, | 49 const GrGLTextur
e::IDDesc& texIDDesc, |
50 const GrGLRender
Target::IDDesc& rtIDDesc) { | 50 const GrGLRender
Target::IDDesc& rtIDDesc) { |
51 return new GrGLTextureRenderTarget(gpu, desc, texIDDesc, rtIDDesc); | 51 return new GrGLTextureRenderTarget(gpu, desc, texIDDesc, rtIDDesc); |
52 } | 52 } |
OLD | NEW |