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

Unified Diff: src/utils/SkLuaCanvas.cpp

Issue 203203004: Consolidate SkCanvas matrix virtuals. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Updated per review. Created 6 years, 9 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 | « src/utils/SkDumpCanvas.cpp ('k') | src/utils/SkNWayCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkLuaCanvas.cpp
diff --git a/src/utils/SkLuaCanvas.cpp b/src/utils/SkLuaCanvas.cpp
index b5789e058b95cb728882a897b64cf2067a81ec99..7e1d5a8fe2682a8369ac7c4c3d604116c4ff9f59 100644
--- a/src/utils/SkLuaCanvas.cpp
+++ b/src/utils/SkLuaCanvas.cpp
@@ -106,35 +106,27 @@ void SkLuaCanvas::willRestore() {
this->INHERITED::willRestore();
}
-void SkLuaCanvas::didTranslate(SkScalar dx, SkScalar dy) {
- AUTO_LUA("translate");
- lua.pushScalar(dx, "dx");
- lua.pushScalar(dy, "dy");
- this->INHERITED::didTranslate(dx, dy);
-}
-
-void SkLuaCanvas::didScale(SkScalar sx, SkScalar sy) {
- AUTO_LUA("scale");
- lua.pushScalar(sx, "sx");
- lua.pushScalar(sy, "sy");
- this->INHERITED::didScale(sx, sy);
-}
-
-void SkLuaCanvas::didRotate(SkScalar degrees) {
- AUTO_LUA("rotate");
- lua.pushScalar(degrees, "degrees");
- this->INHERITED::didRotate(degrees);
-}
-
-void SkLuaCanvas::didSkew(SkScalar kx, SkScalar ky) {
- AUTO_LUA("skew");
- lua.pushScalar(kx, "kx");
- lua.pushScalar(ky, "ky");
- this->INHERITED::didSkew(kx, ky);
-}
-
void SkLuaCanvas::didConcat(const SkMatrix& matrix) {
- AUTO_LUA("concat");
+ switch (matrix.getType()) {
+ case SkMatrix::kTranslate_Mask: {
+ AUTO_LUA("translate");
+ lua.pushScalar(matrix.getTranslateX(), "dx");
+ lua.pushScalar(matrix.getTranslateY(), "dy");
+ break;
+ }
+ case SkMatrix::kScale_Mask: {
+ AUTO_LUA("scale");
+ lua.pushScalar(matrix.getScaleX(), "sx");
+ lua.pushScalar(matrix.getScaleY(), "sy");
+ break;
+ }
+ default: {
+ AUTO_LUA("concat");
+ lua.pushMatrix(matrix);
+ break;
+ }
+ }
+
this->INHERITED::didConcat(matrix);
}
« no previous file with comments | « src/utils/SkDumpCanvas.cpp ('k') | src/utils/SkNWayCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698