aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/WritePixelsTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-11-03 13:42:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-03 18:06:37 +0000
commit71d9d84d6cd38b9dc8711849952bb9e668ab33a2 (patch)
tree35f68bcf7d8ac337555a0479882e19a7fc8bec15 /tests/WritePixelsTest.cpp
parent89eda8a5e3f9023a4ee4648627101d7b4e60b4c8 (diff)
Use temporary FBO for GrGLGpu::onReadPixels.
Allow configs to be supported as FBO attachments for copies/readbacks without being "renderable" elsewhere in Ganesh. The motivation for this is to add support for int textures as srcs but not as dsts (at least initially) but to still be able to read them back. This means we don't pay for a unneeded GPU copy when reading back a GrSurface that is a GrTexture and not a GrRenderTarget. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4345 Change-Id: I824a73c6b8c1b9634206d76ccf0848d5f9b64441 Reviewed-on: https://skia-review.googlesource.com/4345 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/WritePixelsTest.cpp')
-rw-r--r--tests/WritePixelsTest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 77038d4c8e..7916040dbc 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -191,7 +191,9 @@ static bool check_write(skiatest::Reporter* reporter, SkCanvas* canvas, const Sk
// At some point this will be unsupported, as we won't allow accessBitmap() to magically call
// readPixels for the client.
SkBitmap secretDevBitmap;
- canvas->readPixels(canvasInfo.bounds(), &secretDevBitmap);
+ if (!canvas->readPixels(canvasInfo.bounds(), &secretDevBitmap)) {
+ return false;
+ }
SkAutoLockPixels alp(secretDevBitmap);
canvasRowBytes = secretDevBitmap.rowBytes();