Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: include/gpu/effects/GrPorterDuffXferProcessor.h

Issue 766653008: Revert of Make all blending up to GrOptDrawState be handled by the xp/xp factory. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrXferProcessor.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/effects/GrPorterDuffXferProcessor.h
diff --git a/include/gpu/effects/GrPorterDuffXferProcessor.h b/include/gpu/effects/GrPorterDuffXferProcessor.h
index 0ddfcdcd2a9594056bb12d469d5e85b5e0ca84bb..9ff3bea2ed81bf9b5741c7084a0535157ed52835 100644
--- a/include/gpu/effects/GrPorterDuffXferProcessor.h
+++ b/include/gpu/effects/GrPorterDuffXferProcessor.h
@@ -17,9 +17,8 @@
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 @@
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 @@
GrBlendCoeff fSrcBlend;
GrBlendCoeff fDstBlend;
- GrColor fBlendConstant;
-
+
typedef GrXferProcessor INHERITED;
};
@@ -81,34 +63,20 @@
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;
};
« no previous file with comments | « include/gpu/GrXferProcessor.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698