OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2015 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef GrCustomXfermodePriv_DEFINED |
| 9 #define GrCustomXfermodePriv_DEFINED |
| 10 |
| 11 #include "GrCoordTransform.h" |
| 12 #include "GrFragmentProcessor.h" |
| 13 #include "GrTextureAccess.h" |
| 14 #include "SkXfermode.h" |
| 15 |
| 16 class GrGLCaps; |
| 17 class GrGLFragmentProcessor; |
| 18 class GrInvariantOutput; |
| 19 class GrProcessorKeyBuilder; |
| 20 class GrTexture; |
| 21 |
| 22 /////////////////////////////////////////////////////////////////////////////// |
| 23 // Fragment Processor |
| 24 /////////////////////////////////////////////////////////////////////////////// |
| 25 |
| 26 class GrCustomXferFP : public GrFragmentProcessor { |
| 27 public: |
| 28 GrCustomXferFP(SkXfermode::Mode mode, GrTexture* background); |
| 29 |
| 30 void getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const
SK_OVERRIDE; |
| 31 |
| 32 GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE; |
| 33 |
| 34 const char* name() const SK_OVERRIDE { return "Custom Xfermode"; } |
| 35 |
| 36 SkXfermode::Mode mode() const { return fMode; } |
| 37 const GrTextureAccess& backgroundAccess() const { return fBackgroundAccess;
} |
| 38 |
| 39 private: |
| 40 bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE; |
| 41 |
| 42 void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE; |
| 43 |
| 44 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 45 |
| 46 SkXfermode::Mode fMode; |
| 47 GrCoordTransform fBackgroundTransform; |
| 48 GrTextureAccess fBackgroundAccess; |
| 49 |
| 50 typedef GrFragmentProcessor INHERITED; |
| 51 }; |
| 52 |
| 53 #endif |
| 54 |
OLD | NEW |