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

Side by Side Diff: tests/SurfaceTest.cpp

Issue 1694943002: When a surface is backed by an external render target force a copy on image snap (Closed) Base URL: https://skia.googlesource.com/skia.git@imgcopy
Patch Set: test git config branch.nollvm.skip-deps-uploads True Created 4 years, 9 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 | « src/image/SkSurface_Gpu.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 <functional> 8 #include <functional>
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 GrBackendTextureDesc desc; 432 GrBackendTextureDesc desc;
433 desc.fConfig = kRGBA_8888_GrPixelConfig; 433 desc.fConfig = kRGBA_8888_GrPixelConfig;
434 desc.fWidth = 10; 434 desc.fWidth = 10;
435 desc.fHeight = 10; 435 desc.fHeight = 10;
436 desc.fFlags = kRenderTarget_GrBackendTextureFlag; 436 desc.fFlags = kRenderTarget_GrBackendTextureFlag;
437 desc.fTextureHandle = textureObject; 437 desc.fTextureHandle = textureObject;
438 GrTexture* texture = context->textureProvider()->wrapBackendTexture(desc ); 438 GrTexture* texture = context->textureProvider()->wrapBackendTexture(desc );
439 { 439 {
440 SkAutoTUnref<SkSurface> surface( 440 SkAutoTUnref<SkSurface> surface(
441 SkSurface::NewRenderTargetDirect(texture->asRenderTarget())); 441 SkSurface::NewRenderTargetDirect(texture->asRenderTarget()));
442 // We should be able to pass true here, but disallowing copy on writ e for direct GPU 442 test_unique_image_snap(reporter, surface, true, imageBackingStore,
443 // surfaces is not yet implemented.
444 test_unique_image_snap(reporter, surface, false, imageBackingStore,
445 surfaceBackingStore); 443 surfaceBackingStore);
446 } 444 }
447 texture->unref(); 445 texture->unref();
448 context->getGpu()->deleteTestingOnlyBackendTexture(textureObject); 446 context->getGpu()->deleteTestingOnlyBackendTexture(textureObject);
449 } 447 }
450 } 448 }
451 #endif 449 #endif
452 450
453 #if SK_SUPPORT_GPU 451 #if SK_SUPPORT_GPU
454 // May we (soon) eliminate the need to keep testing this, by hiding the bloody d evice! 452 // May we (soon) eliminate the need to keep testing this, by hiding the bloody d evice!
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 desc.fHeight = kHeight; 900 desc.fHeight = kHeight;
903 desc.fFlags = kRenderTarget_GrBackendTextureFlag; 901 desc.fFlags = kRenderTarget_GrBackendTextureFlag;
904 desc.fTextureHandle = textureObject; 902 desc.fTextureHandle = textureObject;
905 903
906 SkSurface* surface = SkSurface::NewFromBackendTexture(context, desc, nul lptr); 904 SkSurface* surface = SkSurface::NewFromBackendTexture(context, desc, nul lptr);
907 test_surface_clear(reporter, surface, grSurfaceGetter, 0xABABABAB); 905 test_surface_clear(reporter, surface, grSurfaceGetter, 0xABABABAB);
908 context->getGpu()->deleteTestingOnlyBackendTexture(textureObject); 906 context->getGpu()->deleteTestingOnlyBackendTexture(textureObject);
909 } 907 }
910 } 908 }
911 #endif 909 #endif
OLDNEW
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698