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

Side by Side Diff: src/gpu/GrTest.cpp

Issue 1264283002: Add abliity to set textblob cache budget to GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move to GrTest Created 5 years, 4 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 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 "GrTest.h" 9 #include "GrTest.h"
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 void GrContext::getTestTarget(GrTestTarget* tar) { 24 void GrContext::getTestTarget(GrTestTarget* tar) {
25 this->flush(); 25 this->flush();
26 // We could create a proxy GrDrawTarget that passes through to fGpu until ~G rTextTarget() and 26 // We could create a proxy GrDrawTarget that passes through to fGpu until ~G rTextTarget() and
27 // then disconnects. This would help prevent test writers from mixing using the returned 27 // then disconnects. This would help prevent test writers from mixing using the returned
28 // GrDrawTarget and regular drawing. We could also assert or fail in GrConte xt drawing methods 28 // GrDrawTarget and regular drawing. We could also assert or fail in GrConte xt drawing methods
29 // until ~GrTestTarget(). 29 // until ~GrTestTarget().
30 tar->init(this, fDrawingMgr.fDrawTarget); 30 tar->init(this, fDrawingMgr.fDrawTarget);
31 } 31 }
32 32
33 void GrContext::setTextBlobCacheLimit_ForTesting(size_t bytes) {
34 fTextBlobCache->setBudget(bytes);
35 }
36
33 /////////////////////////////////////////////////////////////////////////////// 37 ///////////////////////////////////////////////////////////////////////////////
34 38
35 void GrContext::purgeAllUnlockedResources() { 39 void GrContext::purgeAllUnlockedResources() {
36 fResourceCache->purgeAllUnlocked(); 40 fResourceCache->purgeAllUnlocked();
37 } 41 }
38 42
39 void GrContext::dumpCacheStats(SkString* out) const { 43 void GrContext::dumpCacheStats(SkString* out) const {
40 #if GR_CACHE_STATS 44 #if GR_CACHE_STATS
41 fResourceCache->dumpStats(out); 45 fResourceCache->dumpStats(out);
42 #endif 46 #endif
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 SkASSERT(NULL == fGpu); 262 SkASSERT(NULL == fGpu);
259 fGpu = SkNEW_ARGS(MockGpu, (this, options)); 263 fGpu = SkNEW_ARGS(MockGpu, (this, options));
260 SkASSERT(fGpu); 264 SkASSERT(fGpu);
261 this->initCommon(); 265 this->initCommon();
262 266
263 // We delete these because we want to test the cache starting with zero reso urces. Also, none of 267 // We delete these because we want to test the cache starting with zero reso urces. Also, none of
264 // these objects are required for any of tests that use this context. TODO: make stop allocating 268 // these objects are required for any of tests that use this context. TODO: make stop allocating
265 // resources in the buffer pools. 269 // resources in the buffer pools.
266 fDrawingMgr.abandon(); 270 fDrawingMgr.abandon();
267 } 271 }
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrTextBlobCache.h » ('j') | src/gpu/GrTextBlobCache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698