Index: src/gpu/effects/GrPorterDuffXferProcessor.cpp |
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
index 650a1e7622fae6010aeaf4af87950a75763788bf..cd85c5bbcb27b4fdefc278b1907bdbd0459a501c 100644 |
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
@@ -341,7 +341,7 @@ static BlendFormula get_lcd_blend_formula(const GrProcOptInfo& coveragePOI, |
class PorterDuffXferProcessor : public GrXferProcessor { |
public: |
- PorterDuffXferProcessor(BlendFormula blendFormula) : fBlendFormula(blendFormula) { |
+ PorterDuffXferProcessor(BlendFormula blendFormula, GrRenderTarget* dst) : INHERITED(dst), fBlendFormula(blendFormula) { |
this->initClassID<PorterDuffXferProcessor>(); |
} |
@@ -479,15 +479,17 @@ PorterDuffXferProcessor::onGetOptimizations(const GrProcOptInfo& colorPOI, |
if (!doesStencilWrite) { |
optFlags |= GrXferProcessor::kSkipDraw_OptFlag; |
} |
- optFlags |= (GrXferProcessor::kIgnoreColor_OptFlag | |
- GrXferProcessor::kIgnoreCoverage_OptFlag | |
+ optFlags |= (//GrXferProcessor::kIgnoreColor_OptFlag | |
+ //GrXferProcessor::kIgnoreCoverage_OptFlag | |
GrXferProcessor::kCanTweakAlphaForCoverage_OptFlag); |
} else { |
if (!fBlendFormula.usesInputColor()) { |
- optFlags |= GrXferProcessor::kIgnoreColor_OptFlag; |
+ // This optimization winds up having the texture access counted |
+ // but the pipe-line access not - this is good but messes up the asserts |
+ //optFlags |= GrXferProcessor::kIgnoreColor_OptFlag; |
} |
if (coveragePOI.isSolidWhite()) { |
- optFlags |= GrXferProcessor::kIgnoreCoverage_OptFlag; |
+ //optFlags |= GrXferProcessor::kIgnoreCoverage_OptFlag; |
} |
if (colorPOI.allStagesMultiplyInput() && |
fBlendFormula.canTweakAlphaForCoverage() && |
@@ -504,8 +506,8 @@ class ShaderPDXferProcessor : public GrXferProcessor { |
public: |
ShaderPDXferProcessor(const DstTexture* dstTexture, |
bool hasMixedSamples, |
- SkXfermode::Mode xfermode) |
- : INHERITED(dstTexture, true, hasMixedSamples) |
+ SkXfermode::Mode xfermode, GrRenderTarget* dst) |
+ : INHERITED(dstTexture, true, hasMixedSamples, dst) |
, fXfermode(xfermode) { |
this->initClassID<ShaderPDXferProcessor>(); |
} |
@@ -572,7 +574,7 @@ GrGLXferProcessor* ShaderPDXferProcessor::createGLInstance() const { |
class PDLCDXferProcessor : public GrXferProcessor { |
public: |
- static GrXferProcessor* Create(SkXfermode::Mode xfermode, const GrProcOptInfo& colorPOI); |
+ static GrXferProcessor* Create(SkXfermode::Mode xfermode, const GrProcOptInfo& colorPOI, GrRenderTarget* dst); |
~PDLCDXferProcessor() override; |
@@ -581,7 +583,7 @@ public: |
GrGLXferProcessor* createGLInstance() const override; |
private: |
- PDLCDXferProcessor(GrColor blendConstant, uint8_t alpha); |
+ PDLCDXferProcessor(GrColor blendConstant, uint8_t alpha, GrRenderTarget* dst); |
GrXferProcessor::OptFlags onGetOptimizations(const GrProcOptInfo& colorPOI, |
const GrProcOptInfo& coveragePOI, |
@@ -637,14 +639,14 @@ private: |
/////////////////////////////////////////////////////////////////////////////// |
-PDLCDXferProcessor::PDLCDXferProcessor(GrColor blendConstant, uint8_t alpha) |
- : fBlendConstant(blendConstant) |
+PDLCDXferProcessor::PDLCDXferProcessor(GrColor blendConstant, uint8_t alpha, GrRenderTarget* dst) |
+ : INHERITED(dst), fBlendConstant(blendConstant) |
, fAlpha(alpha) { |
this->initClassID<PDLCDXferProcessor>(); |
} |
GrXferProcessor* PDLCDXferProcessor::Create(SkXfermode::Mode xfermode, |
- const GrProcOptInfo& colorPOI) { |
+ const GrProcOptInfo& colorPOI, GrRenderTarget* dst) { |
if (SkXfermode::kSrcOver_Mode != xfermode) { |
return nullptr; |
} |
@@ -657,7 +659,7 @@ GrXferProcessor* PDLCDXferProcessor::Create(SkXfermode::Mode xfermode, |
uint8_t alpha = GrColorUnpackA(blendConstant); |
blendConstant |= (0xff << GrColor_SHIFT_A); |
- return new PDLCDXferProcessor(blendConstant, alpha); |
+ return new PDLCDXferProcessor(blendConstant, alpha, dst); |
} |
PDLCDXferProcessor::~PDLCDXferProcessor() { |
@@ -729,7 +731,7 @@ GrPorterDuffXPFactory::onCreateXferProcessor(const GrCaps& caps, |
const GrProcOptInfo& colorPOI, |
const GrProcOptInfo& covPOI, |
bool hasMixedSamples, |
- const DstTexture* dstTexture) const { |
+ const DstTexture* dstTexture, GrRenderTarget* dst) const { |
BlendFormula blendFormula; |
if (covPOI.isFourChannelOutput()) { |
if (SkXfermode::kSrcOver_Mode == fXfermode && |
@@ -739,7 +741,7 @@ GrPorterDuffXPFactory::onCreateXferProcessor(const GrCaps& caps, |
// If we don't have dual source blending or in shader dst reads, we fall back to this |
// trick for rendering SrcOver LCD text instead of doing a dst copy. |
SkASSERT(!dstTexture || !dstTexture->texture()); |
- return PDLCDXferProcessor::Create(fXfermode, colorPOI); |
+ return PDLCDXferProcessor::Create(fXfermode, colorPOI, dst); |
} |
blendFormula = get_lcd_blend_formula(covPOI, fXfermode); |
} else { |
@@ -747,11 +749,11 @@ GrPorterDuffXPFactory::onCreateXferProcessor(const GrCaps& caps, |
} |
if (blendFormula.hasSecondaryOutput() && !caps.shaderCaps()->dualSourceBlendingSupport()) { |
- return new ShaderPDXferProcessor(dstTexture, hasMixedSamples, fXfermode); |
+ return new ShaderPDXferProcessor(dstTexture, hasMixedSamples, fXfermode, dst); |
} |
SkASSERT(!dstTexture || !dstTexture->texture()); |
- return new PorterDuffXferProcessor(blendFormula); |
+ return new PorterDuffXferProcessor(blendFormula, dst); |
} |
void GrPorterDuffXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |