From 12e946b4bfdf598bffb276776ea6e25439e25265 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Mon, 17 Apr 2017 10:53:29 -0400 Subject: deprecate odd variants of SkCanvas::readPixels Bug: skia:6513 Change-Id: I51179a85f0912d3f899c368c30a943d346dd1d05 Reviewed-on: https://skia-review.googlesource.com/13589 Reviewed-by: Florin Malita Reviewed-by: Matt Sarett Commit-Queue: Mike Reed --- tests/ImageNewShaderTest.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/ImageNewShaderTest.cpp') 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 { -- cgit v1.2.3