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

Unified Diff: samplecode/SampleFontScalerTest.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/SampleFontScalerTest.cpp
diff --git a/samplecode/SampleFontScalerTest.cpp b/samplecode/SampleFontScalerTest.cpp
index bd9309790e3be851a8c62d63439c6dcc470f2c1e..2b4a46d00c100839c75a21a90e662c01c4bd058a 100644
--- a/samplecode/SampleFontScalerTest.cpp
+++ b/samplecode/SampleFontScalerTest.cpp
@@ -44,7 +44,6 @@ public:
fFaces[i] = SkTypeface::MakeFromName(
gFaces[i].fName, SkFontStyle::FromOldStyle(gFaces[i].fStyle));
}
-// this->setBGColor(0xFFDDDDDD);
}
protected:
@@ -57,12 +56,6 @@ protected:
return this->INHERITED::onQuery(evt);
}
- static void rotate_about(SkCanvas* canvas, SkScalar degrees, SkScalar px, SkScalar py) {
- canvas->translate(px, py);
- canvas->rotate(degrees);
- canvas->translate(-px, -py);
- }
-
virtual void onDrawContent(SkCanvas* canvas) {
SkPaint paint;
@@ -100,7 +93,7 @@ protected:
SkAutoCanvasRestore acr(canvas, true);
canvas->translate(SkIntToScalar(50 + i * 230),
SkIntToScalar(20));
- rotate_about(canvas, SkIntToScalar(i * 5), x, y * 10);
+ canvas->rotate(SkIntToScalar(i * 5), x, y * 10);
{
SkPaint p;
« no previous file with comments | « samplecode/SampleDither.cpp ('k') | samplecode/SampleHT.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698