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