hide trivial helpers on canvas
BUG=skia:
Change-Id: I42d4ca92897bde5bd8e0575a0104b12b83134cef
Reviewed-on: https://skia-review.googlesource.com/8852
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/gm/simple_magnification.cpp b/gm/simple_magnification.cpp
index 4acd774..342fd92 100644
--- a/gm/simple_magnification.cpp
+++ b/gm/simple_magnification.cpp
@@ -22,11 +22,20 @@
SkCanvas* canvas = surf->getCanvas();
canvas->clear(SK_ColorRED);
- canvas->drawPoint(1.5f, 1.5f, SK_ColorGREEN);
- canvas->drawPoint(2.5f, 1.5f, SK_ColorBLUE);
- canvas->drawPoint(1.5f, 2.5f, SK_ColorCYAN);
- canvas->drawPoint(2.5f, 2.5f, SK_ColorGRAY);
-
+ const struct {
+ SkPoint fPt;
+ SkColor fColor;
+ } rec[] = {
+ { { 1.5f, 1.5f }, SK_ColorGREEN },
+ { { 2.5f, 1.5f }, SK_ColorBLUE },
+ { { 1.5f, 2.5f }, SK_ColorCYAN },
+ { { 2.5f, 2.5f }, SK_ColorGRAY },
+ };
+ SkPaint paint;
+ for (const auto& r : rec) {
+ paint.setColor(r.fColor);
+ canvas->drawPoints(SkCanvas::kPoints_PointMode, 1, &r.fPt, paint);
+ }
return surf->makeImageSnapshot();
} else {
SkBitmap bm;