| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 GrBackendObject textureObject = context->getGpu()->createTestingOnlyBack
endTexture(nullptr, | 362 GrBackendObject textureObject = context->getGpu()->createTestingOnlyBack
endTexture(nullptr, |
| 363 10, 10, kRGBA_8888_GrPixelConfig, true); | 363 10, 10, kRGBA_8888_GrPixelConfig, true); |
| 364 GrBackendTextureDesc desc; | 364 GrBackendTextureDesc desc; |
| 365 desc.fConfig = kRGBA_8888_GrPixelConfig; | 365 desc.fConfig = kRGBA_8888_GrPixelConfig; |
| 366 desc.fWidth = 10; | 366 desc.fWidth = 10; |
| 367 desc.fHeight = 10; | 367 desc.fHeight = 10; |
| 368 desc.fFlags = kRenderTarget_GrBackendTextureFlag; | 368 desc.fFlags = kRenderTarget_GrBackendTextureFlag; |
| 369 desc.fTextureHandle = textureObject; | 369 desc.fTextureHandle = textureObject; |
| 370 GrTexture* texture = context->textureProvider()->wrapBackendTexture(desc
); | 370 GrTexture* texture = context->textureProvider()->wrapBackendTexture(desc
); |
| 371 { | 371 { |
| 372 auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarg
et())); | 372 auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarg
et(), nullptr)); |
| 373 test_unique_image_snap(reporter, surface.get(), true, imageBackingSt
ore, | 373 test_unique_image_snap(reporter, surface.get(), true, imageBackingSt
ore, |
| 374 surfaceBackingStore); | 374 surfaceBackingStore); |
| 375 } | 375 } |
| 376 texture->unref(); | 376 texture->unref(); |
| 377 context->getGpu()->deleteTestingOnlyBackendTexture(textureObject); | 377 context->getGpu()->deleteTestingOnlyBackendTexture(textureObject); |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 #endif | 380 #endif |
| 381 | 381 |
| 382 #if SK_SUPPORT_GPU | 382 #if SK_SUPPORT_GPU |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 // our surface functions. | 966 // our surface functions. |
| 967 GrRenderTarget* rt = surface->getCanvas()->internal_private_accessTo
pLayerDrawContext() | 967 GrRenderTarget* rt = surface->getCanvas()->internal_private_accessTo
pLayerDrawContext() |
| 968 ->accessRenderTarget(); | 968 ->accessRenderTarget(); |
| 969 REPORTER_ASSERT(reporter, | 969 REPORTER_ASSERT(reporter, |
| 970 ctxInfo.grContext()->resourceProvider()->attachStenc
ilAttachment(rt)); | 970 ctxInfo.grContext()->resourceProvider()->attachStenc
ilAttachment(rt)); |
| 971 gpu->deleteTestingOnlyBackendTexture(textureObject); | 971 gpu->deleteTestingOnlyBackendTexture(textureObject); |
| 972 } | 972 } |
| 973 } | 973 } |
| 974 } | 974 } |
| 975 #endif | 975 #endif |
| OLD | NEW |