diff options
author | Robert Phillips <robertphillips@google.com> | 2017-06-23 14:09:30 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-26 15:29:18 +0000 |
commit | 8744405448b9402e1368aebd321c4f555543301a (patch) | |
tree | b5df1fbe70897eca74072f9c5b9920977c817d36 /tests/ImageTest.cpp | |
parent | 6945c946ea800b7bff31920914a990c88a706718 (diff) |
Remove SkImage_Base::peekTexture call
Change-Id: Ie5b6bec8df083e0a128aa234d80f5a214cd98f0d
Reviewed-on: https://skia-review.googlesource.com/20741
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/ImageTest.cpp')
-rw-r--r-- | tests/ImageTest.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index 13a8a131d9..511b6f24b6 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -483,23 +483,26 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_makeTextureImage, reporter, contextIn ERRORF(reporter, "Error creating image."); continue; } - GrTexture* origTexture = as_IB(image)->peekTexture(); sk_sp<SkImage> texImage(image->makeTextureImage(context, dstColorSpace.get())); if (!texImage) { + GrContext* imageContext = as_IB(image)->context(); + // We expect to fail if image comes from a different GrContext. - if (!origTexture || origTexture->getContext() == context) { + if (!image->isTextureBacked() || imageContext == context) { ERRORF(reporter, "makeTextureImage failed."); } continue; } - GrTexture* copyTexture = as_IB(texImage)->peekTexture(); - if (!copyTexture) { + if (!texImage->isTextureBacked()) { ERRORF(reporter, "makeTextureImage returned non-texture image."); continue; } - if (origTexture) { - if (origTexture != copyTexture) { + if (image->isTextureBacked()) { + GrSurfaceProxy* origProxy = as_IB(image)->peekProxy(); + GrSurfaceProxy* copyProxy = as_IB(texImage)->peekProxy(); + + if (origProxy->underlyingUniqueID() != copyProxy->underlyingUniqueID()) { ERRORF(reporter, "makeTextureImage made unnecessary texture copy."); } } @@ -546,7 +549,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkImage_drawAbandonedGpuImage, reporter, c auto image = create_gpu_image(context); auto info = SkImageInfo::MakeN32(20, 20, kOpaque_SkAlphaType); auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info)); - as_IB(image)->peekTexture()->abandon(); + image->getTexture()->abandon(); surface->getCanvas()->drawImage(image, 0, 0); } |