OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrTest.h" | 8 #include "GrTest.h" |
9 | 9 |
10 #include "GrBatchAtlas.h" | 10 #include "GrBatchAtlas.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "text/GrTextBlobCache.h" | 22 #include "text/GrTextBlobCache.h" |
23 | 23 |
24 namespace GrTest { | 24 namespace GrTest { |
25 void SetupAlwaysEvictAtlas(GrContext* context) { | 25 void SetupAlwaysEvictAtlas(GrContext* context) { |
26 // These sizes were selected because they allow each atlas to hold a single
plot and will thus | 26 // These sizes were selected because they allow each atlas to hold a single
plot and will thus |
27 // stress the atlas | 27 // stress the atlas |
28 int dim = GrBatchAtlas::kGlyphMaxDim; | 28 int dim = GrBatchAtlas::kGlyphMaxDim; |
29 GrBatchAtlasConfig configs[3]; | 29 GrBatchAtlasConfig configs[3]; |
30 configs[kA8_GrMaskFormat].fWidth = dim; | 30 configs[kA8_GrMaskFormat].fWidth = dim; |
31 configs[kA8_GrMaskFormat].fHeight = dim; | 31 configs[kA8_GrMaskFormat].fHeight = dim; |
32 configs[kA8_GrMaskFormat].fLog2Width = SkNextLog2(dim); | |
33 configs[kA8_GrMaskFormat].fLog2Height = SkNextLog2(dim); | |
34 configs[kA8_GrMaskFormat].fPlotWidth = dim; | 32 configs[kA8_GrMaskFormat].fPlotWidth = dim; |
35 configs[kA8_GrMaskFormat].fPlotHeight = dim; | 33 configs[kA8_GrMaskFormat].fPlotHeight = dim; |
36 | 34 |
37 configs[kA565_GrMaskFormat].fWidth = dim; | 35 configs[kA565_GrMaskFormat].fWidth = dim; |
38 configs[kA565_GrMaskFormat].fHeight = dim; | 36 configs[kA565_GrMaskFormat].fHeight = dim; |
39 configs[kA565_GrMaskFormat].fLog2Width = SkNextLog2(dim); | |
40 configs[kA565_GrMaskFormat].fLog2Height = SkNextLog2(dim); | |
41 configs[kA565_GrMaskFormat].fPlotWidth = dim; | 37 configs[kA565_GrMaskFormat].fPlotWidth = dim; |
42 configs[kA565_GrMaskFormat].fPlotHeight = dim; | 38 configs[kA565_GrMaskFormat].fPlotHeight = dim; |
43 | 39 |
44 configs[kARGB_GrMaskFormat].fWidth = dim; | 40 configs[kARGB_GrMaskFormat].fWidth = dim; |
45 configs[kARGB_GrMaskFormat].fHeight = dim; | 41 configs[kARGB_GrMaskFormat].fHeight = dim; |
46 configs[kARGB_GrMaskFormat].fLog2Width = SkNextLog2(dim); | |
47 configs[kARGB_GrMaskFormat].fLog2Height = SkNextLog2(dim); | |
48 configs[kARGB_GrMaskFormat].fPlotWidth = dim; | 42 configs[kARGB_GrMaskFormat].fPlotWidth = dim; |
49 configs[kARGB_GrMaskFormat].fPlotHeight = dim; | 43 configs[kARGB_GrMaskFormat].fPlotHeight = dim; |
50 | 44 |
51 context->setTextContextAtlasSizes_ForTesting(configs); | 45 context->setTextContextAtlasSizes_ForTesting(configs); |
52 } | 46 } |
53 }; | 47 }; |
54 | 48 |
55 void GrTestTarget::init(GrContext* ctx, GrDrawTarget* target, GrRenderTarget* rt
) { | 49 void GrTestTarget::init(GrContext* ctx, GrDrawTarget* target, GrRenderTarget* rt
) { |
56 SkASSERT(!fContext); | 50 SkASSERT(!fContext); |
57 | 51 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 SkASSERT(nullptr == fGpu); | 406 SkASSERT(nullptr == fGpu); |
413 fGpu = new MockGpu(this, options); | 407 fGpu = new MockGpu(this, options); |
414 SkASSERT(fGpu); | 408 SkASSERT(fGpu); |
415 this->initCommon(options); | 409 this->initCommon(options); |
416 | 410 |
417 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 411 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
418 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 412 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
419 // resources in the buffer pools. | 413 // resources in the buffer pools. |
420 fDrawingManager->abandon(); | 414 fDrawingManager->abandon(); |
421 } | 415 } |
OLD | NEW |