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

Unified Diff: gm/fontscaler.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/fontscaler.cpp
diff --git a/gm/fontscaler.cpp b/gm/fontscaler.cpp
index 69cf346c4d2826d1c69825a4b3b5158f798f125b..cc9815c9d917be75008248c1e11e4090b09522ab 100644
--- a/gm/fontscaler.cpp
+++ b/gm/fontscaler.cpp
@@ -15,9 +15,6 @@ public:
this->setBGColor(0xFFFFFFFF);
}
- virtual ~FontScalerGM() {
- }
-
protected:
SkString onShortName() override {
@@ -30,14 +27,6 @@ protected:
return SkISize::Make(1450, 750);
}
- static void rotate_about(SkCanvas* canvas,
- SkScalar degrees,
- SkScalar px, SkScalar py) {
- canvas->translate(px, py);
- canvas->rotate(degrees);
- canvas->translate(-px, -py);
- }
-
void onDraw(SkCanvas* canvas) override {
SkPaint paint;
@@ -59,7 +48,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 | « gm/dftext.cpp ('k') | gm/fontscalerdistortable.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698