diff options
author | 2015-02-04 06:25:28 -0800 | |
---|---|---|
committer | 2015-02-04 06:25:28 -0800 | |
commit | 4dce32c46675efb901618161771d450241af4307 (patch) | |
tree | f00c93110fbeda3d399105c40cee3fe6745e0c72 /src/gpu/effects/GrCustomXfermodePriv.h | |
parent | 7adb35559430303a25be37f21af56c0df6c62f2b (diff) |
Revert "Move DstCopy on gpu into the GrXferProcessor."
This reverts commit 74a11753604768bf461b80cabb66060e8564d82c.
TBR=joshualitt@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/3e9dfdb3784c0cbfecf7589a74aa9aff7ef40abd
Review URL: https://codereview.chromium.org/896163003
Diffstat (limited to 'src/gpu/effects/GrCustomXfermodePriv.h')
-rw-r--r-- | src/gpu/effects/GrCustomXfermodePriv.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/gpu/effects/GrCustomXfermodePriv.h b/src/gpu/effects/GrCustomXfermodePriv.h index 681c805ba7..45a9d3005d 100644 --- a/src/gpu/effects/GrCustomXfermodePriv.h +++ b/src/gpu/effects/GrCustomXfermodePriv.h @@ -9,7 +9,6 @@ #define GrCustomXfermodePriv_DEFINED #include "GrCoordTransform.h" -#include "GrDrawTargetCaps.h" #include "GrFragmentProcessor.h" #include "GrTextureAccess.h" #include "GrXferProcessor.h" @@ -58,12 +57,11 @@ private: class GrCustomXP : public GrXferProcessor { public: - static GrXferProcessor* Create(SkXfermode::Mode mode, const GrDeviceCoordTexture* dstCopy, - bool willReadDstColor) { + static GrXferProcessor* Create(SkXfermode::Mode mode) { if (!GrCustomXfermode::IsSupportedMode(mode)) { return NULL; } else { - return SkNEW_ARGS(GrCustomXP, (mode, dstCopy, willReadDstColor)); + return SkNEW_ARGS(GrCustomXP, (mode)); } } @@ -71,6 +69,8 @@ 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,9 +90,7 @@ public: SkXfermode::Mode mode() const { return fMode; } private: - GrCustomXP(SkXfermode::Mode mode, const GrDeviceCoordTexture* dstCopy, bool willReadDstColor); - - void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const SK_OVERRIDE; + GrCustomXP(SkXfermode::Mode mode); bool onIsEqual(const GrXferProcessor& xpBase) const SK_OVERRIDE; @@ -107,6 +105,11 @@ 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; } @@ -123,15 +126,9 @@ public: void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI, GrXPFactory::InvariantOutput*) const SK_OVERRIDE; -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 willReadDst() const SK_OVERRIDE { return true; } +private: bool onIsEqual(const GrXPFactory& xpfBase) const SK_OVERRIDE { const GrCustomXPFactory& xpf = xpfBase.cast<GrCustomXPFactory>(); return fMode == xpf.fMode; |