aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/effects/GrPorterDuffXferProcessor.h
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2014-12-08 13:26:43 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-08 13:26:43 -0800
commit8d95ffa497091d0c9c7cda099684c7bca6714a17 (patch)
treeb47fb9fba90f1c9c945db4c9d0fcd73802c8773e /include/gpu/effects/GrPorterDuffXferProcessor.h
parent4ccf0b94054a4c16641c027edb4b0cfd0daddb65 (diff)
Revert of Make all blending up to GrOptDrawState be handled by the xp/xp factory. (patchset #7 id:140001 of https://codereview.chromium.org/759713002/)
Reason for revert: break many gm's Original issue's description: > Make all blending up to GrOptDrawState be handled by the xp/xp factory. > > In this cl the blending information is extracted for the xp and stored in the ODS > which is then used as it currently is. In the follow up cl, an XP backend will be added > and at that point all blending work will take place inside XP's. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4 TBR=bsalomon@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/766653008
Diffstat (limited to 'include/gpu/effects/GrPorterDuffXferProcessor.h')
-rw-r--r--include/gpu/effects/GrPorterDuffXferProcessor.h50
1 files changed, 9 insertions, 41 deletions
diff --git a/include/gpu/effects/GrPorterDuffXferProcessor.h b/include/gpu/effects/GrPorterDuffXferProcessor.h
index 0ddfcdcd2a..9ff3bea2ed 100644
--- a/include/gpu/effects/GrPorterDuffXferProcessor.h
+++ b/include/gpu/effects/GrPorterDuffXferProcessor.h
@@ -17,9 +17,8 @@ class GrInvariantOutput;
class GrPorterDuffXferProcessor : public GrXferProcessor {
public:
- static GrXferProcessor* Create(GrBlendCoeff srcBlend, GrBlendCoeff dstBlend,
- GrColor constant = 0) {
- return SkNEW_ARGS(GrPorterDuffXferProcessor, (srcBlend, dstBlend, constant));
+ static GrXferProcessor* Create(GrBlendCoeff srcBlend, GrBlendCoeff dstBlend) {
+ return SkNEW_ARGS(GrPorterDuffXferProcessor, (srcBlend, dstBlend));
}
virtual ~GrPorterDuffXferProcessor();
@@ -31,28 +30,12 @@ public:
virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE;
- virtual GrXferProcessor::OptFlags getOptimizations(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
- bool isCoverageDrawing,
- bool colorWriteDisabled,
- bool doesStencilWrite,
- GrColor* color,
- uint8_t* coverage) SK_OVERRIDE;
-
- virtual void getBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const SK_OVERRIDE {
- blendInfo->fSrcBlend = fSrcBlend;
- blendInfo->fDstBlend = fDstBlend;
- blendInfo->fBlendConstant = fBlendConstant;
- }
-
private:
- GrPorterDuffXferProcessor(GrBlendCoeff srcBlend, GrBlendCoeff dstBlend, GrColor constant);
+ GrPorterDuffXferProcessor(GrBlendCoeff srcBlend, GrBlendCoeff dstBlend);
virtual bool onIsEqual(const GrFragmentProcessor& fpBase) const SK_OVERRIDE {
const GrPorterDuffXferProcessor& xp = fpBase.cast<GrPorterDuffXferProcessor>();
- if (fSrcBlend != xp.fSrcBlend ||
- fDstBlend != xp.fDstBlend ||
- fBlendConstant != xp.fBlendConstant) {
+ if (fSrcBlend != xp.fSrcBlend || fDstBlend != xp.fDstBlend) {
return false;
}
return true;
@@ -62,8 +45,7 @@ private:
GrBlendCoeff fSrcBlend;
GrBlendCoeff fDstBlend;
- GrColor fBlendConstant;
-
+
typedef GrXferProcessor INHERITED;
};
@@ -81,34 +63,20 @@ public:
return SkNEW_ARGS(GrPorterDuffXPFactory, (src, dst));
}
- GrXferProcessor* createXferProcessor(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI) const SK_OVERRIDE;
+ const GrXferProcessor* createXferProcessor() const SK_OVERRIDE;
bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const SK_OVERRIDE;
- bool canApplyCoverage(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
- bool isCoverageDrawing, bool colorWriteDisabled) const SK_OVERRIDE;
-
- bool willBlendWithDst(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
- bool isCoverageDrawing, bool colorWriteDisabled) const SK_OVERRIDE;
-
- bool canTweakAlphaForCoverage(bool isCoverageDrawing) const SK_OVERRIDE;
-
- bool getOpaqueAndKnownColor(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
- GrColor* solidColor,
- uint32_t* solidColorKnownComponents) const SK_OVERRIDE;
-
private:
GrPorterDuffXPFactory(GrBlendCoeff src, GrBlendCoeff dst);
bool onIsEqual(const GrXPFactory& xpfBase) const SK_OVERRIDE {
const GrPorterDuffXPFactory& xpf = xpfBase.cast<GrPorterDuffXPFactory>();
- return (fSrcCoeff == xpf.fSrcCoeff && fDstCoeff == xpf.fDstCoeff);
+ return (fSrc == xpf.fSrc && fDst == xpf.fDst);
}
- GrBlendCoeff fSrcCoeff;
- GrBlendCoeff fDstCoeff;
+ GrBlendCoeff fSrc;
+ GrBlendCoeff fDst;
typedef GrXPFactory INHERITED;
};