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

Side by Side Diff: src/utils/debugger/SkDrawCommand.cpp

Issue 249253003: Hide SaveFlags from the public SkCanvas API. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Suppress the canvas-state GM. Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | src/utils/debugger/SkObjectParser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 : INHERITED(ROTATE) { 833 : INHERITED(ROTATE) {
834 fDegrees = degrees; 834 fDegrees = degrees;
835 835
836 fInfo.push(SkObjectParser::ScalarToString(degrees, "SkScalar degrees: ")); 836 fInfo.push(SkObjectParser::ScalarToString(degrees, "SkScalar degrees: "));
837 } 837 }
838 838
839 void SkRotateCommand::execute(SkCanvas* canvas) { 839 void SkRotateCommand::execute(SkCanvas* canvas) {
840 canvas->rotate(fDegrees); 840 canvas->rotate(fDegrees);
841 } 841 }
842 842
843 SkSaveCommand::SkSaveCommand(SkCanvas::SaveFlags flags) 843 SkSaveCommand::SkSaveCommand(unsigned flags)
844 : INHERITED(SAVE) { 844 : INHERITED(SAVE) {
845 fFlags = flags; 845 fFlags = flags;
846 fInfo.push(SkObjectParser::SaveFlagsToString(flags)); 846 fInfo.push(SkObjectParser::SaveFlagsToString(flags));
847 } 847 }
848 848
849 void SkSaveCommand::execute(SkCanvas* canvas) { 849 void SkSaveCommand::execute(SkCanvas* canvas) {
850 canvas->save(fFlags); 850 canvas->save(
851 #ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
852 (SkCanvas::SaveFlags)fFlags
853 #endif
854 );
851 } 855 }
852 856
853 void SkSaveCommand::trackSaveState(int* state) { 857 void SkSaveCommand::trackSaveState(int* state) {
854 (*state)++; 858 (*state)++;
855 } 859 }
856 860
857 SkSaveLayerCommand::SkSaveLayerCommand(const SkRect* bounds, const SkPaint* pain t, 861 SkSaveLayerCommand::SkSaveLayerCommand(const SkRect* bounds, const SkPaint* pain t,
858 SkCanvas::SaveFlags flags) 862 unsigned flags)
859 : INHERITED(SAVE_LAYER) { 863 : INHERITED(SAVE_LAYER) {
860 if (NULL != bounds) { 864 if (NULL != bounds) {
861 fBounds = *bounds; 865 fBounds = *bounds;
862 } else { 866 } else {
863 fBounds.setEmpty(); 867 fBounds.setEmpty();
864 } 868 }
865 869
866 if (NULL != paint) { 870 if (NULL != paint) {
867 fPaint = *paint; 871 fPaint = *paint;
868 fPaintPtr = &fPaint; 872 fPaintPtr = &fPaint;
869 } else { 873 } else {
870 fPaintPtr = NULL; 874 fPaintPtr = NULL;
871 } 875 }
872 fFlags = flags; 876 fFlags = flags;
873 877
874 if (NULL != bounds) { 878 if (NULL != bounds) {
875 fInfo.push(SkObjectParser::RectToString(*bounds, "Bounds: ")); 879 fInfo.push(SkObjectParser::RectToString(*bounds, "Bounds: "));
876 } 880 }
877 if (NULL != paint) { 881 if (NULL != paint) {
878 fInfo.push(SkObjectParser::PaintToString(*paint)); 882 fInfo.push(SkObjectParser::PaintToString(*paint));
879 } 883 }
880 fInfo.push(SkObjectParser::SaveFlagsToString(flags)); 884 fInfo.push(SkObjectParser::SaveFlagsToString(flags));
881 } 885 }
882 886
883 void SkSaveLayerCommand::execute(SkCanvas* canvas) { 887 void SkSaveLayerCommand::execute(SkCanvas* canvas) {
884 canvas->saveLayer(fBounds.isEmpty() ? NULL : &fBounds, 888 canvas->saveLayer(fBounds.isEmpty() ? NULL : &fBounds,
885 fPaintPtr, 889 fPaintPtr
886 fFlags); 890 #ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
891 , (SkCanvas::SaveFlags)fFlags
892 #endif
893 );
887 } 894 }
888 895
889 void SkSaveLayerCommand::vizExecute(SkCanvas* canvas) { 896 void SkSaveLayerCommand::vizExecute(SkCanvas* canvas) {
890 canvas->save(); 897 canvas->save();
891 } 898 }
892 899
893 void SkSaveLayerCommand::trackSaveState(int* state) { 900 void SkSaveLayerCommand::trackSaveState(int* state) {
894 (*state)++; 901 (*state)++;
895 } 902 }
896 903
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 p.setColor(SK_ColorCYAN); 968 p.setColor(SK_ColorCYAN);
962 p.setStyle(SkPaint::kStroke_Style); 969 p.setStyle(SkPaint::kStroke_Style);
963 canvas->drawRect(fCullRect, p); 970 canvas->drawRect(fCullRect, p);
964 } 971 }
965 972
966 SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { } 973 SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { }
967 974
968 void SkPopCullCommand::execute(SkCanvas* canvas) { 975 void SkPopCullCommand::execute(SkCanvas* canvas) {
969 canvas->popCull(); 976 canvas->popCull();
970 } 977 }
OLDNEW
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | src/utils/debugger/SkObjectParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698