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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 GrBackendObject textureObject = context->getGpu()->createTestingOnlyBack
endTexture(nullptr, | 330 GrBackendObject textureObject = context->getGpu()->createTestingOnlyBack
endTexture(nullptr, |
331 10, 10, kRGBA_8888_GrPixelConfig, true); | 331 10, 10, kRGBA_8888_GrPixelConfig, true); |
332 GrBackendTextureDesc desc; | 332 GrBackendTextureDesc desc; |
333 desc.fConfig = kRGBA_8888_GrPixelConfig; | 333 desc.fConfig = kRGBA_8888_GrPixelConfig; |
334 desc.fWidth = 10; | 334 desc.fWidth = 10; |
335 desc.fHeight = 10; | 335 desc.fHeight = 10; |
336 desc.fFlags = kRenderTarget_GrBackendTextureFlag; | 336 desc.fFlags = kRenderTarget_GrBackendTextureFlag; |
337 desc.fTextureHandle = textureObject; | 337 desc.fTextureHandle = textureObject; |
338 GrTexture* texture = context->textureProvider()->wrapBackendTexture(desc
); | 338 GrTexture* texture = context->textureProvider()->wrapBackendTexture(desc
); |
339 { | 339 { |
340 auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarg
et())); | 340 auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarg
et(), nullptr)); |
341 test_unique_image_snap(reporter, surface.get(), true, imageBackingSt
ore, | 341 test_unique_image_snap(reporter, surface.get(), true, imageBackingSt
ore, |
342 surfaceBackingStore); | 342 surfaceBackingStore); |
343 } | 343 } |
344 texture->unref(); | 344 texture->unref(); |
345 context->getGpu()->deleteTestingOnlyBackendTexture(textureObject); | 345 context->getGpu()->deleteTestingOnlyBackendTexture(textureObject); |
346 } | 346 } |
347 } | 347 } |
348 #endif | 348 #endif |
349 | 349 |
350 #if SK_SUPPORT_GPU | 350 #if SK_SUPPORT_GPU |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 // our surface functions. | 905 // our surface functions. |
906 GrRenderTarget* rt = surface->getCanvas()->internal_private_accessTo
pLayerDrawContext() | 906 GrRenderTarget* rt = surface->getCanvas()->internal_private_accessTo
pLayerDrawContext() |
907 ->accessRenderTarget(); | 907 ->accessRenderTarget(); |
908 REPORTER_ASSERT(reporter, | 908 REPORTER_ASSERT(reporter, |
909 ctxInfo.grContext()->resourceProvider()->attachStenc
ilAttachment(rt)); | 909 ctxInfo.grContext()->resourceProvider()->attachStenc
ilAttachment(rt)); |
910 gpu->deleteTestingOnlyBackendTexture(textureObject); | 910 gpu->deleteTestingOnlyBackendTexture(textureObject); |
911 } | 911 } |
912 } | 912 } |
913 } | 913 } |
914 #endif | 914 #endif |
OLD | NEW |