| 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, | 337 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, |
| 338 GrWrapOwnership) override { | 338 GrWrapOwnership) override { |
| 339 return nullptr; | 339 return nullptr; |
| 340 } | 340 } |
| 341 | 341 |
| 342 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&, | 342 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&, |
| 343 GrWrapOwnership) override
{ | 343 GrWrapOwnership) override
{ |
| 344 return nullptr; | 344 return nullptr; |
| 345 } | 345 } |
| 346 | 346 |
| 347 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override { r
eturn nullptr; } | 347 GrBuffer* onCreateBuffer(GrBufferType, size_t, GrAccessPattern) override { r
eturn nullptr; } |
| 348 | |
| 349 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override { ret
urn nullptr; } | |
| 350 | |
| 351 GrTransferBuffer* onCreateTransferBuffer(size_t, TransferType) override { re
turn nullptr; } | |
| 352 | 348 |
| 353 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override {
} | 349 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override {
} |
| 354 | 350 |
| 355 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli
p) override {} | 351 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli
p) override {} |
| 356 | 352 |
| 357 void onDraw(const GrPipeline&, | 353 void onDraw(const GrPipeline&, |
| 358 const GrPrimitiveProcessor&, | 354 const GrPrimitiveProcessor&, |
| 359 const GrMesh*, | 355 const GrMesh*, |
| 360 int meshCount) override {} | 356 int meshCount) override {} |
| 361 | 357 |
| 362 bool onReadPixels(GrSurface* surface, | 358 bool onReadPixels(GrSurface* surface, |
| 363 int left, int top, int width, int height, | 359 int left, int top, int width, int height, |
| 364 GrPixelConfig, | 360 GrPixelConfig, |
| 365 void* buffer, | 361 void* buffer, |
| 366 size_t rowBytes) override { | 362 size_t rowBytes) override { |
| 367 return false; | 363 return false; |
| 368 } | 364 } |
| 369 | 365 |
| 370 bool onWritePixels(GrSurface* surface, | 366 bool onWritePixels(GrSurface* surface, |
| 371 int left, int top, int width, int height, | 367 int left, int top, int width, int height, |
| 372 GrPixelConfig config, const SkTArray<GrMipLevel>& texels)
override { | 368 GrPixelConfig config, const SkTArray<GrMipLevel>& texels)
override { |
| 373 return false; | 369 return false; |
| 374 } | 370 } |
| 375 | 371 |
| 376 bool onTransferPixels(GrSurface* surface, | 372 bool onTransferPixels(GrSurface* surface, |
| 377 int left, int top, int width, int height, | 373 int left, int top, int width, int height, |
| 378 GrPixelConfig config, GrTransferBuffer* buffer, | 374 GrPixelConfig config, GrBuffer* transferBuffer, |
| 379 size_t offset, size_t rowBytes) override { | 375 size_t offset, size_t rowBytes) override { |
| 380 return false; | 376 return false; |
| 381 } | 377 } |
| 382 | 378 |
| 383 void onResolveRenderTarget(GrRenderTarget* target) override { return; } | 379 void onResolveRenderTarget(GrRenderTarget* target) override { return; } |
| 384 | 380 |
| 385 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget*, | 381 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget*, |
| 386 int width, | 382 int width, |
| 387 int height) over
ride { | 383 int height) over
ride { |
| 388 return nullptr; | 384 return nullptr; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 402 | 398 |
| 403 GrContext* GrContext::CreateMockContext() { | 399 GrContext* GrContext::CreateMockContext() { |
| 404 GrContext* context = new GrContext; | 400 GrContext* context = new GrContext; |
| 405 | 401 |
| 406 context->initMockContext(); | 402 context->initMockContext(); |
| 407 return context; | 403 return context; |
| 408 } | 404 } |
| 409 | 405 |
| 410 void GrContext::initMockContext() { | 406 void GrContext::initMockContext() { |
| 411 GrContextOptions options; | 407 GrContextOptions options; |
| 412 options.fGeometryBufferMapThreshold = 0; | 408 options.fBufferMapThreshold = 0; |
| 413 SkASSERT(nullptr == fGpu); | 409 SkASSERT(nullptr == fGpu); |
| 414 fGpu = new MockGpu(this, options); | 410 fGpu = new MockGpu(this, options); |
| 415 SkASSERT(fGpu); | 411 SkASSERT(fGpu); |
| 416 this->initCommon(options); | 412 this->initCommon(options); |
| 417 | 413 |
| 418 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 414 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
| 419 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 415 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
| 420 // resources in the buffer pools. | 416 // resources in the buffer pools. |
| 421 fDrawingManager->abandon(); | 417 fDrawingManager->abandon(); |
| 422 } | 418 } |
| OLD | NEW |