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

Unified Diff: src/utils/debugger/SkDrawCommand.cpp

Issue 138013009: Culling API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Updated per comments. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkDrawCommand.cpp
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index 4e410d1cfe2b3e8a12b74c2afcb7dc72b23e7f86..16b8556d575c8ac8735a9110d63ac43921b83368 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -65,6 +65,8 @@ const char* SkDrawCommand::GetCommandString(DrawType type) {
case COMMENT: return "Comment";
case END_COMMENT_GROUP: return "EndCommentGroup";
case DRAW_DRRECT: return "Draw DRRect";
+ case PUSH_CULL: return "PushCull";
+ case POP_CULL: return "PopCull";
default:
SkDebugf("DrawType error 0x%08x\n", type);
SkASSERT(0);
@@ -936,3 +938,22 @@ SkTranslateCommand::SkTranslateCommand(SkScalar dx, SkScalar dy) {
void SkTranslateCommand::execute(SkCanvas* canvas) {
canvas->translate(fDx, fDy);
}
+
+SkPushCullCommand::SkPushCullCommand(const SkRect& cullRect)
+ : fCullRect(cullRect) {
+ fDrawType = PUSH_CULL;
+ fInfo.push(SkObjectParser::RectToString(cullRect));
+}
+
+void SkPushCullCommand::execute(SkCanvas* canvas) {
+ //FIXME: add visualization overlay.
+ canvas->pushCull(fCullRect);
+}
+
+SkPopCullCommand::SkPopCullCommand() {
+ fDrawType = POP_CULL;
+}
+
+void SkPopCullCommand::execute(SkCanvas* canvas) {
+ canvas->popCull();
+}
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698