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

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: 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
« no previous file with comments | « gm/dftext.cpp ('k') | gm/fontscalerdistortable.cpp » ('j') | gm/strokes.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/fontscaler.cpp
diff --git a/gm/fontscaler.cpp b/gm/fontscaler.cpp
index 69cf346c4d2826d1c69825a4b3b5158f798f125b..fb49f61570c95ec47c6e9cc66f5b275e43f67bdb 100644
--- a/gm/fontscaler.cpp
+++ b/gm/fontscaler.cpp
@@ -6,6 +6,7 @@
*/
#include "gm.h"
#include "SkTypeface.h"
+#include "sk_tool_utils.h"
namespace skiagm {
@@ -15,9 +16,6 @@ public:
this->setBGColor(0xFFFFFFFF);
}
- virtual ~FontScalerGM() {
- }
-
protected:
SkString onShortName() override {
@@ -30,14 +28,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 +49,7 @@ protected:
SkAutoCanvasRestore acr(canvas, true);
canvas->translate(SkIntToScalar(50 + i * 230),
SkIntToScalar(20));
- rotate_about(canvas, SkIntToScalar(i * 5), x, y * 10);
+ sk_tool_utils::rotate_about(canvas, SkIntToScalar(i * 5), x, y * 10);
{
SkPaint p;
« no previous file with comments | « gm/dftext.cpp ('k') | gm/fontscalerdistortable.cpp » ('j') | gm/strokes.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698