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

Unified Diff: src/utils/SkDumpCanvas.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/SkDeferredCanvas.cpp ('k') | src/utils/SkLuaCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDumpCanvas.cpp
diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp
index 7445940f4e44b20b4960f5189a4cac1db0aef479..3bf90da9f5a59a6d0483d014856401e8c38119a5 100644
--- a/src/utils/SkDumpCanvas.cpp
+++ b/src/utils/SkDumpCanvas.cpp
@@ -222,33 +222,26 @@ void SkDumpCanvas::willRestore() {
this->INHERITED::willRestore();
}
-void SkDumpCanvas::didTranslate(SkScalar dx, SkScalar dy) {
- this->dump(kMatrix_Verb, NULL, "translate(%g %g)",
- SkScalarToFloat(dx), SkScalarToFloat(dy));
- this->INHERITED::didTranslate(dx, dy);
-}
-
-void SkDumpCanvas::didScale(SkScalar sx, SkScalar sy) {
- this->dump(kMatrix_Verb, NULL, "scale(%g %g)",
- SkScalarToFloat(sx), SkScalarToFloat(sy));
- this->INHERITED::didScale(sx, sy);
-}
-
-void SkDumpCanvas::didRotate(SkScalar degrees) {
- this->dump(kMatrix_Verb, NULL, "rotate(%g)", SkScalarToFloat(degrees));
- this->INHERITED::didRotate(degrees);
-}
-
-void SkDumpCanvas::didSkew(SkScalar sx, SkScalar sy) {
- this->dump(kMatrix_Verb, NULL, "skew(%g %g)",
- SkScalarToFloat(sx), SkScalarToFloat(sy));
- this->INHERITED::didSkew(sx, sy);
-}
-
void SkDumpCanvas::didConcat(const SkMatrix& matrix) {
SkString str;
- matrix.toString(&str);
- this->dump(kMatrix_Verb, NULL, "concat(%s)", str.c_str());
+
+ switch (matrix.getType()) {
+ case SkMatrix::kTranslate_Mask:
+ this->dump(kMatrix_Verb, NULL, "translate(%g %g)",
+ SkScalarToFloat(matrix.getTranslateX()),
+ SkScalarToFloat(matrix.getTranslateY()));
+ break;
+ case SkMatrix::kScale_Mask:
+ this->dump(kMatrix_Verb, NULL, "scale(%g %g)",
+ SkScalarToFloat(matrix.getScaleX()),
+ SkScalarToFloat(matrix.getScaleY()));
+ break;
+ default:
+ matrix.toString(&str);
+ this->dump(kMatrix_Verb, NULL, "concat(%s)", str.c_str());
+ break;
+ }
+
this->INHERITED::didConcat(matrix);
}
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | src/utils/SkLuaCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698