aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-06-05 13:49:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-05 18:10:47 +0000
commitad5a64604f4aaca1ea30326177a1b56d9ffed37e (patch)
tree2e1fe5874ae5a680159ef63ec46fae2630f5c1ab
parent67d52cf0d8baff02fd4337a62f1f9cd975edc18f (diff)
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 <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
-rw-r--r--gm/shapes_as_paths.cpp11
1 files 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);