aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SurfaceTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-04-04 15:54:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-04 20:34:28 +0000
commitc5509955b98daa0643da7fcd7ad356a9aa5a42da (patch)
treeb8f9628b518b8efb5c4de5fd566ca4cc10be7b07 /tests/SurfaceTest.cpp
parent1fda0247a77e5c7af57163750a3f7a04fddffdd5 (diff)
Add GrBackendTexture accessor to SkImage (take 2)
This makes accessing the GPU resource behind an SkImage a lot more typesafe. Additionally, the GrBackendObject is being deprecated so this is the path forward. I split the controversial stuff off into https://skia-review.googlesource.com/c/skia/+/118575 (Add SkImage::setLayout call). Change-Id: I297e72770e8fb360fac7c7cd74f050ae759ae133 Reviewed-on: https://skia-review.googlesource.com/118571 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/SurfaceTest.cpp')
-rw-r--r--tests/SurfaceTest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index e74dcc915c..744dd63a42 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -551,11 +551,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacepeekTexture_Gpu, reporter, ctxInfo) {
sk_sp<SkImage> image(surface->makeImageSnapshot());
REPORTER_ASSERT(reporter, as_IB(image)->isTextureBacked());
- GrBackendObject textureHandle = image->getTextureHandle(false);
- REPORTER_ASSERT(reporter, 0 != textureHandle);
+ GrBackendTexture backendTex = image->getBackendTexture(false);
+ REPORTER_ASSERT(reporter, backendTex.isValid());
surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);
REPORTER_ASSERT(reporter, as_IB(image)->isTextureBacked());
- REPORTER_ASSERT(reporter, textureHandle == image->getTextureHandle(false));
+ GrBackendTexture backendTex2 = image->getBackendTexture(false);
+ REPORTER_ASSERT(reporter, GrBackendTexture::TestingOnly_Equals(backendTex, backendTex2));
}
}
#endif