Chromium Code Reviews| Index: src/gpu/effects/GrPorterDuffXferProcessor.h |
| diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.h b/src/gpu/effects/GrPorterDuffXferProcessor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..53339ea907aef8baeff1e7da75b21c072fe2b641 |
| --- /dev/null |
| +++ b/src/gpu/effects/GrPorterDuffXferProcessor.h |
| @@ -0,0 +1,65 @@ |
| +/* |
| + * Copyright 2014 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef GrPorterDuffXferProcessor_DEFINED |
| +#define GrPorterDuffXferProcessor_DEFINED |
| + |
| +#include "GrTypes.h" |
| +#include "GrXferProcessor.h" |
| +#include "SkXfermode.h" |
| + |
| +class GrBackendFragmentProcessorFactory; |
| +class GrDrawState; |
| +class GrGLPorterDuffXferProcessor; |
| +class GrInvariantOutput; |
| + |
| +class GrPorterDuffXferProcessor : public GrXferProcessor { |
| +public: |
| + static GrXferProcessor* Create(GrBlendCoeff srcBlend, GrBlendCoeff dstBlend) { |
| + return SkNEW_ARGS(GrPorterDuffXferProcessor, (srcBlend, dstBlend)); |
| + } |
| + |
| + virtual ~GrPorterDuffXferProcessor(); |
| + |
| + virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE; |
| + |
| + typedef GrGLPorterDuffXferProcessor GLProcessor; |
| + static const char* Name() { return "Porter Duff"; } |
| + |
| + virtual bool isValidColorStage() const SK_OVERRIDE { return false; } |
|
bsalomon
2014/11/26 21:02:45
no need for virtual keyword w/ override.
where is
egdaniel
2014/12/01 18:18:25
Old code that somehow didn't get deleted in clean
|
| + |
| +private: |
| + GrPorterDuffXferProcessor(GrBlendCoeff srcBlend, GrBlendCoeff dstBlend); |
| + |
| + virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { return true; } |
| + |
| + virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE; |
| + |
| + typedef GrXferProcessor INHERITED; |
| +}; |
| + |
| +/////////////////////////////////////////////////////////////////////////////// |
| + |
| +class GrPorterDuffXPFactory : public GrXPFactory { |
| +public: |
| + static GrXPFactory* Create(SkXfermode::Coeff src, SkXfermode::Coeff dst) { |
| + return SkNEW_ARGS(GrPorterDuffXPFactory, (src, dst)); |
| + } |
| + |
| + virtual const GrXferProcessor* createXferProcessor() const SK_OVERRIDE; |
| + |
| + virtual bool supportsLCDText(const GrDrawState&) const SK_OVERRIDE; |
| + |
| +protected: |
| + GrPorterDuffXPFactory(SkXfermode::Coeff src, SkXfermode::Coeff dst) |
| + : INHERITED((GrBlendCoeff)(src), (GrBlendCoeff)(dst)) {} |
| + |
| +private: |
| + typedef GrXPFactory INHERITED; |
| +}; |
| + |
| +#endif |