| Index: src/gpu/GrOptDrawState.cpp
|
| diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp
|
| index d95bd3b7c42017a2526f4fd3e7fcb662bed8502e..a66a3310b0d7496d876d2aa6bbb0bda1c819efbf 100644
|
| --- a/src/gpu/GrOptDrawState.cpp
|
| +++ b/src/gpu/GrOptDrawState.cpp
|
| @@ -13,15 +13,19 @@
|
| #include "GrProcOptInfo.h"
|
|
|
| GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
|
| + GrColor color,
|
| + uint8_t coverage,
|
| const GrDrawTargetCaps& caps,
|
| const ScissorState& scissorState,
|
| const GrDeviceCoordTexture* dstCopy,
|
| GrGpu::DrawType drawType)
|
| : fFinalized(false) {
|
| + GrColor c = GrColorPackRGBA(coverage, coverage, coverage, coverage);
|
| fDrawType = drawType;
|
| GrBlendCoeff optSrcCoeff;
|
| GrBlendCoeff optDstCoeff;
|
| - GrDrawState::BlendOpt blendOpt = drawState.getBlendOpt(false, &optSrcCoeff, &optDstCoeff);
|
| + GrDrawState::BlendOpt blendOpt = drawState.getBlendOpt(color, c, false, &optSrcCoeff,
|
| + &optDstCoeff);
|
|
|
| // When path rendering the stencil settings are not always set on the draw state
|
| // so we must check the draw type. In cases where we will skip drawing we simply return a
|
| @@ -73,7 +77,7 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
|
| bool hasLocalCoords = drawState.hasGeometryProcessor() &&
|
| drawState.getGeometryProcessor()->hasLocalCoords();
|
|
|
| - const GrProcOptInfo& colorPOI = drawState.colorProcInfo();
|
| + const GrProcOptInfo& colorPOI = drawState.colorProcInfo(color);
|
| int firstColorStageIdx = colorPOI.firstEffectiveStageIndex();
|
| fDescInfo.fInputColorIsUsed = colorPOI.inputColorIsUsed();
|
| fColor = colorPOI.inputColorToEffectiveStage();
|
| @@ -85,7 +89,7 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
|
| // drawState's coverageProcInfo (like color above) to set this initial information.
|
| int firstCoverageStageIdx = 0;
|
| fDescInfo.fInputCoverageIsUsed = true;
|
| - fCoverage = drawState.getCoverage();
|
| + fCoverage = coverage;
|
|
|
| this->adjustProgramForBlendOpt(drawState, blendOpt, &firstColorStageIdx,
|
| &firstCoverageStageIdx);
|
| @@ -116,7 +120,7 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
|
| (drawState.fCoverageStages[i], hasLocalCoords));
|
| }
|
|
|
| - this->setOutputStateInfo(drawState, blendOpt, caps);
|
| + this->setOutputStateInfo(drawState, c, blendOpt, caps);
|
|
|
| // let the GP init the batch tracker
|
| if (drawState.hasGeometryProcessor()) {
|
| @@ -130,6 +134,7 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
|
| }
|
|
|
| void GrOptDrawState::setOutputStateInfo(const GrDrawState& ds,
|
| + GrColor coverage,
|
| GrDrawState::BlendOpt blendOpt,
|
| const GrDrawTargetCaps& caps) {
|
| // Set this default and then possibly change our mind if there is coverage.
|
| @@ -140,7 +145,7 @@ void GrOptDrawState::setOutputStateInfo(const GrDrawState& ds,
|
| // separate from color.
|
| bool keepCoverageSeparate = !(GrDrawState::kCoverageAsAlpha_BlendOpt == blendOpt ||
|
| GrDrawState::kEmitCoverage_BlendOpt == blendOpt);
|
| - if (keepCoverageSeparate && !ds.hasSolidCoverage()) {
|
| + if (keepCoverageSeparate && !ds.hasSolidCoverage(coverage)) {
|
| if (caps.dualSourceBlendingSupport()) {
|
| if (kZero_GrBlendCoeff == fDstBlend) {
|
| // write the coverage value to second color
|
|
|