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

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

Issue 794263002: Cull pushCull and popCull from Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix debugger Created 6 years 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
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | tests/RecordPatternTest.cpp » ('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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | tests/RecordPatternTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698