| OLD | NEW |
| 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 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 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 /////////////////////////////////////////////////////////////////////////////// | 33 /////////////////////////////////////////////////////////////////////////////// |
| 34 | 34 |
| 35 void GrContext::setMaxTextureSizeOverride(int maxTextureSizeOverride) { | |
| 36 fMaxTextureSizeOverride = maxTextureSizeOverride; | |
| 37 } | |
| 38 | |
| 39 void GrContext::purgeAllUnlockedResources() { | 35 void GrContext::purgeAllUnlockedResources() { |
| 40 fResourceCache->purgeAllUnlocked(); | 36 fResourceCache->purgeAllUnlocked(); |
| 41 } | 37 } |
| 42 | 38 |
| 43 void GrContext::dumpCacheStats(SkString* out) const { | 39 void GrContext::dumpCacheStats(SkString* out) const { |
| 44 #if GR_CACHE_STATS | 40 #if GR_CACHE_STATS |
| 45 fResourceCache->dumpStats(out); | 41 fResourceCache->dumpStats(out); |
| 46 #endif | 42 #endif |
| 47 } | 43 } |
| 48 | 44 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 SkASSERT(NULL == fGpu); | 259 SkASSERT(NULL == fGpu); |
| 264 fGpu = SkNEW_ARGS(MockGpu, (this, options)); | 260 fGpu = SkNEW_ARGS(MockGpu, (this, options)); |
| 265 SkASSERT(fGpu); | 261 SkASSERT(fGpu); |
| 266 this->initCommon(); | 262 this->initCommon(); |
| 267 | 263 |
| 268 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 264 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
| 269 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 265 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
| 270 // resources in the buffer pools. | 266 // resources in the buffer pools. |
| 271 fDrawingMgr.abandon(); | 267 fDrawingMgr.abandon(); |
| 272 } | 268 } |
| OLD | NEW |