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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // GrDrawTarget and regular drawing. We could also assert or fail in GrConte
xt drawing methods | 67 // GrDrawTarget and regular drawing. We could also assert or fail in GrConte
xt drawing methods |
68 // until ~GrTestTarget(). | 68 // until ~GrTestTarget(). |
69 if (!rt) { | 69 if (!rt) { |
70 GrSurfaceDesc desc; | 70 GrSurfaceDesc desc; |
71 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 71 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
72 desc.fWidth = 32; | 72 desc.fWidth = 32; |
73 desc.fHeight = 32; | 73 desc.fHeight = 32; |
74 desc.fConfig = kRGBA_8888_GrPixelConfig; | 74 desc.fConfig = kRGBA_8888_GrPixelConfig; |
75 desc.fSampleCnt = 0; | 75 desc.fSampleCnt = 0; |
76 | 76 |
77 SkAutoTUnref<GrTexture> texture(this->textureProvider()->createTexture( | 77 SkAutoTUnref<GrTexture> texture(this->textureProvider()->createTexture(d
esc, false, |
78 desc, SkBudgeted::kNo, nullptr, 0)); | 78 n
ullptr, 0)); |
79 if (nullptr == texture) { | 79 if (nullptr == texture) { |
80 return; | 80 return; |
81 } | 81 } |
82 SkASSERT(nullptr != texture->asRenderTarget()); | 82 SkASSERT(nullptr != texture->asRenderTarget()); |
83 rt = texture->asRenderTarget(); | 83 rt = texture->asRenderTarget(); |
84 } | 84 } |
85 | 85 |
86 SkAutoTUnref<GrDrawTarget> dt(fDrawingManager->newDrawTarget(rt)); | 86 SkAutoTUnref<GrDrawTarget> dt(fDrawingManager->newDrawTarget(rt)); |
87 tar->init(this, dt, rt); | 87 tar->init(this, dt, rt); |
88 } | 88 } |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 SkASSERT(nullptr == fGpu); | 417 SkASSERT(nullptr == fGpu); |
418 fGpu = new MockGpu(this, options); | 418 fGpu = new MockGpu(this, options); |
419 SkASSERT(fGpu); | 419 SkASSERT(fGpu); |
420 this->initCommon(options); | 420 this->initCommon(options); |
421 | 421 |
422 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 422 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
423 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 423 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
424 // resources in the buffer pools. | 424 // resources in the buffer pools. |
425 fDrawingManager->abandon(); | 425 fDrawingManager->abandon(); |
426 } | 426 } |
OLD | NEW |