| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkDrawCommand.h" | 10 #include "SkDrawCommand.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 case SAVE_LAYER: return "Save Layer"; | 58 case SAVE_LAYER: return "Save Layer"; |
| 59 case SCALE: return "Scale"; | 59 case SCALE: return "Scale"; |
| 60 case SET_MATRIX: return "Set Matrix"; | 60 case SET_MATRIX: return "Set Matrix"; |
| 61 case SKEW: return "Skew"; | 61 case SKEW: return "Skew"; |
| 62 case TRANSLATE: return "Translate"; | 62 case TRANSLATE: return "Translate"; |
| 63 case NOOP: return "NoOp"; | 63 case NOOP: return "NoOp"; |
| 64 case BEGIN_COMMENT_GROUP: return "BeginCommentGroup"; | 64 case BEGIN_COMMENT_GROUP: return "BeginCommentGroup"; |
| 65 case COMMENT: return "Comment"; | 65 case COMMENT: return "Comment"; |
| 66 case END_COMMENT_GROUP: return "EndCommentGroup"; | 66 case END_COMMENT_GROUP: return "EndCommentGroup"; |
| 67 case DRAW_DRRECT: return "Draw DRRect"; | 67 case DRAW_DRRECT: return "Draw DRRect"; |
| 68 case PUSH_CULL: return "PushCull"; | |
| 69 case POP_CULL: return "PopCull"; | |
| 70 default: | 68 default: |
| 71 SkDebugf("DrawType error 0x%08x\n", type); | 69 SkDebugf("DrawType error 0x%08x\n", type); |
| 72 SkASSERT(0); | 70 SkASSERT(0); |
| 73 break; | 71 break; |
| 74 } | 72 } |
| 75 SkDEBUGFAIL("DrawType UNUSED\n"); | 73 SkDEBUGFAIL("DrawType UNUSED\n"); |
| 76 return NULL; | 74 return NULL; |
| 77 } | 75 } |
| 78 | 76 |
| 79 SkString SkDrawCommand::toString() const { | 77 SkString SkDrawCommand::toString() const { |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 fDy = dy; | 963 fDy = dy; |
| 966 | 964 |
| 967 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); | 965 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); |
| 968 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); | 966 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); |
| 969 } | 967 } |
| 970 | 968 |
| 971 void SkTranslateCommand::execute(SkCanvas* canvas) const { | 969 void SkTranslateCommand::execute(SkCanvas* canvas) const { |
| 972 canvas->translate(fDx, fDy); | 970 canvas->translate(fDx, fDy); |
| 973 } | 971 } |
| 974 | 972 |
| 975 SkPushCullCommand::SkPushCullCommand(const SkRect& cullRect) | |
| 976 : INHERITED(PUSH_CULL) | |
| 977 , fCullRect(cullRect) { | |
| 978 fInfo.push(SkObjectParser::RectToString(cullRect)); | |
| 979 } | |
| 980 | |
| 981 void SkPushCullCommand::execute(SkCanvas* canvas) const { | |
| 982 canvas->pushCull(fCullRect); | |
| 983 } | |
| 984 | |
| 985 void SkPushCullCommand::vizExecute(SkCanvas* canvas) const { | |
| 986 canvas->pushCull(fCullRect); | |
| 987 | |
| 988 SkPaint p; | |
| 989 p.setColor(SK_ColorCYAN); | |
| 990 p.setStyle(SkPaint::kStroke_Style); | |
| 991 canvas->drawRect(fCullRect, p); | |
| 992 } | |
| 993 | |
| 994 SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { } | |
| 995 | |
| 996 void SkPopCullCommand::execute(SkCanvas* canvas) const { | |
| 997 canvas->popCull(); | |
| 998 } | |
| OLD | NEW |