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

Side by Side Diff: src/gpu/GrContext.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 | « include/gpu/GrGpuResource.h ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrContext.h" 9 #include "GrContext.h"
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 fDrawTarget->reset(); 98 fDrawTarget->reset();
99 } 99 }
100 } 100 }
101 101
102 void GrContext::DrawingMgr::flush() { 102 void GrContext::DrawingMgr::flush() {
103 if (fDrawTarget) { 103 if (fDrawTarget) {
104 fDrawTarget->flush(); 104 fDrawTarget->flush();
105 } 105 }
106 } 106 }
107 107
108 GrDrawContext* GrContext::DrawingMgr::drawContext(const SkSurfaceProps* surfaceP rops) { 108 GrDrawContext* GrContext::DrawingMgr::drawContext(const SkSurfaceProps* surfaceP rops) {
109 if (this->abandoned()) { 109 if (this->abandoned()) {
110 return nullptr; 110 return nullptr;
111 } 111 }
112 112
113 const SkSurfaceProps props(SkSurfacePropsCopyOrDefault(surfaceProps)); 113 const SkSurfaceProps props(SkSurfacePropsCopyOrDefault(surfaceProps));
114 114
115 SkASSERT(props.pixelGeometry() < kNumPixelGeometries); 115 SkASSERT(props.pixelGeometry() < kNumPixelGeometries);
116 if (!fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependentFonts() ]) { 116 if (!fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependentFonts() ]) {
117 fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependentFonts()] = 117 fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependentFonts()] =
118 new GrDrawContext(fContext, fDrawTarget, props); 118 new GrDrawContext(fContext, fDrawTarget, props);
119 } 119 }
120 120
121 // For now, everyone gets a faux creation ref 121 // For now, everyone gets a faux creation ref
122 return SkRef(fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependen tFonts()]); 122 return SkRef(fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependen tFonts()]);
123 } 123 }
124 124
125 //////////////////////////////////////////////////////////////////////////////// 125 ////////////////////////////////////////////////////////////////////////////////
126 126
127 127
128 GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext) { 128 GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext) {
129 GrContextOptions defaultOptions; 129 GrContextOptions defaultOptions;
130 return Create(backend, backendContext, defaultOptions); 130 return Create(backend, backendContext, defaultOptions);
131 } 131 }
132 132
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 } 752 }
753 if (maxTextureBytes) { 753 if (maxTextureBytes) {
754 *maxTextureBytes = fResourceCache->getMaxResourceBytes(); 754 *maxTextureBytes = fResourceCache->getMaxResourceBytes();
755 } 755 }
756 } 756 }
757 757
758 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes) { 758 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes) {
759 fResourceCache->setLimits(maxTextures, maxTextureBytes); 759 fResourceCache->setLimits(maxTextures, maxTextureBytes);
760 } 760 }
761 761
762 //////////////////////////////////////////////////////////////////////////////
763
764 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
765 fResourceCache->dumpMemoryStatistics(traceMemoryDump);
766 }
OLDNEW
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698