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

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

Issue 138013009: Culling API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rebased, fCullOffsetStack decl -> unconditional 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
« src/core/SkPictureRecord.cpp ('K') | « 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..3f3860970bb8e676fa699541b3ada545dd2c2791 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -33,6 +33,8 @@ const char* SkDrawCommand::GetCommandString(DrawType type) {
case CLIP_REGION: return "Clip Region";
case CLIP_RECT: return "Clip Rect";
case CLIP_RRECT: return "Clip RRect";
robertphillips 2014/02/25 15:58:41 order?
f(malita) 2014/02/25 16:50:28 Will do.
+ case PUSH_CULL: return "PushCull";
+ case POP_CULL: return "PopCull";
case CONCAT: return "Concat";
case DRAW_BITMAP: return "Draw Bitmap";
case DRAW_BITMAP_MATRIX: return "Draw Bitmap Matrix";
@@ -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();
+}
« src/core/SkPictureRecord.cpp ('K') | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698