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 <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 Loading... |
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 Loading... |
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 |
OLD | NEW |