| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 int height) over
ride { | 274 int height) over
ride { |
| 275 return nullptr; | 275 return nullptr; |
| 276 } | 276 } |
| 277 | 277 |
| 278 void clearStencil(GrRenderTarget* target) override {} | 278 void clearStencil(GrRenderTarget* target) override {} |
| 279 | 279 |
| 280 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, | 280 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, |
| 281 GrPixelConfig config) const
override { | 281 GrPixelConfig config) const
override { |
| 282 return 0; | 282 return 0; |
| 283 } | 283 } |
| 284 bool isTestingOnlyBackendTexture(GrBackendObject id) const override { return
false; } | 284 bool isTestingOnlyBackendTexture(GrBackendObject ) const override { return f
alse; } |
| 285 void deleteTestingOnlyBackendTexture(GrBackendObject id) const override {} | 285 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c
onst override {} |
| 286 | 286 |
| 287 typedef GrGpu INHERITED; | 287 typedef GrGpu INHERITED; |
| 288 }; | 288 }; |
| 289 | 289 |
| 290 GrContext* GrContext::CreateMockContext() { | 290 GrContext* GrContext::CreateMockContext() { |
| 291 GrContext* context = new GrContext; | 291 GrContext* context = new GrContext; |
| 292 | 292 |
| 293 context->initMockContext(); | 293 context->initMockContext(); |
| 294 return context; | 294 return context; |
| 295 } | 295 } |
| 296 | 296 |
| 297 void GrContext::initMockContext() { | 297 void GrContext::initMockContext() { |
| 298 GrContextOptions options; | 298 GrContextOptions options; |
| 299 options.fGeometryBufferMapThreshold = 0; | 299 options.fGeometryBufferMapThreshold = 0; |
| 300 SkASSERT(nullptr == fGpu); | 300 SkASSERT(nullptr == fGpu); |
| 301 fGpu = new MockGpu(this, options); | 301 fGpu = new MockGpu(this, options); |
| 302 SkASSERT(fGpu); | 302 SkASSERT(fGpu); |
| 303 this->initCommon(options); | 303 this->initCommon(options); |
| 304 | 304 |
| 305 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 305 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
| 306 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 306 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
| 307 // resources in the buffer pools. | 307 // resources in the buffer pools. |
| 308 fDrawingManager->abandon(); | 308 fDrawingManager->abandon(); |
| 309 } | 309 } |
| OLD | NEW |