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

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

Issue 185293007: Add visualization of clips to debugger (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: 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/SkDebugCanvas.cpp ('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.h
===================================================================
--- src/utils/debugger/SkDrawCommand.h (revision 13635)
+++ src/utils/debugger/SkDrawCommand.h (working copy)
@@ -38,8 +38,24 @@
SkTDArray<SkString*>* Info() {return &fInfo; };
virtual void execute(SkCanvas* canvas)=0;
/** Does nothing by default, but used by save() and restore()-type
- subclassse to track unresolved save() calls. */
+ subclasses to track unresolved save() calls. */
virtual void trackSaveState(int* state) { };
+
+ // The next "active" system is only used by save, saveLayer and restore.
+ // It is used to determine which saveLayers are currently active (at a
+ // given point in the rendering).
+ // save just return a kPush action but don't track active state
+ // restore just return a kPop action
+ // saveLayers return kPush but also track the active state
+ enum Action {
+ kNone_Action,
+ kPop_Action,
+ kPush_Action
+ };
+ virtual Action action() const { return kNone_Action; }
+ virtual void setActive(bool active) {}
+ virtual bool active() const { return false; }
+
DrawType getType() { return fDrawType; };
virtual bool render(SkCanvas* canvas) const { return false; }
@@ -59,6 +75,7 @@
SkRestoreCommand();
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
virtual void trackSaveState(int* state) SK_OVERRIDE;
+ virtual Action action() const SK_OVERRIDE { return kPop_Action; }
private:
typedef SkDrawCommand INHERITED;
@@ -496,6 +513,7 @@
SkSaveCommand(SkCanvas::SaveFlags flags);
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
virtual void trackSaveState(int* state) SK_OVERRIDE;
+ virtual Action action() const SK_OVERRIDE { return kPush_Action; }
private:
SkCanvas::SaveFlags fFlags;
@@ -508,6 +526,9 @@
SkCanvas::SaveFlags flags);
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
virtual void trackSaveState(int* state) SK_OVERRIDE;
+ virtual Action action() const SK_OVERRIDE{ return kPush_Action; }
+ virtual void setActive(bool active) SK_OVERRIDE { fActive = active; }
+ virtual bool active() const SK_OVERRIDE { return fActive; }
const SkPaint* paint() const { return fPaintPtr; }
@@ -517,6 +538,8 @@
SkPaint* fPaintPtr;
SkCanvas::SaveFlags fFlags;
+ bool fActive;
+
typedef SkDrawCommand INHERITED;
};
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698