Chromium Code Reviews| Index: src/gpu/GrInOrderDrawBuffer.h |
| diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h |
| index f271207abcf002c7ab0004e5dbbebf1fdb1cb9ef..2105a1145fdef13a71c12e4b95464e6e7b32b0fb 100644 |
| --- a/src/gpu/GrInOrderDrawBuffer.h |
| +++ b/src/gpu/GrInOrderDrawBuffer.h |
| @@ -188,28 +188,27 @@ private: |
| // TODO: rename to SetPipeline once pp, batch tracker, and desc are removed |
| struct SetState : public Cmd { |
| - // TODO get rid of the prim proc version of this when we use batch everywhere |
| - SetState(const GrPipelineBuilder& pipelineBuilder, const GrPrimitiveProcessor* primProc, |
| - const GrDrawTargetCaps& caps, |
| - const GrScissorState& scissor, const GrDeviceCoordTexture* dstCopy) |
| + // TODO get rid of the prim proc parameter when we use batch everywhere |
| + SetState(const GrPrimitiveProcessor* primProc = NULL) |
| : Cmd(kSetState_Cmd) |
| - , fPrimitiveProcessor(primProc) |
| - , fPipeline(pipelineBuilder, primProc, caps, scissor, dstCopy) {} |
| + , fPrimitiveProcessor(primProc) {} |
| - SetState(GrBatch* batch, |
| - const GrPipelineBuilder& pipelineBuilder, |
| - const GrDrawTargetCaps& caps, |
| - const GrScissorState& scissor, const GrDeviceCoordTexture* dstCopy) |
| - : Cmd(kSetState_Cmd) |
| - , fPipeline(batch, pipelineBuilder, caps, scissor, dstCopy) {} |
| + ~SetState() { |
|
bsalomon
2015/02/12 21:39:26
one line?
|
| + reinterpret_cast<GrPipeline*>(fPipeline.get())->~GrPipeline(); |
| + } |
| + |
| + GrPipeline* getPipeline() { return reinterpret_cast<GrPipeline*>(fPipeline.get()); } |
|
bsalomon
2015/02/12 21:39:26
pipelineLocation()? comment that this is just for
|
| + const GrPipeline* getPipeline() const { |
| + return reinterpret_cast<const GrPipeline*>(fPipeline.get()); |
| + } |
| void execute(GrInOrderDrawBuffer*, const SetState*) SK_OVERRIDE; |
| typedef GrPendingProgramElement<const GrPrimitiveProcessor> ProgramPrimitiveProcessor; |
| - ProgramPrimitiveProcessor fPrimitiveProcessor; |
| - const GrPipeline fPipeline; |
| - GrProgramDesc fDesc; |
| - GrBatchTracker fBatchTracker; |
| + ProgramPrimitiveProcessor fPrimitiveProcessor; |
| + SkAlignedSStorage<sizeof(GrPipeline)> fPipeline; |
| + GrProgramDesc fDesc; |
| + GrBatchTracker fBatchTracker; |
| }; |
| struct DrawBatch : public Cmd { |
| @@ -230,14 +229,11 @@ private: |
| void onFlush() SK_OVERRIDE; |
| // overrides from GrDrawTarget |
| - void onDraw(const GrPipelineBuilder&, |
| - const GrGeometryProcessor*, |
| + void onDraw(const GrGeometryProcessor*, |
|
bsalomon
2015/02/12 21:39:26
one line?
|
| const DrawInfo&, |
| - const GrScissorState&) SK_OVERRIDE; |
| + const PipelineInfo&) SK_OVERRIDE; |
| void onDrawBatch(GrBatch*, |
| - const GrPipelineBuilder&, |
| - const GrScissorState&, |
| - const SkRect* devBounds) SK_OVERRIDE; |
| + const PipelineInfo&) SK_OVERRIDE; |
| void onDrawRect(GrPipelineBuilder*, |
| GrColor, |
| const SkMatrix& viewMatrix, |
| @@ -250,23 +246,19 @@ private: |
| const GrPath*, |
| const GrScissorState&, |
| const GrStencilSettings&) SK_OVERRIDE; |
| - void onDrawPath(const GrPipelineBuilder&, |
| - const GrPathProcessor*, |
| + void onDrawPath(const GrPathProcessor*, |
| const GrPath*, |
| - const GrScissorState&, |
| const GrStencilSettings&, |
| - const SkRect* devBounds) SK_OVERRIDE; |
| - void onDrawPaths(const GrPipelineBuilder&, |
| - const GrPathProcessor*, |
| + const PipelineInfo&) SK_OVERRIDE; |
| + void onDrawPaths(const GrPathProcessor*, |
| const GrPathRange*, |
| const void* indices, |
| PathIndexType, |
| const float transformValues[], |
| PathTransformType, |
| int count, |
| - const GrScissorState&, |
| const GrStencilSettings&, |
| - const SkRect* devBounds) SK_OVERRIDE; |
| + const PipelineInfo&) SK_OVERRIDE; |
| void onClear(const SkIRect* rect, |
| GrColor color, |
| bool canIgnoreRect, |
| @@ -278,20 +270,15 @@ private: |
| // 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. |
| - int concatInstancedDraw(const GrPipelineBuilder&, const DrawInfo&); |
| + int concatInstancedDraw(const DrawInfo&); |
| // Determines whether the current draw operation requires a new GrPipeline and if so |
| // records it. If the draw can be skipped false is returned and no new GrPipeline is |
| // recorded. |
| // TODO delete the primproc variant when we have batches everywhere |
| - bool SK_WARN_UNUSED_RESULT recordStateAndShouldDraw(const GrPipelineBuilder&, |
| - const GrPrimitiveProcessor*, |
| - const GrScissorState&, |
| - const SkRect*); |
| - bool SK_WARN_UNUSED_RESULT recordStateAndShouldDraw(GrBatch*, |
| - const GrPipelineBuilder&, |
| - const GrScissorState&, |
| - const SkRect*); |
| + bool SK_WARN_UNUSED_RESULT setupPipelineAndShouldDraw(const GrPrimitiveProcessor*, |
| + const PipelineInfo&); |
| + bool SK_WARN_UNUSED_RESULT setupPipelineAndShouldDraw(GrBatch*, const PipelineInfo&); |
| // We lazily record clip changes in order to skip clips that have no effect. |
| void recordClipIfNecessary(); |