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