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

Unified Diff: samplecode/SampleDither.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: samplecode/SampleDither.cpp
diff --git a/samplecode/SampleDither.cpp b/samplecode/SampleDither.cpp
index 99b33f0f0ef6dfafe18106e255e157b733267a7a..a1b751b96f2d29b9bdc0a125e9467264711b000b 100644
--- a/samplecode/SampleDither.cpp
+++ b/samplecode/SampleDither.cpp
@@ -37,10 +37,7 @@ static void draw_sweep(SkCanvas* c, int width, int height, SkScalar angle) {
colors, nullptr, SK_ARRAY_COUNT(colors)));
SkAutoCanvasRestore acr(c, true);
-
- c->translate(r.centerX(), r.centerY());
- c->rotate(angle);
- c->translate(-r.centerX(), -r.centerY());
+ c->rotate(angle, r.centerX(), r.centerY());
SkRect bounds = r;
r.inset(p.getStrokeWidth(), p.getStrokeWidth());

Powered by Google App Engine
This is Rietveld 408576698