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

Unified Diff: samplecode/SampleHT.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/SampleHT.cpp
diff --git a/samplecode/SampleHT.cpp b/samplecode/SampleHT.cpp
index d0cd3a54996dce2211c17b9a4637b75f29a5ff92..273ca1ae9bf25fab56a9a1b08e3b87bd6f8d5640 100644
--- a/samplecode/SampleHT.cpp
+++ b/samplecode/SampleHT.cpp
@@ -13,6 +13,7 @@
#include "SkInterpolator.h"
#include "SkPictureRecorder.h"
#include "SkRandom.h"
+#include "sk_tool_utils.h"
const SkRect gUnitSquare = { -1, -1, 1, 1 };
@@ -95,9 +96,7 @@ public:
fColor = floats_to_color(values);
canvas->save();
- canvas->translate(fR.centerX(), fR.centerY());
- canvas->rotate(values[4]);
- canvas->translate(-fR.centerX(), -fR.centerY());
+ sk_tool_utils::rotate_about(canvas, values[4], fR.centerX(), fR.centerY());
switch (res) {
case SkInterpolator::kFreezeEnd_Result:
« gm/strokes.cpp ('K') | « samplecode/SampleFontScalerTest.cpp ('k') | tools/sk_tool_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698