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

Side by Side Diff: src/gpu/gl/GrGLTextureRenderTarget.cpp

Issue 1313743002: Add onMemoryDump to GrContext (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Small build fix Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLTextureRenderTarget.h ('k') | src/gpu/gl/GrGLVertexBuffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "GrGLTextureRenderTarget.h"
9
10 #include "SkTraceMemoryDump.h"
11
12 // GrGLTextureRenderTarget must dump both of its superclasses.
13 void GrGLTextureRenderTarget::dumpMemoryStatistics(
14 SkTraceMemoryDump* traceMemoryDump) const {
15 GrGLRenderTarget::dumpMemoryStatistics(traceMemoryDump);
16
17 // Also dump the GrGLTexture's memory. Due to this resource having both a
18 // texture and a
19 // renderbuffer component, dump as skia/gpu_resources/resource_#/texture
20 SkString dumpName("skia/gpu_resources/resource_");
21 dumpName.appendS32(this->getUniqueID());
22 dumpName.append("/texture");
23
24 // Use the texture's gpuMemorySize, not our own, which includes the
25 // renderbuffer as well.
26 size_t size = GrGLTexture::gpuMemorySize();
27
28 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "size", "bytes", size);
29
30 if (this->isPurgeable()) {
31 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size",
32 "bytes", size);
33 }
34
35 SkString texture_id;
36 texture_id.appendU32(this->textureID());
37 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_texture",
38 texture_id.c_str());
39 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLTextureRenderTarget.h ('k') | src/gpu/gl/GrGLVertexBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698