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

Unified Diff: gm/fontscalerdistortable.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/fontscalerdistortable.cpp
diff --git a/gm/fontscalerdistortable.cpp b/gm/fontscalerdistortable.cpp
index b4f2ca370ce6175ec99027b682a4122e7fe04621..be6a7ebc58dca12b31d360418aedb8301f6899a3 100644
--- a/gm/fontscalerdistortable.cpp
+++ b/gm/fontscalerdistortable.cpp
@@ -19,8 +19,6 @@ public:
this->setBGColor(0xFFFFFFFF);
}
- virtual ~FontScalerDistortableGM() { }
-
protected:
SkString onShortName() override {
@@ -31,12 +29,6 @@ protected:
return SkISize::Make(550, 700);
}
- 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;
paint.setAntiAlias(true);
@@ -63,7 +55,7 @@ protected:
SkAutoCanvasRestore acr(canvas, true);
canvas->translate(SkIntToScalar(30 + i * 100), 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/fontscaler.cpp ('k') | gm/imagefilterstransformed.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698