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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 377 |
378 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget*, | 378 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget*, |
379 int width, | 379 int width, |
380 int height) over
ride { | 380 int height) over
ride { |
381 return nullptr; | 381 return nullptr; |
382 } | 382 } |
383 | 383 |
384 void clearStencil(GrRenderTarget* target) override {} | 384 void clearStencil(GrRenderTarget* target) override {} |
385 | 385 |
386 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, | 386 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, |
387 GrPixelConfig config) const
override { | 387 GrPixelConfig config) overri
de { |
388 return 0; | 388 return 0; |
389 } | 389 } |
390 bool isTestingOnlyBackendTexture(GrBackendObject ) const override { return f
alse; } | 390 bool isTestingOnlyBackendTexture(GrBackendObject ) const override { return f
alse; } |
391 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c
onst override {} | 391 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) o
verride {} |
392 | 392 |
393 typedef GrGpu INHERITED; | 393 typedef GrGpu INHERITED; |
394 }; | 394 }; |
395 | 395 |
396 GrContext* GrContext::CreateMockContext() { | 396 GrContext* GrContext::CreateMockContext() { |
397 GrContext* context = new GrContext; | 397 GrContext* context = new GrContext; |
398 | 398 |
399 context->initMockContext(); | 399 context->initMockContext(); |
400 return context; | 400 return context; |
401 } | 401 } |
402 | 402 |
403 void GrContext::initMockContext() { | 403 void GrContext::initMockContext() { |
404 GrContextOptions options; | 404 GrContextOptions options; |
405 options.fGeometryBufferMapThreshold = 0; | 405 options.fGeometryBufferMapThreshold = 0; |
406 SkASSERT(nullptr == fGpu); | 406 SkASSERT(nullptr == fGpu); |
407 fGpu = new MockGpu(this, options); | 407 fGpu = new MockGpu(this, options); |
408 SkASSERT(fGpu); | 408 SkASSERT(fGpu); |
409 this->initCommon(options); | 409 this->initCommon(options); |
410 | 410 |
411 // 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 |
412 // 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 |
413 // resources in the buffer pools. | 413 // resources in the buffer pools. |
414 fDrawingManager->abandon(); | 414 fDrawingManager->abandon(); |
415 } | 415 } |
OLD | NEW |