Index: gm/filterindiabox.cpp |
diff --git a/gm/filterindiabox.cpp b/gm/filterindiabox.cpp |
index a29f08b8b62a4b338d0a4ba94a910d018e96dadc..6b662f064f946ebcbe2660e499d48bfdf609e7ad 100644 |
--- a/gm/filterindiabox.cpp |
+++ b/gm/filterindiabox.cpp |
@@ -23,24 +23,23 @@ static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) { |
return SkSize::Make(bounds.width(), bounds.height()); |
} |
-static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, SkScalar dx) { |
+static void draw_cell(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, SkScalar dx, |
+ SkPaint::FilterLevel lvl) { |
SkPaint paint; |
+ paint.setFilterLevel(lvl); |
SkAutoCanvasRestore acr(canvas, true); |
- canvas->drawBitmapMatrix(bm, mat, &paint); |
- |
- paint.setFilterLevel(SkPaint::kLow_FilterLevel); |
- canvas->translate(dx, 0); |
- canvas->drawBitmapMatrix(bm, mat, &paint); |
- |
- paint.setFilterLevel(SkPaint::kMedium_FilterLevel); |
canvas->translate(dx, 0); |
- canvas->drawBitmapMatrix(bm, mat, &paint); |
+ canvas->concat(mat); |
+ canvas->drawBitmap(bm, 0, 0, &paint); |
+} |
- paint.setFilterLevel(SkPaint::kHigh_FilterLevel); |
- canvas->translate(dx, 0); |
- canvas->drawBitmapMatrix(bm, mat, &paint); |
+static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat, SkScalar dx) { |
+ draw_cell(canvas, bm, mat, 0 * dx, SkPaint::kNone_FilterLevel); |
+ draw_cell(canvas, bm, mat, 1 * dx, SkPaint::kLow_FilterLevel); |
+ draw_cell(canvas, bm, mat, 2 * dx, SkPaint::kMedium_FilterLevel); |
+ draw_cell(canvas, bm, mat, 3 * dx, SkPaint::kHigh_FilterLevel); |
} |
class FilterIndiaBoxGM : public skiagm::GM { |