Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: tools/gpu/GrTest.cpp

Issue 2093943002: Have gpu createTestingOlyBackendTexture know if it is a render target or not (Closed) Base URL: https://skia.googlesource.com/skia.git@moreUnitTests
Patch Set: Have gpu createTestingOlyBackendTexture know if it is a render target or not Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/VkWrapTests.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « tests/VkWrapTests.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698