Index: src/gpu/GrOptDrawState.cpp |
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp |
index 8d28f446b27912d2d6e6687ef54485a73a93e326..92c249405d35c2f422d0c5287001775bc6eb0cea 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" |
@@ -19,11 +20,40 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, |
const GrScissorState& scissorState, |
const GrDeviceCoordTexture* dstCopy, |
GrGpu::DrawType drawType) { |
- fDrawType = drawType; |
- |
const GrProcOptInfo& colorPOI = drawState.colorProcInfo(primProc); |
const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(primProc); |
+ this->internalConstructor(drawState, colorPOI, coveragePOI, caps, scissorState, dstCopy, |
+ drawType); |
+} |
+ |
+GrOptDrawState::GrOptDrawState(GrBatch* batch, |
+ const GrDrawState& drawState, |
+ const GrDrawTargetCaps& caps, |
+ const GrScissorState& scissorState, |
+ const GrDeviceCoordTexture* dstCopy, |
+ GrGpu::DrawType drawType) { |
+ 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, |
+ drawType); |
+} |
+ |
+void GrOptDrawState::internalConstructor(const GrDrawState& drawState, |
+ const GrProcOptInfo& colorPOI, |
+ const GrProcOptInfo& coveragePOI, |
+ const GrDrawTargetCaps& caps, |
+ const GrScissorState& scissorState, |
+ const GrDeviceCoordTexture* dstCopy, |
+ GrGpu::DrawType drawType) { |
+ |
+ fDrawType = drawType; |
+ |
// Create XferProcessor from DS's XPFactory |
SkAutoTUnref<GrXferProcessor> xferProcessor( |
drawState.getXPFactory()->createXferProcessor(colorPOI, coveragePOI)); |