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 14 matching lines...) Expand all Loading... | |
25 fInfo.deleteAll(); | 25 fInfo.deleteAll(); |
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"; |
robertphillips
2014/02/25 15:58:41
order?
f(malita)
2014/02/25 16:50:28
Will do.
| |
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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
929 fDy = dy; | 931 fDy = dy; |
930 fDrawType = TRANSLATE; | 932 fDrawType = TRANSLATE; |
931 | 933 |
932 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); | 934 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); |
933 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); | 935 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); |
934 } | 936 } |
935 | 937 |
936 void SkTranslateCommand::execute(SkCanvas* canvas) { | 938 void SkTranslateCommand::execute(SkCanvas* canvas) { |
937 canvas->translate(fDx, fDy); | 939 canvas->translate(fDx, fDy); |
938 } | 940 } |
941 | |
942 SkPushCullCommand::SkPushCullCommand(const SkRect& cullRect) | |
943 : fCullRect(cullRect) { | |
944 fDrawType = PUSH_CULL; | |
945 fInfo.push(SkObjectParser::RectToString(cullRect)); | |
946 } | |
947 | |
948 void SkPushCullCommand::execute(SkCanvas* canvas) { | |
949 //FIXME: add visualization overlay. | |
950 canvas->pushCull(fCullRect); | |
951 } | |
952 | |
953 SkPopCullCommand::SkPopCullCommand() { | |
954 fDrawType = POP_CULL; | |
955 } | |
956 | |
957 void SkPopCullCommand::execute(SkCanvas* canvas) { | |
958 canvas->popCull(); | |
959 } | |
OLD | NEW |