| 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 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 fContext.reset(SkRef(ctx)); | 47 fContext.reset(SkRef(ctx)); |
| 48 fDrawTarget.reset(SkRef(target)); | 48 fDrawTarget.reset(SkRef(target)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void GrContext::getTestTarget(GrTestTarget* tar) { | 51 void GrContext::getTestTarget(GrTestTarget* tar) { |
| 52 this->flush(); | 52 this->flush(); |
| 53 // We could create a proxy GrDrawTarget that passes through to fGpu until ~G
rTextTarget() and | 53 // We could create a proxy GrDrawTarget that passes through to fGpu until ~G
rTextTarget() and |
| 54 // then disconnects. This would help prevent test writers from mixing using
the returned | 54 // then disconnects. This would help prevent test writers from mixing using
the returned |
| 55 // GrDrawTarget and regular drawing. We could also assert or fail in GrConte
xt drawing methods | 55 // GrDrawTarget and regular drawing. We could also assert or fail in GrConte
xt drawing methods |
| 56 // until ~GrTestTarget(). | 56 // until ~GrTestTarget(). |
| 57 tar->init(this, fDrawingMgr.fDrawTarget); | 57 SkAutoTUnref<GrDrawTarget> dt(fDrawingMgr.newDrawTarget(nullptr)); |
| 58 tar->init(this, dt); |
| 58 } | 59 } |
| 59 | 60 |
| 60 void GrContext::setTextBlobCacheLimit_ForTesting(size_t bytes) { | 61 void GrContext::setTextBlobCacheLimit_ForTesting(size_t bytes) { |
| 61 fTextBlobCache->setBudget(bytes); | 62 fTextBlobCache->setBudget(bytes); |
| 62 } | 63 } |
| 63 | 64 |
| 64 void GrContext::setTextContextAtlasSizes_ForTesting(const GrBatchAtlasConfig* co
nfigs) { | 65 void GrContext::setTextContextAtlasSizes_ForTesting(const GrBatchAtlasConfig* co
nfigs) { |
| 65 fBatchFontCache->setAtlasSizes_ForTesting(configs); | 66 fBatchFontCache->setAtlasSizes_ForTesting(configs); |
| 66 } | 67 } |
| 67 | 68 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 SkASSERT(nullptr == fGpu); | 287 SkASSERT(nullptr == fGpu); |
| 287 fGpu = new MockGpu(this, options); | 288 fGpu = new MockGpu(this, options); |
| 288 SkASSERT(fGpu); | 289 SkASSERT(fGpu); |
| 289 this->initCommon(); | 290 this->initCommon(); |
| 290 | 291 |
| 291 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 292 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
| 292 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 293 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
| 293 // resources in the buffer pools. | 294 // resources in the buffer pools. |
| 294 fDrawingMgr.abandon(); | 295 fDrawingMgr.abandon(); |
| 295 } | 296 } |
| OLD | NEW |