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

Unified Diff: bench/BitmapBench.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
« no previous file with comments | « no previous file | gm/dftext.cpp » ('j') | src/core/SkCanvas.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/BitmapBench.cpp
diff --git a/bench/BitmapBench.cpp b/bench/BitmapBench.cpp
index 812f8c32366ab6e0b60f24f69e73f4c06f3f2dc1..f756d4ca77ed6090e9581011368113f098e3666c 100644
--- a/bench/BitmapBench.cpp
+++ b/bench/BitmapBench.cpp
@@ -239,10 +239,7 @@ protected:
if (fFlags & kRotate_Flag) {
const SkScalar x = SkIntToScalar(dim.fWidth) / 2;
const SkScalar y = SkIntToScalar(dim.fHeight) / 2;
-
- canvas->translate(x, y);
- canvas->rotate(SkIntToScalar(35));
- canvas->translate(-x, -y);
+ canvas->rotate(SkIntToScalar(35), x, y);
}
INHERITED::onDraw(loops, canvas);
}
« no previous file with comments | « no previous file | gm/dftext.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698