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

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: 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..6198df5a1d69a75eb44ae23083a412a671b131af 100644
--- a/samplecode/SampleFontScalerTest.cpp
+++ b/samplecode/SampleFontScalerTest.cpp
@@ -19,6 +19,7 @@
#include "SkColorPriv.h"
#include "SkColorFilter.h"
#include "SkDither.h"
+#include "sk_tool_utils.h"
static const struct {
const char* fName;
@@ -44,7 +45,6 @@ public:
fFaces[i] = SkTypeface::MakeFromName(
gFaces[i].fName, SkFontStyle::FromOldStyle(gFaces[i].fStyle));
}
-// this->setBGColor(0xFFDDDDDD);
}
protected:
@@ -57,12 +57,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 +94,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;
« gm/strokes.cpp ('K') | « samplecode/SampleDither.cpp ('k') | samplecode/SampleHT.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698