Index: src/gpu/GrPipeline.cpp |
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp |
index 906426caaaecc0699dd8d878ee2ccdfa9bdfd6dd..9e6dbbc6c522a5281b430dbed8330c9e6755099f 100644 |
--- a/src/gpu/GrPipeline.cpp |
+++ b/src/gpu/GrPipeline.cpp |
@@ -29,11 +29,30 @@ GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder, |
overrideColor = colorPOI.inputColorToEffectiveStage(); |
} |
+ fRenderTarget.reset(pipelineBuilder.fRenderTarget.get()); |
+ SkASSERT(fRenderTarget); |
+ |
+ fFlags = 0; |
+ if (pipelineBuilder.isHWAntialias()) { |
+ fFlags |= kHWAA_Flag; |
+ } |
+ if (pipelineBuilder.isDither()) { |
+ fFlags |= kDither_Flag; |
+ } |
+ |
GrXferProcessor::OptFlags optFlags; |
if (xferProcessor) { |
fXferProcessor.reset(xferProcessor.get()); |
- optFlags = xferProcessor->getOptimizations(colorPOI, |
+ GrProcOptInfo localColorPOI = colorPOI; |
+ // Optimizations will try to turn off blending which is required by mixed |
+ // sampled modes. |
+ bool isMixedSampledTarget = |
+ (this->getRenderTarget()->sampleConfig() == GrRenderTarget::kStencil_SampleConfig); |
+ localColorPOI.setHasMixedSamplesModulation(this->isHWAntialiasState() && |
+ isMixedSampledTarget); |
+ |
+ optFlags = xferProcessor->getOptimizations(localColorPOI, |
coveragePOI, |
pipelineBuilder.getStencil().doesWrite(), |
&overrideColor, |
@@ -51,20 +70,10 @@ GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder, |
return; |
} |
- fRenderTarget.reset(pipelineBuilder.fRenderTarget.get()); |
- SkASSERT(fRenderTarget); |
fScissorState = scissorState; |
fStencilSettings = pipelineBuilder.getStencil(); |
fDrawFace = pipelineBuilder.getDrawFace(); |
- fFlags = 0; |
- if (pipelineBuilder.isHWAntialias()) { |
- fFlags |= kHWAA_Flag; |
- } |
- if (pipelineBuilder.isDither()) { |
- fFlags |= kDither_Flag; |
- } |
- |
int firstColorStageIdx = colorPOI.firstEffectiveStageIndex(); |
// TODO: Once we can handle single or four channel input into coverage stages then we can use |