From ad5a64604f4aaca1ea30326177a1b56d9ffed37e Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Mon, 5 Jun 2017 13:49:38 -0400 Subject: In shapes_as_paths, draw zoom from pixmaps, not images Trying to track down why the Galaxy S6 sometimes claims that every pixel is different, even though the zoomed images look identical. It's helpful to draw what's actually being diffed. Bug: skia:6653 Change-Id: Ia577aa70ed11d806fa204eaffdef41e6a65a60f2 Reviewed-on: https://skia-review.googlesource.com/18623 Reviewed-by: Mike Klein Commit-Queue: Brian Osman --- gm/shapes_as_paths.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gm/shapes_as_paths.cpp b/gm/shapes_as_paths.cpp index 862c83c184..774ceed31d 100644 --- a/gm/shapes_as_paths.cpp +++ b/gm/shapes_as_paths.cpp @@ -78,10 +78,13 @@ static void draw_diff(SkCanvas* canvas, SkImage* imgA, SkImage* imgB) { canvas->drawBitmap(highlight, 0, 0); // Draw zoom of largest pixel diff - canvas->drawImageRect(imgA, SkRect::MakeXYWH(maxDiffX - 5, maxDiffY - 5, 10, 10), - SkRect::MakeXYWH(w, 0, w, h), nullptr); - canvas->drawImageRect(imgB, SkRect::MakeXYWH(maxDiffX - 5, maxDiffY - 5, 10, 10), - SkRect::MakeXYWH(2 * w, 0, w, h), nullptr); + SkBitmap bmpA, bmpB; + SkAssertResult(bmpA.installPixels(pmapA)); + SkAssertResult(bmpB.installPixels(pmapB)); + canvas->drawBitmapRect(bmpA, SkRect::MakeXYWH(maxDiffX - 5, maxDiffY - 5, 10, 10), + SkRect::MakeXYWH(w, 0, w, h), nullptr); + canvas->drawBitmapRect(bmpB, SkRect::MakeXYWH(maxDiffX - 5, maxDiffY - 5, 10, 10), + SkRect::MakeXYWH(2 * w, 0, w, h), nullptr); // Add lines to separate zoom boxes canvas->drawLine(w, 0, w, h, outline); -- cgit v1.2.3