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

Unified Diff: samplecode/SampleApp.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/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index ffa507bc17d519d15c7b31f3c872b5ae22004da3..7afaa969721a9c0d0ad7666ecf0ae714e6ef8856 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1372,9 +1372,7 @@ void SampleWindow::beforeChild(SkView* child, SkCanvas* canvas) {
if (fRotate) {
SkScalar cx = this->width() / 2;
SkScalar cy = this->height() / 2;
- canvas->translate(cx, cy);
- canvas->rotate(gAnimTimer.scaled(10));
- canvas->translate(-cx, -cy);
+ canvas->rotate(gAnimTimer.scaled(10), cx, cy);
}
if (fPerspAnim) {
« no previous file with comments | « include/core/SkCanvas.h ('k') | samplecode/SampleCircle.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698