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

Unified Diff: src/gpu/GrInOrderDrawBuffer.h

Issue 931673002: Improve GrInOrderDrawBuffer::Cmd encapsulation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « no previous file | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698