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

Unified Diff: samplecode/SampleCircle.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/SampleCircle.cpp
diff --git a/samplecode/SampleCircle.cpp b/samplecode/SampleCircle.cpp
index ff88ac4b9b7c7c96aacb4d3f4a09298a27043400..f4e6cc99b480865d69b5436a9e17a3781f8bf452 100644
--- a/samplecode/SampleCircle.cpp
+++ b/samplecode/SampleCircle.cpp
@@ -87,17 +87,10 @@ protected:
path->close();
}
- static void rotate(SkCanvas* canvas, SkScalar angle, SkScalar px, SkScalar py) {
- canvas->translate(-px, -py);
- canvas->rotate(angle);
- canvas->translate(px, py);
- }
-
virtual void onDrawContent(SkCanvas* canvas) {
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
-// canvas->drawCircle(250, 250, 220, paint);
SkMatrix matrix;
matrix.setScale(SkIntToScalar(100), SkIntToScalar(100));
matrix.postTranslate(SkIntToScalar(200), SkIntToScalar(200));
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleDither.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698