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 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 const char* SkDrawCommand::GetCommandString(DrawType type) { | 28 const char* SkDrawCommand::GetCommandString(DrawType type) { |
29 switch (type) { | 29 switch (type) { |
30 case UNUSED: SkDEBUGFAIL("DrawType UNUSED\n"); break; | 30 case UNUSED: SkDEBUGFAIL("DrawType UNUSED\n"); break; |
31 case DRAW_CLEAR: return "Clear"; | 31 case DRAW_CLEAR: return "Clear"; |
32 case CLIP_PATH: return "Clip Path"; | 32 case CLIP_PATH: return "Clip Path"; |
33 case CLIP_REGION: return "Clip Region"; | 33 case CLIP_REGION: return "Clip Region"; |
34 case CLIP_RECT: return "Clip Rect"; | 34 case CLIP_RECT: return "Clip Rect"; |
35 case CLIP_RRECT: return "Clip RRect"; | 35 case CLIP_RRECT: return "Clip RRect"; |
| 36 case PUSH_CULL: return "PushCull"; |
| 37 case POP_CULL: return "PopCull"; |
36 case CONCAT: return "Concat"; | 38 case CONCAT: return "Concat"; |
37 case DRAW_BITMAP: return "Draw Bitmap"; | 39 case DRAW_BITMAP: return "Draw Bitmap"; |
38 case DRAW_BITMAP_MATRIX: return "Draw Bitmap Matrix"; | 40 case DRAW_BITMAP_MATRIX: return "Draw Bitmap Matrix"; |
39 case DRAW_BITMAP_NINE: return "Draw Bitmap Nine"; | 41 case DRAW_BITMAP_NINE: return "Draw Bitmap Nine"; |
40 case DRAW_BITMAP_RECT_TO_RECT: return "Draw Bitmap Rect"; | 42 case DRAW_BITMAP_RECT_TO_RECT: return "Draw Bitmap Rect"; |
41 case DRAW_DATA: return "Draw Data"; | 43 case DRAW_DATA: return "Draw Data"; |
42 case DRAW_OVAL: return "Draw Oval"; | 44 case DRAW_OVAL: return "Draw Oval"; |
43 case DRAW_PAINT: return "Draw Paint"; | 45 case DRAW_PAINT: return "Draw Paint"; |
44 case DRAW_PATH: return "Draw Path"; | 46 case DRAW_PATH: return "Draw Path"; |
45 case DRAW_PICTURE: return "Draw Picture"; | 47 case DRAW_PICTURE: return "Draw Picture"; |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 fDy = dy; | 892 fDy = dy; |
891 fDrawType = TRANSLATE; | 893 fDrawType = TRANSLATE; |
892 | 894 |
893 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); | 895 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); |
894 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); | 896 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); |
895 } | 897 } |
896 | 898 |
897 void SkTranslateCommand::execute(SkCanvas* canvas) { | 899 void SkTranslateCommand::execute(SkCanvas* canvas) { |
898 canvas->translate(fDx, fDy); | 900 canvas->translate(fDx, fDy); |
899 } | 901 } |
| 902 |
| 903 SkPushCullCommand::SkPushCullCommand(const SkRect& cullRect) |
| 904 : fCullRect(cullRect) { |
| 905 fDrawType = PUSH_CULL; |
| 906 fInfo.push(SkObjectParser::RectToString(cullRect)); |
| 907 } |
| 908 |
| 909 void SkPushCullCommand::execute(SkCanvas* canvas) { |
| 910 //FIXME: add visualization overlay. |
| 911 canvas->pushCull(fCullRect); |
| 912 } |
| 913 |
| 914 SkPopCullCommand::SkPopCullCommand() { |
| 915 fDrawType = POP_CULL; |
| 916 } |
| 917 |
| 918 void SkPopCullCommand::execute(SkCanvas* canvas) { |
| 919 canvas->popCull(); |
| 920 } |
OLD | NEW |