Index: src/gpu/GrInOrderDrawBuffer.h |
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h |
index 333150a7ab3962ffb13911bf0617926aae9ddff9..286c545eedde47dfb9f3199f6b55ac2fcdc31576 100644 |
--- a/src/gpu/GrInOrderDrawBuffer.h |
+++ b/src/gpu/GrInOrderDrawBuffer.h |
@@ -60,25 +60,35 @@ protected: |
private: |
typedef GrGpu::DrawArgs DrawArgs; |
- enum { |
- kDraw_Cmd = 1, |
- kStencilPath_Cmd = 2, |
- kSetState_Cmd = 3, |
- kClear_Cmd = 4, |
- kCopySurface_Cmd = 5, |
- kDrawPath_Cmd = 6, |
- kDrawPaths_Cmd = 7, |
- kDrawBatch_Cmd = 8, |
- }; |
struct SetState; |
struct Cmd : ::SkNoncopyable { |
+ enum { |
+ kDraw_Cmd = 1, |
+ kStencilPath_Cmd = 2, |
+ kSetState_Cmd = 3, |
+ kClear_Cmd = 4, |
+ kCopySurface_Cmd = 5, |
+ kDrawPath_Cmd = 6, |
+ kDrawPaths_Cmd = 7, |
+ kDrawBatch_Cmd = 8, |
+ }; |
+ |
Cmd(uint8_t type) : fType(type) {} |
virtual ~Cmd() {} |
virtual void execute(GrInOrderDrawBuffer*, const SetState*) = 0; |
+ uint8_t type() const { return fType & kCmdMask; } |
+ |
+ bool isTraced() const { return SkToBool(fType & kTraceCmdBit); } |
+ void makeTraced() { fType |= kTraceCmdBit; } |
+ |
+ private: |
+ static const int kCmdMask = 0x7F; |
+ static const int kTraceCmdBit = 0x80; |
+ |
uint8_t fType; |
}; |