Skip to content

Commit

Permalink
Fix paint filter quality in draw_image_set GM
Browse files Browse the repository at this point in the history
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 <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
  • Loading branch information
lhkbob authored and Skia Commit-Bot committed Mar 27, 2019
1 parent 0f82797 commit cf67778
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gm/drawimageset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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();
}
Expand All @@ -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);
Expand Down

0 comments on commit cf67778

Please sign in to comment.