| Index: src/gpu/effects/GrCustomXfermodePriv.h
|
| diff --git a/src/gpu/effects/GrCustomXfermodePriv.h b/src/gpu/effects/GrCustomXfermodePriv.h
|
| index 45a9d3005db94afc43f793006d4cd3215c4d3f6b..681c805ba7034c9eea960f5bee88c596cd98a32e 100644
|
| --- a/src/gpu/effects/GrCustomXfermodePriv.h
|
| +++ b/src/gpu/effects/GrCustomXfermodePriv.h
|
| @@ -9,6 +9,7 @@
|
| #define GrCustomXfermodePriv_DEFINED
|
|
|
| #include "GrCoordTransform.h"
|
| +#include "GrDrawTargetCaps.h"
|
| #include "GrFragmentProcessor.h"
|
| #include "GrTextureAccess.h"
|
| #include "GrXferProcessor.h"
|
| @@ -57,11 +58,12 @@ private:
|
|
|
| class GrCustomXP : public GrXferProcessor {
|
| public:
|
| - static GrXferProcessor* Create(SkXfermode::Mode mode) {
|
| + static GrXferProcessor* Create(SkXfermode::Mode mode, const GrDeviceCoordTexture* dstCopy,
|
| + bool willReadDstColor) {
|
| if (!GrCustomXfermode::IsSupportedMode(mode)) {
|
| return NULL;
|
| } else {
|
| - return SkNEW_ARGS(GrCustomXP, (mode));
|
| + return SkNEW_ARGS(GrCustomXP, (mode, dstCopy, willReadDstColor));
|
| }
|
| }
|
|
|
| @@ -69,8 +71,6 @@ public:
|
|
|
| const char* name() const SK_OVERRIDE { return "Custom Xfermode"; }
|
|
|
| - void getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const SK_OVERRIDE;
|
| -
|
| GrGLXferProcessor* createGLInstance() const SK_OVERRIDE;
|
|
|
| bool hasSecondaryOutput() const SK_OVERRIDE { return false; }
|
| @@ -90,7 +90,9 @@ public:
|
| SkXfermode::Mode mode() const { return fMode; }
|
|
|
| private:
|
| - GrCustomXP(SkXfermode::Mode mode);
|
| + GrCustomXP(SkXfermode::Mode mode, const GrDeviceCoordTexture* dstCopy, bool willReadDstColor);
|
| +
|
| + void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const SK_OVERRIDE;
|
|
|
| bool onIsEqual(const GrXferProcessor& xpBase) const SK_OVERRIDE;
|
|
|
| @@ -105,11 +107,6 @@ class GrCustomXPFactory : public GrXPFactory {
|
| public:
|
| GrCustomXPFactory(SkXfermode::Mode mode);
|
|
|
| - GrXferProcessor* createXferProcessor(const GrProcOptInfo& colorPOI,
|
| - const GrProcOptInfo& coveragePOI) const SK_OVERRIDE {
|
| - return GrCustomXP::Create(fMode);
|
| - }
|
| -
|
| bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const SK_OVERRIDE {
|
| return true;
|
| }
|
| @@ -126,9 +123,15 @@ public:
|
| void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
|
| GrXPFactory::InvariantOutput*) const SK_OVERRIDE;
|
|
|
| - bool willReadDst() const SK_OVERRIDE { return true; }
|
| -
|
| private:
|
| + GrXferProcessor* onCreateXferProcessor(const GrProcOptInfo& colorPOI,
|
| + const GrProcOptInfo& coveragePOI,
|
| + const GrDeviceCoordTexture* dstCopy) const SK_OVERRIDE {
|
| + return GrCustomXP::Create(fMode, dstCopy, this->willReadDstColor());
|
| + }
|
| +
|
| + bool willReadDstColor() const SK_OVERRIDE { return true; }
|
| +
|
| bool onIsEqual(const GrXPFactory& xpfBase) const SK_OVERRIDE {
|
| const GrCustomXPFactory& xpf = xpfBase.cast<GrCustomXPFactory>();
|
| return fMode == xpf.fMode;
|
|
|