Index: src/gpu/GrOptDrawState.cpp |
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp |
index a11100711486490f9b586bc317c3abb4cb6ec050..958a5fdfb134d12ead735824d1e649488bb98fb2 100644 |
--- a/src/gpu/GrOptDrawState.cpp |
+++ b/src/gpu/GrOptDrawState.cpp |
@@ -7,6 +7,7 @@ |
#include "GrOptDrawState.h" |
+#include "GrBatch.h" |
#include "GrDrawState.h" |
#include "GrDrawTargetCaps.h" |
#include "GrGpu.h" |
@@ -21,6 +22,30 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, |
const GrProcOptInfo& colorPOI = drawState.colorProcInfo(primProc); |
const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(primProc); |
+ this->internalConstructor(drawState, colorPOI, coveragePOI, caps, scissorState, dstCopy); |
+} |
+ |
+GrOptDrawState::GrOptDrawState(GrBatch* batch, |
+ const GrDrawState& drawState, |
+ const GrDrawTargetCaps& caps, |
+ const GrScissorState& scissorState, |
+ const GrDeviceCoordTexture* dstCopy) { |
+ GrBatchOpt batchOpt; |
+ batchOpt.fCanTweakAlphaForCoverage = drawState.canTweakAlphaForCoverage(); |
+ batch->initBatchOpt(batchOpt); |
+ |
+ const GrProcOptInfo& colorPOI = drawState.colorProcInfo(batch); |
+ const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(batch); |
+ |
+ this->internalConstructor(drawState, colorPOI, coveragePOI, caps, scissorState, dstCopy); |
+} |
+ |
+void GrOptDrawState::internalConstructor(const GrDrawState& drawState, |
+ const GrProcOptInfo& colorPOI, |
+ const GrProcOptInfo& coveragePOI, |
+ const GrDrawTargetCaps& caps, |
+ const GrScissorState& scissorState, |
+ const GrDeviceCoordTexture* dstCopy) { |
// Create XferProcessor from DS's XPFactory |
SkAutoTUnref<GrXferProcessor> xferProcessor( |
drawState.getXPFactory()->createXferProcessor(colorPOI, coveragePOI)); |