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

Unified Diff: src/utils/debugger/SkDebugCanvas.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/debugger/SkDebugCanvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkDebugCanvas.cpp
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index 88bee505d80ca4700a077037180346cd932f177a..b4813e410369955da211d48cfaeadc6028f70161 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -410,7 +410,20 @@ void SkDebugCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) {
}
void SkDebugCanvas::didConcat(const SkMatrix& matrix) {
- addDrawCommand(new SkConcatCommand(matrix));
+ switch (matrix.getType()) {
+ case SkMatrix::kTranslate_Mask:
+ this->addDrawCommand(new SkTranslateCommand(matrix.getTranslateX(),
+ matrix.getTranslateY()));
+ break;
+ case SkMatrix::kScale_Mask:
+ this->addDrawCommand(new SkScaleCommand(matrix.getScaleX(),
+ matrix.getScaleY()));
+ break;
+ default:
+ this->addDrawCommand(new SkConcatCommand(matrix));
+ break;
+ }
+
this->INHERITED::didConcat(matrix);
}
@@ -535,11 +548,6 @@ void SkDebugCanvas::willRestore() {
this->INHERITED::willRestore();
}
-void SkDebugCanvas::didRotate(SkScalar degrees) {
- addDrawCommand(new SkRotateCommand(degrees));
- this->INHERITED::didRotate(degrees);
-}
-
void SkDebugCanvas::willSave(SaveFlags flags) {
this->addDrawCommand(new SkSaveCommand(flags));
this->INHERITED::willSave(flags);
@@ -553,26 +561,11 @@ SkCanvas::SaveLayerStrategy SkDebugCanvas::willSaveLayer(const SkRect* bounds, c
return kNoLayer_SaveLayerStrategy;
}
-void SkDebugCanvas::didScale(SkScalar sx, SkScalar sy) {
- addDrawCommand(new SkScaleCommand(sx, sy));
- this->INHERITED::didScale(sx, sy);
-}
-
void SkDebugCanvas::didSetMatrix(const SkMatrix& matrix) {
addDrawCommand(new SkSetMatrixCommand(matrix));
this->INHERITED::didSetMatrix(matrix);
}
-void SkDebugCanvas::didSkew(SkScalar sx, SkScalar sy) {
- addDrawCommand(new SkSkewCommand(sx, sy));
- this->INHERITED::didSkew(sx, sy);
-}
-
-void SkDebugCanvas::didTranslate(SkScalar dx, SkScalar dy) {
- addDrawCommand(new SkTranslateCommand(dx, dy));
- this->INHERITED::didTranslate(dx, dy);
-}
-
void SkDebugCanvas::toggleCommand(int index, bool toggle) {
SkASSERT(index < fCommandVector.count());
fCommandVector[index]->setVisible(toggle);
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698