diff options
author | 2015-01-15 10:52:32 -0800 | |
---|---|---|
committer | 2015-01-15 10:52:32 -0800 | |
commit | 0063a9b69a6a5d377f207c2aa1ea1e7220c19ba9 (patch) | |
tree | 243e2df84671792579adbc6202477dd2dbc06b38 /src/gpu/effects/GrCustomXfermodePriv.h | |
parent | b0878797b45f93b3bfe6084094c74affd10207df (diff) |
Move XferEffects class to GrCustomXfermode file
BUG=skia:
Review URL: https://codereview.chromium.org/844913003
Diffstat (limited to 'src/gpu/effects/GrCustomXfermodePriv.h')
-rw-r--r-- | src/gpu/effects/GrCustomXfermodePriv.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/gpu/effects/GrCustomXfermodePriv.h b/src/gpu/effects/GrCustomXfermodePriv.h new file mode 100644 index 0000000000..0c8035111e --- /dev/null +++ b/src/gpu/effects/GrCustomXfermodePriv.h @@ -0,0 +1,54 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrCustomXfermodePriv_DEFINED +#define GrCustomXfermodePriv_DEFINED + +#include "GrCoordTransform.h" +#include "GrFragmentProcessor.h" +#include "GrTextureAccess.h" +#include "SkXfermode.h" + +class GrGLCaps; +class GrGLFragmentProcessor; +class GrInvariantOutput; +class GrProcessorKeyBuilder; +class GrTexture; + +/////////////////////////////////////////////////////////////////////////////// +// Fragment Processor +/////////////////////////////////////////////////////////////////////////////// + +class GrCustomXferFP : public GrFragmentProcessor { +public: + GrCustomXferFP(SkXfermode::Mode mode, GrTexture* background); + + void getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const SK_OVERRIDE; + + GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE; + + const char* name() const SK_OVERRIDE { return "Custom Xfermode"; } + + SkXfermode::Mode mode() const { return fMode; } + const GrTextureAccess& backgroundAccess() const { return fBackgroundAccess; } + +private: + bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE; + + void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE; + + GR_DECLARE_FRAGMENT_PROCESSOR_TEST; + + SkXfermode::Mode fMode; + GrCoordTransform fBackgroundTransform; + GrTextureAccess fBackgroundAccess; + + typedef GrFragmentProcessor INHERITED; +}; + +#endif + |