aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrInOrderDrawBuffer.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-02-17 09:14:33 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-17 09:14:33 -0800
commite5e72f1fbfa02522f30762d7d8ad07a6f9add5d9 (patch)
tree221f9b82689cd7b591d295c294055169762503c6 /src/gpu/GrInOrderDrawBuffer.h
parent50da1d8c3b3799ce22b09c83443b476b12a9af8f (diff)
Improve GrInOrderDrawBuffer::Cmd encapsulation
In preparation for moving all the Cmds out of GrInOrderDrawBuffer. Review URL: https://codereview.chromium.org/931673002
Diffstat (limited to 'src/gpu/GrInOrderDrawBuffer.h')
-rw-r--r--src/gpu/GrInOrderDrawBuffer.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index 333150a7ab..286c545eed 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;
};