Index: gm/strokes.cpp |
diff --git a/gm/strokes.cpp b/gm/strokes.cpp |
index 61f5a8af6aa770895e4c135c5ac7b04f4f3b3e64..39661a5a07c8533157ff9e3da7489f67c505db1d 100644 |
--- a/gm/strokes.cpp |
+++ b/gm/strokes.cpp |
@@ -10,6 +10,7 @@ |
#include "SkRandom.h" |
#include "SkDashPathEffect.h" |
#include "SkParsePath.h" |
+#include "sk_tool_utils.h" |
#define W 400 |
#define H 400 |
@@ -290,12 +291,6 @@ protected: |
return SkISize::Make(W, H*2); |
} |
- static void rotate(SkScalar angle, SkScalar px, SkScalar py, SkCanvas* canvas) { |
- SkMatrix matrix; |
- matrix.setRotate(angle, px, py); |
- canvas->concat(matrix); |
bungeman-skia
2016/07/12 15:47:11
With floats the order of operations matters. This
|
- } |
- |
void onDraw(SkCanvas* canvas) override { |
canvas->drawColor(SK_ColorWHITE); |
@@ -316,7 +311,7 @@ protected: |
for (int i = 0; i < N/2; i++) { |
SkRect r; |
rnd_rect(&r, &paint, rand); |
- rotate(SkIntToScalar(15), SW/2, SH/2, canvas); |
+ sk_tool_utils::rotate_about(canvas, SkIntToScalar(15), SW/2, SH/2); |
canvas->drawPath(fPath, paint); |
} |
} |