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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 364 |
365 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget*, | 365 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget*, |
366 int width, | 366 int width, |
367 int height) over
ride { | 367 int height) over
ride { |
368 return nullptr; | 368 return nullptr; |
369 } | 369 } |
370 | 370 |
371 void clearStencil(GrRenderTarget* target) override {} | 371 void clearStencil(GrRenderTarget* target) override {} |
372 | 372 |
373 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, | 373 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, |
374 GrPixelConfig config) overri
de { | 374 GrPixelConfig config, bool i
sRT) override { |
375 return 0; | 375 return 0; |
376 } | 376 } |
377 bool isTestingOnlyBackendTexture(GrBackendObject ) const override { return f
alse; } | 377 bool isTestingOnlyBackendTexture(GrBackendObject ) const override { return f
alse; } |
378 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) o
verride {} | 378 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) o
verride {} |
379 | 379 |
380 typedef GrGpu INHERITED; | 380 typedef GrGpu INHERITED; |
381 }; | 381 }; |
382 | 382 |
383 GrContext* GrContext::CreateMockContext() { | 383 GrContext* GrContext::CreateMockContext() { |
384 GrContext* context = new GrContext; | 384 GrContext* context = new GrContext; |
385 | 385 |
386 context->initMockContext(); | 386 context->initMockContext(); |
387 return context; | 387 return context; |
388 } | 388 } |
389 | 389 |
390 void GrContext::initMockContext() { | 390 void GrContext::initMockContext() { |
391 GrContextOptions options; | 391 GrContextOptions options; |
392 options.fBufferMapThreshold = 0; | 392 options.fBufferMapThreshold = 0; |
393 SkASSERT(nullptr == fGpu); | 393 SkASSERT(nullptr == fGpu); |
394 fGpu = new MockGpu(this, options); | 394 fGpu = new MockGpu(this, options); |
395 SkASSERT(fGpu); | 395 SkASSERT(fGpu); |
396 this->initCommon(options); | 396 this->initCommon(options); |
397 | 397 |
398 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 398 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
399 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 399 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
400 // resources in the buffer pools. | 400 // resources in the buffer pools. |
401 fDrawingManager->abandon(); | 401 fDrawingManager->abandon(); |
402 } | 402 } |
OLD | NEW |