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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 } | 878 } |
879 fInfo.push(SkObjectParser::SaveFlagsToString(flags)); | 879 fInfo.push(SkObjectParser::SaveFlagsToString(flags)); |
880 } | 880 } |
881 | 881 |
882 void SkSaveLayerCommand::execute(SkCanvas* canvas) { | 882 void SkSaveLayerCommand::execute(SkCanvas* canvas) { |
883 canvas->saveLayer(fBounds.isEmpty() ? NULL : &fBounds, | 883 canvas->saveLayer(fBounds.isEmpty() ? NULL : &fBounds, |
884 fPaintPtr, | 884 fPaintPtr, |
885 fFlags); | 885 fFlags); |
886 } | 886 } |
887 | 887 |
| 888 void SkSaveLayerCommand::vizExecute(SkCanvas* canvas) { |
| 889 canvas->save(); |
| 890 } |
| 891 |
888 void SkSaveLayerCommand::trackSaveState(int* state) { | 892 void SkSaveLayerCommand::trackSaveState(int* state) { |
889 (*state)++; | 893 (*state)++; |
890 } | 894 } |
891 | 895 |
892 SkScaleCommand::SkScaleCommand(SkScalar sx, SkScalar sy) { | 896 SkScaleCommand::SkScaleCommand(SkScalar sx, SkScalar sy) { |
893 fSx = sx; | 897 fSx = sx; |
894 fSy = sy; | 898 fSy = sy; |
895 fDrawType = SCALE; | 899 fDrawType = SCALE; |
896 | 900 |
897 fInfo.push(SkObjectParser::ScalarToString(sx, "SkScalar sx: ")); | 901 fInfo.push(SkObjectParser::ScalarToString(sx, "SkScalar sx: ")); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 canvas->translate(fDx, fDy); | 943 canvas->translate(fDx, fDy); |
940 } | 944 } |
941 | 945 |
942 SkPushCullCommand::SkPushCullCommand(const SkRect& cullRect) | 946 SkPushCullCommand::SkPushCullCommand(const SkRect& cullRect) |
943 : fCullRect(cullRect) { | 947 : fCullRect(cullRect) { |
944 fDrawType = PUSH_CULL; | 948 fDrawType = PUSH_CULL; |
945 fInfo.push(SkObjectParser::RectToString(cullRect)); | 949 fInfo.push(SkObjectParser::RectToString(cullRect)); |
946 } | 950 } |
947 | 951 |
948 void SkPushCullCommand::execute(SkCanvas* canvas) { | 952 void SkPushCullCommand::execute(SkCanvas* canvas) { |
949 //FIXME: add visualization overlay. | |
950 canvas->pushCull(fCullRect); | 953 canvas->pushCull(fCullRect); |
951 } | 954 } |
952 | 955 |
| 956 void SkPushCullCommand::vizExecute(SkCanvas* canvas) { |
| 957 canvas->pushCull(fCullRect); |
| 958 |
| 959 SkPaint p; |
| 960 p.setColor(SK_ColorCYAN); |
| 961 p.setStyle(SkPaint::kStroke_Style); |
| 962 canvas->drawRect(fCullRect, p); |
| 963 } |
| 964 |
953 SkPopCullCommand::SkPopCullCommand() { | 965 SkPopCullCommand::SkPopCullCommand() { |
954 fDrawType = POP_CULL; | 966 fDrawType = POP_CULL; |
955 } | 967 } |
956 | 968 |
957 void SkPopCullCommand::execute(SkCanvas* canvas) { | 969 void SkPopCullCommand::execute(SkCanvas* canvas) { |
958 canvas->popCull(); | 970 canvas->popCull(); |
959 } | 971 } |
OLD | NEW |