Chromium Code Reviews| Index: src/gpu/GrDrawState.cpp |
| diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp |
| index 7538cdb34004dca67f8e7f40ce47a90e54969650..c91198283b74c5cdf7f7370c87c6ea511c579519 100644 |
| --- a/src/gpu/GrDrawState.cpp |
| +++ b/src/gpu/GrDrawState.cpp |
| @@ -11,8 +11,11 @@ |
| #include "GrOptDrawState.h" |
| #include "GrPaint.h" |
| #include "GrProcOptInfo.h" |
| +#include "GrXferProcessor.h" |
| +#include "effects/GrDefaultXferProcessor.h" |
| +#include "effects/GrPorterDuffXferProcessor.h" |
| -//////////////////////////////////////////////////////////////////////////////s |
| +/////////////////////////////////////////////////////////////////////////////// |
| bool GrDrawState::isEqual(const GrDrawState& that) const { |
| bool usingVertexColors = this->hasColorVertexAttribute(); |
| @@ -102,6 +105,8 @@ GrDrawState& GrDrawState::operator=(const GrDrawState& that) { |
| fCoverage = that.fCoverage; |
| fDrawFace = that.fDrawFace; |
| fGeometryProcessor.reset(SkSafeRef(that.fGeometryProcessor.get())); |
| + SkASSERT(that.hasXPFactory()); |
| + fXPFactory.reset(SkRef(that.getXPFactory())); |
| fColorStages = that.fColorStages; |
| fCoverageStages = that.fCoverageStages; |
| @@ -127,6 +132,7 @@ void GrDrawState::onReset(const SkMatrix* initialViewMatrix) { |
| fRenderTarget.reset(NULL); |
| fGeometryProcessor.reset(NULL); |
| + fXPFactory.reset(GrDefaultXPFactory::Create()); |
|
bsalomon
2014/11/26 21:02:45
why not NULL? Or if not, should we have the hasXPF
egdaniel
2014/12/01 18:18:24
I always want there to be an XP so a default one i
|
| fColorStages.reset(); |
| fCoverageStages.reset(); |
| @@ -186,6 +192,10 @@ void GrDrawState::setFromPaint(const GrPaint& paint, const SkMatrix& vm, GrRende |
| fCoverageStages.push_back(paint.getCoverageStage(i)); |
| } |
| + SkASSERT(paint.hasXPFactory()); |
| + fXPFactory.reset(SkRef(paint.getXPFactory())); |
| + |
| + this->setBlendFunc(paint.getSrcBlendCoeff(), paint.getDstBlendCoeff()); |
| this->setRenderTarget(rt); |
| fViewMatrix = vm; |
| @@ -204,7 +214,6 @@ void GrDrawState::setFromPaint(const GrPaint& paint, const SkMatrix& vm, GrRende |
| this->setState(GrDrawState::kDither_StateBit, paint.isDither()); |
| this->setState(GrDrawState::kHWAntialias_StateBit, paint.isAntiAlias()); |
| - this->setBlendFunc(paint.getSrcBlendCoeff(), paint.getDstBlendCoeff()); |
| this->setCoverage(0xFF); |
| fColorProcInfoValid = false; |
| fCoverageProcInfoValid = false; |
| @@ -660,6 +669,11 @@ bool GrDrawState::willBlendWithDst() const { |
| return false; |
| } |
| +bool GrDrawState::coverageWillBeSingleComponent() const { |
| + this->calcCoverageInvariantOutput(); |
| + return (fColorProcInfo.isSingleComponent()); |
|
bsalomon
2014/11/26 21:02:45
fCoverageProcInfo?
egdaniel
2014/12/01 18:18:24
yeah was fixed in follow up cl, missed propagating
bsalomon
2014/12/01 19:24:39
I'm still not seeing it.
|
| +} |
| + |
| void GrDrawState::calcColorInvariantOutput() const { |
| if (!fColorProcInfoValid) { |
| GrColor color; |