From 8caf85f9f40f6bad38bf66bd02b87dcebe139a5c Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Thu, 5 Apr 2018 09:30:38 -0400 Subject: Add GrBackendTexture/RenderTarget accessors to SkSurface Change-Id: I63477fd4b8d48dc50af72736f0f8df566cd96d4a Reviewed-on: https://skia-review.googlesource.com/85220 Reviewed-by: Brian Salomon Reviewed-by: Cary Clark Reviewed-by: Greg Daniel Commit-Queue: Robert Phillips --- tests/SpecialImageTest.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests/SpecialImageTest.cpp') diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp index 8397795261..a9cd1c7b56 100644 --- a/tests/SpecialImageTest.cpp +++ b/tests/SpecialImageTest.cpp @@ -16,6 +16,7 @@ #include "Test.h" #if SK_SUPPORT_GPU +#include "GrBackendSurface.h" #include "GrContext.h" #include "GrContextPriv.h" #include "GrProxyProvider.h" @@ -126,17 +127,20 @@ static void test_image(const sk_sp& img, skiatest::Reporter* rep SkPixmap tmpPixmap; REPORTER_ASSERT(reporter, isGPUBacked != !!tightImg->peekPixels(&tmpPixmap)); } +#if SK_SUPPORT_GPU { SkImageFilter::OutputProperties outProps(img->getColorSpace()); sk_sp tightSurf(img->makeTightSurface(outProps, subset.size())); REPORTER_ASSERT(reporter, tightSurf->width() == subset.width()); REPORTER_ASSERT(reporter, tightSurf->height() == subset.height()); - REPORTER_ASSERT(reporter, isGPUBacked == - !!tightSurf->getTextureHandle(SkSurface::kDiscardWrite_BackendHandleAccess)); + GrBackendTexture backendTex = tightSurf->getBackendTexture( + SkSurface::kDiscardWrite_BackendHandleAccess); + REPORTER_ASSERT(reporter, isGPUBacked == backendTex.isValid()); SkPixmap tmpPixmap; REPORTER_ASSERT(reporter, isGPUBacked != !!tightSurf->peekPixels(&tmpPixmap)); } +#endif } DEF_TEST(SpecialImage_Raster, reporter) { -- cgit v1.2.3