aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SpecialImageTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-04-05 09:30:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-05 14:21:07 +0000
commit8caf85f9f40f6bad38bf66bd02b87dcebe139a5c (patch)
tree46a2b1414601ca99f6c60bd3442e8075bc27173f /tests/SpecialImageTest.cpp
parent91749c82523c8b0b3f2b6f800d85893ca5386fbd (diff)
Add GrBackendTexture/RenderTarget accessors to SkSurface
Change-Id: I63477fd4b8d48dc50af72736f0f8df566cd96d4a Reviewed-on: https://skia-review.googlesource.com/85220 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/SpecialImageTest.cpp')
-rw-r--r--tests/SpecialImageTest.cpp8
1 files changed, 6 insertions, 2 deletions
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<SkSpecialImage>& img, skiatest::Reporter* rep
SkPixmap tmpPixmap;
REPORTER_ASSERT(reporter, isGPUBacked != !!tightImg->peekPixels(&tmpPixmap));
}
+#if SK_SUPPORT_GPU
{
SkImageFilter::OutputProperties outProps(img->getColorSpace());
sk_sp<SkSurface> 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) {