Index: src/gpu/GrInOrderCommandBuilder.cpp |
diff --git a/src/gpu/GrCommandBuilder.cpp b/src/gpu/GrInOrderCommandBuilder.cpp |
similarity index 51% |
copy from src/gpu/GrCommandBuilder.cpp |
copy to src/gpu/GrInOrderCommandBuilder.cpp |
index aafc3455b206a7c38016eb07efe4e0d79e6173f2..e56607b570742039bcade3c9b48288fb7001225f 100644 |
--- a/src/gpu/GrCommandBuilder.cpp |
+++ b/src/gpu/GrInOrderCommandBuilder.cpp |
@@ -5,7 +5,7 @@ |
* found in the LICENSE file. |
*/ |
-#include "GrCommandBuilder.h" |
+#include "GrInOrderCommandBuilder.h" |
#include "GrColor.h" |
#include "GrInOrderDrawBuffer.h" |
@@ -25,7 +25,7 @@ static bool path_fill_type_is_winding(const GrStencilSettings& pathStencilSettin |
return isWinding; |
} |
-GrTargetCommands::Cmd* GrCommandBuilder::recordDrawBatch(State* state, GrBatch* batch) { |
+GrTargetCommands::Cmd* GrInOrderCommandBuilder::recordDrawBatch(State* state, GrBatch* batch) { |
// Check if there is a Batch Draw we can batch with |
if (!this->cmdBuffer()->empty() && |
Cmd::kDrawBatch_CmdType == this->cmdBuffer()->back().type()) { |
@@ -40,11 +40,11 @@ GrTargetCommands::Cmd* GrCommandBuilder::recordDrawBatch(State* state, GrBatch* |
} |
GrTargetCommands::Cmd* |
-GrCommandBuilder::recordStencilPath(const GrPipelineBuilder& pipelineBuilder, |
- const GrPathProcessor* pathProc, |
- const GrPath* path, |
- const GrScissorState& scissorState, |
- const GrStencilSettings& stencilSettings) { |
+GrInOrderCommandBuilder::recordStencilPath(const GrPipelineBuilder& pipelineBuilder, |
+ const GrPathProcessor* pathProc, |
+ const GrPath* path, |
+ const GrScissorState& scissorState, |
+ const GrStencilSettings& stencilSettings) { |
StencilPath* sp = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), StencilPath, |
(path, pipelineBuilder.getRenderTarget())); |
@@ -56,27 +56,27 @@ GrCommandBuilder::recordStencilPath(const GrPipelineBuilder& pipelineBuilder, |
} |
GrTargetCommands::Cmd* |
-GrCommandBuilder::recordDrawPath(State* state, |
- const GrPathProcessor* pathProc, |
- const GrPath* path, |
- const GrStencilSettings& stencilSettings) { |
+GrInOrderCommandBuilder::recordDrawPath(State* state, |
+ const GrPathProcessor* pathProc, |
+ const GrPath* path, |
+ const GrStencilSettings& stencilSettings) { |
DrawPath* dp = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), DrawPath, (state, path)); |
dp->fStencilSettings = stencilSettings; |
return dp; |
} |
GrTargetCommands::Cmd* |
-GrCommandBuilder::recordDrawPaths(State* state, |
- GrInOrderDrawBuffer* iodb, |
- const GrPathProcessor* pathProc, |
- const GrPathRange* pathRange, |
- const void* indexValues, |
- GrDrawTarget::PathIndexType indexType, |
- const float transformValues[], |
- GrDrawTarget::PathTransformType transformType, |
- int count, |
- const GrStencilSettings& stencilSettings, |
- const GrDrawTarget::PipelineInfo& pipelineInfo) { |
+GrInOrderCommandBuilder::recordDrawPaths(State* state, |
+ GrInOrderDrawBuffer* iodb, |
+ const GrPathProcessor* pathProc, |
+ const GrPathRange* pathRange, |
+ const void* indexValues, |
+ GrDrawTarget::PathIndexType indexType, |
+ const float transformValues[], |
+ GrDrawTarget::PathTransformType transformType, |
+ int count, |
+ const GrStencilSettings& stencilSettings, |
+ const GrDrawTarget::PipelineInfo& pipelineInfo) { |
SkASSERT(pathRange); |
SkASSERT(indexValues); |
SkASSERT(transformValues); |
@@ -126,72 +126,3 @@ GrCommandBuilder::recordDrawPaths(State* state, |
dp->fStencilSettings = stencilSettings; |
return dp; |
} |
- |
-GrTargetCommands::Cmd* GrCommandBuilder::recordClear(const SkIRect* rect, |
- GrColor color, |
- bool canIgnoreRect, |
- GrRenderTarget* renderTarget) { |
- SkASSERT(renderTarget); |
- |
- SkIRect r; |
- if (NULL == rect) { |
- // We could do something smart and remove previous draws and clears to |
- // the current render target. If we get that smart we have to make sure |
- // those draws aren't read before this clear (render-to-texture). |
- r.setLTRB(0, 0, renderTarget->width(), renderTarget->height()); |
- rect = &r; |
- } |
- Clear* clr = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), Clear, (renderTarget)); |
- GrColorIsPMAssert(color); |
- clr->fColor = color; |
- clr->fRect = *rect; |
- clr->fCanIgnoreRect = canIgnoreRect; |
- return clr; |
-} |
- |
-GrTargetCommands::Cmd* GrCommandBuilder::recordClearStencilClip(const SkIRect& rect, |
- bool insideClip, |
- GrRenderTarget* renderTarget) { |
- SkASSERT(renderTarget); |
- |
- ClearStencilClip* clr = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), |
- ClearStencilClip, |
- (renderTarget)); |
- clr->fRect = rect; |
- clr->fInsideClip = insideClip; |
- return clr; |
-} |
- |
-GrTargetCommands::Cmd* GrCommandBuilder::recordDiscard(GrRenderTarget* renderTarget) { |
- SkASSERT(renderTarget); |
- |
- Clear* clr = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), Clear, (renderTarget)); |
- clr->fColor = GrColor_ILLEGAL; |
- return clr; |
-} |
- |
-GrTargetCommands::Cmd* GrCommandBuilder::recordCopySurface(GrSurface* dst, |
- GrSurface* src, |
- const SkIRect& srcRect, |
- const SkIPoint& dstPoint) { |
- CopySurface* cs = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), CopySurface, (dst, src)); |
- cs->fSrcRect = srcRect; |
- cs->fDstPoint = dstPoint; |
- return cs; |
-} |
- |
-GrTargetCommands::Cmd* |
-GrCommandBuilder::recordXferBarrierIfNecessary(const GrPipeline& pipeline, |
- const GrDrawTargetCaps& caps) { |
- const GrXferProcessor& xp = *pipeline.getXferProcessor(); |
- GrRenderTarget* rt = pipeline.getRenderTarget(); |
- |
- GrXferBarrierType barrierType; |
- if (!xp.willNeedXferBarrier(rt, caps, &barrierType)) { |
- return NULL; |
- } |
- |
- XferBarrier* xb = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), XferBarrier, ()); |
- xb->fBarrierType = barrierType; |
- return xb; |
-} |