From cf677782ebc85c37e4ed9ec81ef17b4ed2239db1 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Tue, 26 Mar 2019 16:41:49 -0400 Subject: [PATCH] Fix paint filter quality in draw_image_set GM Outer SkPaint paint variable was shadowed by inner, so the experimental_DrawEdgeAAImageSet calls always used nearest-neighbor filtering. Change-Id: I0a44ba9056c553c58559cf503d33df6b7f9e7019 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203803 Auto-Submit: Michael Ludwig Reviewed-by: Brian Salomon Commit-Queue: Michael Ludwig --- gm/drawimageset.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gm/drawimageset.cpp b/gm/drawimageset.cpp index d687958c87c60..edd27b1ba2bb4 100644 --- a/gm/drawimageset.cpp +++ b/gm/drawimageset.cpp @@ -121,9 +121,9 @@ class DrawImageSetGM : public GM { SkAssertResult(matrices[3].setPolyToPoly(src, dst, 4)); matrices[3].postTranslate(100.f, d); for (auto fm : {kNone_SkFilterQuality, kLow_SkFilterQuality}) { - SkPaint paint; - paint.setFilterQuality(fm); - paint.setBlendMode(SkBlendMode::kSrcOver); + SkPaint setPaint; + setPaint.setFilterQuality(fm); + setPaint.setBlendMode(SkBlendMode::kSrcOver); for (size_t m = 0; m < SK_ARRAY_COUNT(matrices); ++m) { // Draw grid of red lines at interior tile boundaries. @@ -149,7 +149,7 @@ class DrawImageSetGM : public GM { } canvas->save(); canvas->concat(matrices[m]); - canvas->experimental_DrawEdgeAAImageSet(fSet, kM * kN, nullptr, nullptr, &paint, + canvas->experimental_DrawEdgeAAImageSet(fSet, kM * kN, nullptr, nullptr, &setPaint, SkCanvas::kFast_SrcRectConstraint); canvas->restore(); } @@ -164,8 +164,8 @@ class DrawImageSetGM : public GM { canvas->save(); canvas->rotate(3.f); - paint.setBlendMode(SkBlendMode::kExclusion); - canvas->experimental_DrawEdgeAAImageSet(&entry, 1, nullptr, nullptr, &paint, + setPaint.setBlendMode(SkBlendMode::kExclusion); + canvas->experimental_DrawEdgeAAImageSet(&entry, 1, nullptr, nullptr, &setPaint, SkCanvas::kFast_SrcRectConstraint); canvas->restore(); canvas->translate(2 * d, 0);