diff options
author | bsalomon <bsalomon@google.com> | 2015-02-06 07:02:37 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-06 07:02:37 -0800 |
commit | 50785a3d10b53bea5beb6e18431a2449860be237 (patch) | |
tree | 32a67ea76db96f6f94f7d1ce54ff354da5c30e95 /src/effects/SkArithmeticMode_gpu.h | |
parent | 5245cb427f982dbae365a52cf19256cfbcc6870a (diff) |
Revert of Revert of Move DstCopy on gpu into the GrXferProcessor. (patchset #1 id:1 of https://codereview.chromium.org/901663007/)
Reason for revert:
The revert didn't help the 10.9 bot. Unreverting by reverting the revert (which is basically relanding the original patch which itself was a revert of a revert). Revert.
Original issue's description:
> Revert of Move DstCopy on gpu into the GrXferProcessor. (patchset #11 id:200001 of https://codereview.chromium.org/885923002/)
>
> Reason for revert:
> Testing to see if reverting fixes 10.9 bots.
>
> Original issue's description:
> > Move DstCopy on gpu into the GrXferProcessor.
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/74a11753604768bf461b80cabb66060e8564d82c
> >
> > Committed: https://skia.googlesource.com/skia/+/5e1378d0e075a323144ba14e0a4cbcca35eccc69
>
> TBR=joshualitt@google.com,egdaniel@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/21b2c53218ab25f4268e3992e51d916076a2a7ee
TBR=joshualitt@google.com,egdaniel@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/873723009
Diffstat (limited to 'src/effects/SkArithmeticMode_gpu.h')
-rw-r--r-- | src/effects/SkArithmeticMode_gpu.h | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/effects/SkArithmeticMode_gpu.h b/src/effects/SkArithmeticMode_gpu.h index 2998eabc3b..b282e22427 100644 --- a/src/effects/SkArithmeticMode_gpu.h +++ b/src/effects/SkArithmeticMode_gpu.h @@ -13,6 +13,7 @@ #if SK_SUPPORT_GPU #include "GrCoordTransform.h" +#include "GrDrawTargetCaps.h" #include "GrFragmentProcessor.h" #include "GrTextureAccess.h" #include "GrTypes.h" @@ -72,16 +73,17 @@ private: class GrArithmeticXP : public GrXferProcessor { public: - static GrXferProcessor* Create(float k1, float k2, float k3, float k4, bool enforcePMColor) { - return SkNEW_ARGS(GrArithmeticXP, (k1, k2, k3, k4, enforcePMColor)); + static GrXferProcessor* Create(float k1, float k2, float k3, float k4, bool enforcePMColor, + const GrDeviceCoordTexture* dstCopy, + bool willReadDstColor) { + return SkNEW_ARGS(GrArithmeticXP, (k1, k2, k3, k4, enforcePMColor, dstCopy, + willReadDstColor)); } ~GrArithmeticXP() SK_OVERRIDE {}; const char* name() const SK_OVERRIDE { return "Arithmetic"; } - void getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const SK_OVERRIDE; - GrGLXferProcessor* createGLInstance() const SK_OVERRIDE; bool hasSecondaryOutput() const SK_OVERRIDE { return false; } @@ -105,7 +107,10 @@ public: bool enforcePMColor() const { return fEnforcePMColor; } private: - GrArithmeticXP(float k1, float k2, float k3, float k4, bool enforcePMColor); + GrArithmeticXP(float k1, float k2, float k3, float k4, bool enforcePMColor, + const GrDeviceCoordTexture* dstCopy, bool willReadDstColor); + + void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const SK_OVERRIDE; bool onIsEqual(const GrXferProcessor& xpBase) const SK_OVERRIDE { const GrArithmeticXP& xp = xpBase.cast<GrArithmeticXP>(); @@ -133,11 +138,6 @@ public: return SkNEW_ARGS(GrArithmeticXPFactory, (k1, k2, k3, k4, enforcePMColor)); } - GrXferProcessor* createXferProcessor(const GrProcOptInfo& colorPOI, - const GrProcOptInfo& coveragePOI) const SK_OVERRIDE { - return GrArithmeticXP::Create(fK1, fK2, fK3, fK4, fEnforcePMColor); - } - bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const SK_OVERRIDE { return true; } @@ -154,11 +154,18 @@ public: void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI, GrXPFactory::InvariantOutput*) const SK_OVERRIDE; - bool willReadDst() const SK_OVERRIDE { return true; } - private: GrArithmeticXPFactory(float k1, float k2, float k3, float k4, bool enforcePMColor); + GrXferProcessor* onCreateXferProcessor(const GrProcOptInfo& colorPOI, + const GrProcOptInfo& coveragePOI, + const GrDeviceCoordTexture* dstCopy) const SK_OVERRIDE { + return GrArithmeticXP::Create(fK1, fK2, fK3, fK4, fEnforcePMColor, dstCopy, + this->willReadDstColor()); + } + + bool willReadDstColor() const SK_OVERRIDE { return true; } + bool onIsEqual(const GrXPFactory& xpfBase) const SK_OVERRIDE { const GrArithmeticXPFactory& xpf = xpfBase.cast<GrArithmeticXPFactory>(); if (fK1 != xpf.fK1 || |