aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/shapes_as_paths.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/shapes_as_paths.cpp')
-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);