Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: gm/strokes.cpp

Issue 2142033002: Factor code to rotate a canvas about a point. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move to canvas. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gm/strokes.cpp
diff --git a/gm/strokes.cpp b/gm/strokes.cpp
index 61f5a8af6aa770895e4c135c5ac7b04f4f3b3e64..afbe5ee4da60d5ace2f298258de649f301cf7e9d 100644
--- a/gm/strokes.cpp
+++ b/gm/strokes.cpp
@@ -290,12 +290,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);
- }
-
void onDraw(SkCanvas* canvas) override {
canvas->drawColor(SK_ColorWHITE);
@@ -316,7 +310,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);
+ canvas->rotate(SkIntToScalar(15), SW/2, SH/2);
canvas->drawPath(fPath, paint);
}
}
« no previous file with comments | « gm/imagefilterstransformed.cpp ('k') | gm/typeface.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698