Chromium Code Reviews| Index: src/gpu/GrInOrderDrawBuffer.h |
| diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h |
| index ed62a93247bb2c63bf0a5b79c233515fe02a26e0..6fb662e9ab1bba3c0bd21a8a76389e778be18f06 100644 |
| --- a/src/gpu/GrInOrderDrawBuffer.h |
| +++ b/src/gpu/GrInOrderDrawBuffer.h |
| @@ -11,7 +11,9 @@ |
| #include "GrDrawTarget.h" |
| #include "GrAllocPool.h" |
| #include "GrAllocator.h" |
| +#include "GrGpu.h" |
| #include "GrIndexBuffer.h" |
| +#include "GrOptDrawState.h" |
| #include "GrRenderTarget.h" |
| #include "GrPath.h" |
| #include "GrPathRange.h" |
| @@ -23,7 +25,6 @@ |
| #include "SkTemplates.h" |
| #include "SkTypes.h" |
| -class GrGpu; |
| class GrIndexBufferAllocPool; |
| class GrVertexBufferAllocPool; |
| @@ -110,7 +111,7 @@ private: |
| Cmd(uint8_t type) : fType(type) {} |
| virtual ~Cmd() {} |
| - virtual void execute(GrGpu*) = 0; |
| + virtual void execute(GrGpu*, const GrOptDrawState*) = 0; |
| uint8_t fType; |
| }; |
| @@ -129,7 +130,7 @@ private: |
| const GrVertexBuffer* vertexBuffer() const { return fVertexBuffer.get(); } |
| const GrIndexBuffer* indexBuffer() const { return fIndexBuffer.get(); } |
| - virtual void execute(GrGpu*); |
| + virtual void execute(GrGpu*, const GrOptDrawState*); |
| DrawInfo fInfo; |
| ScissorState fScissorState; |
| @@ -144,7 +145,7 @@ private: |
| const GrPath* path() const { return fPath.get(); } |
| - virtual void execute(GrGpu*); |
| + virtual void execute(GrGpu*, const GrOptDrawState*); |
| ScissorState fScissorState; |
| GrStencilSettings fStencilSettings; |
| @@ -158,7 +159,7 @@ private: |
| const GrPath* path() const { return fPath.get(); } |
| - virtual void execute(GrGpu*); |
| + virtual void execute(GrGpu*, const GrOptDrawState*); |
| GrDeviceCoordTexture fDstCopy; |
| ScissorState fScissorState; |
| @@ -175,7 +176,7 @@ private: |
| uint32_t* indices() { return reinterpret_cast<uint32_t*>(CmdBuffer::GetDataForItem(this)); } |
| float* transforms() { return reinterpret_cast<float*>(&this->indices()[fCount]); } |
| - virtual void execute(GrGpu*); |
| + virtual void execute(GrGpu*, const GrOptDrawState*); |
| size_t fCount; |
| PathTransformType fTransformsType; |
| @@ -193,7 +194,7 @@ private: |
| GrRenderTarget* renderTarget() const { return fRenderTarget.get(); } |
| - virtual void execute(GrGpu*); |
| + virtual void execute(GrGpu*, const GrOptDrawState*); |
| SkIRect fRect; |
| GrColor fColor; |
| @@ -209,7 +210,7 @@ private: |
| GrRenderTarget* renderTarget() const { return fRenderTarget.get(); } |
| - virtual void execute(GrGpu*); |
| + virtual void execute(GrGpu*, const GrOptDrawState*); |
| SkIRect fRect; |
| bool fInsideClip; |
| @@ -224,7 +225,7 @@ private: |
| GrSurface* dst() const { return fDst.get(); } |
| GrSurface* src() const { return fSrc.get(); } |
| - virtual void execute(GrGpu*); |
| + virtual void execute(GrGpu*, const GrOptDrawState*); |
| SkIPoint fDstPoint; |
| SkIRect fSrcRect; |
| @@ -237,9 +238,11 @@ private: |
| struct SetState : public Cmd { |
| SetState(const GrDrawState& state) : Cmd(kSetState_Cmd), fState(state) {} |
| - virtual void execute(GrGpu*); |
| + virtual void execute(GrGpu*, const GrOptDrawState*); |
| GrDrawState fState; |
| + GrGpu::DrawType fDrawType; |
| + GrDeviceCoordTexture fDstCopy; |
| }; |
| typedef void* TCmdAlign; // This wouldn't be enough align if a command used long double. |
| @@ -288,7 +291,7 @@ private: |
| int concatInstancedDraw(const DrawInfo& info, const GrClipMaskManager::ScissorState&); |
| // Determines whether the current draw operation requieres a new drawstate and if so records it. |
| - void recordStateIfNecessary(); |
| + void recordStateIfNecessary(GrGpu::DrawType, const GrDeviceCoordTexture*); |
| // We lazily record clip changes in order to skip clips that have no effect. |
| void recordClipIfNecessary(); |
| // Records any trace markers for a command after adding it to the buffer. |
| @@ -302,12 +305,13 @@ private: |
| kGeoPoolStatePreAllocCnt = 4, |
| }; |
| - CmdBuffer fCmdBuffer; |
| - GrDrawState* fLastState; |
| - SkTArray<GrTraceMarkerSet, false> fGpuCmdMarkers; |
| - GrGpu* fDstGpu; |
| - GrVertexBufferAllocPool& fVertexPool; |
| - GrIndexBufferAllocPool& fIndexPool; |
| + CmdBuffer fCmdBuffer; |
| + GrDrawState* fLastState; |
| + SkAutoTUnref<const GrOptDrawState> fCurrentOptDrawState; |
|
bsalomon
2014/11/10 16:06:15
Looks like this guy doesn't need to be a member. I
joshualitt
2014/11/10 16:27:18
But is it possible for some state setting to cross
bsalomon
2014/11/10 16:36:02
flush is destructive of the recorded data. Newly r
|
| + SkTArray<GrTraceMarkerSet, false> fGpuCmdMarkers; |
| + GrGpu* fDstGpu; |
| + GrVertexBufferAllocPool& fVertexPool; |
| + GrIndexBufferAllocPool& fIndexPool; |
| struct GeometryPoolState { |
| const GrVertexBuffer* fPoolVertexBuffer; |