aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ImageNewShaderTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-04-17 10:53:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-17 15:22:42 +0000
commit12e946b4bfdf598bffb276776ea6e25439e25265 (patch)
tree3431130a5008af573c497da13243da360d147918 /tests/ImageNewShaderTest.cpp
parent81340c65e0e507ca544e32c0fa0c6880f371eaff (diff)
deprecate odd variants of SkCanvas::readPixels
Bug: skia:6513 Change-Id: I51179a85f0912d3f899c368c30a943d346dd1d05 Reviewed-on: https://skia-review.googlesource.com/13589 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tests/ImageNewShaderTest.cpp')
-rw-r--r--tests/ImageNewShaderTest.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/ImageNewShaderTest.cpp b/tests/ImageNewShaderTest.cpp
index 4091db0d9b..37e1e301ee 100644
--- a/tests/ImageNewShaderTest.cpp
+++ b/tests/ImageNewShaderTest.cpp
@@ -57,14 +57,14 @@ static void run_shader_test(skiatest::Reporter* reporter, SkSurface* sourceSurfa
destinationCanvas->clear(SK_ColorTRANSPARENT);
destinationCanvas->drawPaint(paint);
- SkIRect rect = info.bounds();
-
SkBitmap bmOrig;
- sourceSurface->getCanvas()->readPixels(rect, &bmOrig);
+ bmOrig.allocN32Pixels(info.width(), info.height());
+ sourceSurface->getCanvas()->readPixels(bmOrig, 0, 0);
SkBitmap bm;
- destinationCanvas->readPixels(rect, &bm);
+ bm.allocN32Pixels(info.width(), info.height());
+ destinationCanvas->readPixels(bm, 0, 0);
test_bitmap_equality(reporter, bmOrig, bm);
@@ -85,7 +85,8 @@ static void run_shader_test(skiatest::Reporter* reporter, SkSurface* sourceSurfa
destinationCanvas->drawPaint(paintTranslated);
SkBitmap bmt;
- destinationCanvas->readPixels(rect, &bmt);
+ bmt.allocN32Pixels(info.width(), info.height());
+ destinationCanvas->readPixels(bmt, 0, 0);
// Test correctness
{