Chromium Code Reviews| Index: src/gpu/GrInOrderDrawBuffer.h |
| diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h |
| index 60e01f01b970b802c2f819b1eb61661a7c0fd670..90876564f7b1e85ff5bf47d4e8119c4e4cb9d571 100644 |
| --- a/src/gpu/GrInOrderDrawBuffer.h |
| +++ b/src/gpu/GrInOrderDrawBuffer.h |
| @@ -81,13 +81,13 @@ protected: |
| private: |
| enum Cmd { |
| - kDraw_Cmd = 1, |
| - kStencilPath_Cmd = 2, |
| - kSetState_Cmd = 3, |
| - kSetClip_Cmd = 4, |
| - kClear_Cmd = 5, |
| - kCopySurface_Cmd = 6, |
| - kDrawPath_Cmd = 7, |
| + kDraw_Cmd = 1, |
| + kStencilPath_Cmd = 2, |
| + kSetState_Cmd = 3, |
| + kSetClip_Cmd = 4, |
| + kClear_Cmd = 5, |
| + kCopySurface_Cmd = 6, |
| + kDrawPath_Cmd = 7, |
| }; |
| class DrawRecord : public DrawInfo { |
| @@ -168,10 +168,8 @@ private: |
| bool quickInsideClip(const SkRect& devBounds); |
| - virtual void onInstantGpuTraceEvent(const char* marker) SK_OVERRIDE; |
| - virtual void onPushGpuTraceEvent(const char* marker) SK_OVERRIDE; |
| - virtual void onPopGpuTraceEvent() SK_OVERRIDE; |
| - |
| + virtual void onAddGpuTraceMarker() SK_OVERRIDE {}; |
| + virtual void onRemoveGpuTraceMarker() SK_OVERRIDE {}; |
| // Attempts to concat instances from info onto the previous draw. info must represent an |
| // instanced draw. The caller must have already recorded a new draw state and clip if necessary. |
| @@ -183,13 +181,16 @@ private: |
| bool needsNewClip() const; |
| // these functions record a command |
| - void recordState(); |
| - void recordClip(); |
| - DrawRecord* recordDraw(const DrawInfo&); |
| - StencilPath* recordStencilPath(); |
| - DrawPath* recordDrawPath(); |
| - Clear* recordClear(); |
| - CopySurface* recordCopySurface(); |
| + void recordState(); |
| + void recordClip(); |
| + DrawRecord* recordDraw(const DrawInfo&); |
| + StencilPath* recordStencilPath(); |
| + DrawPath* recordDrawPath(); |
| + Clear* recordClear(); |
| + CopySurface* recordCopySurface(); |
| + |
| + // get name out of trace set |
| + const char* getCurrentTraceMarker(); |
| // TODO: Use a single allocator for commands and records |
| enum { |
| @@ -213,6 +214,8 @@ private: |
| GrSTAllocator<kCopySurfacePreallocCnt, CopySurface> fCopySurfaces; |
| GrSTAllocator<kClipPreallocCnt, SkClipStack> fClips; |
| GrSTAllocator<kClipPreallocCnt, SkIPoint> fClipOrigins; |
| + SkTDArray<GpuTraceMarker> fGpuCmdMarkers; |
| + SkTDArray<int> fNumMarkersPerCmd; |
| GrDrawTarget* fDstGpu; |
| @@ -245,6 +248,16 @@ private: |
| virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; } |
| + void addToCmdBuffer(uint8_t cmd); |
| + |
| + inline uint8_t addTraceBit(uint8_t cmd) { |
| + return cmd | 0x08; |
|
bsalomon
2014/03/17 17:50:38
Can we put these in an enum?
e.g.
enum {
kTra
egdaniel
2014/03/17 19:49:12
yes!
On 2014/03/17 17:50:38, bsalomon wrote:
|
| + } |
| + |
| + inline uint8_t stripTraceBit(uint8_t cmd) { |
| + return cmd & 0x07; |
|
bsalomon
2014/03/17 17:50:38
7f?
egdaniel
2014/03/17 19:49:12
Currently the commands we use only go to 7 so I ju
bsalomon
2014/03/19 13:28:44
Yeah, I think it is safer to use 7f. If someone up
egdaniel
2014/03/19 14:27:03
Assert has been added in the newest version
On 20
|
| + } |
| + |
| bool fFlushing; |
| uint32_t fDrawID; |