OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrCustomXfermodePriv_DEFINED | 8 #ifndef GrCustomXfermodePriv_DEFINED |
9 #define GrCustomXfermodePriv_DEFINED | 9 #define GrCustomXfermodePriv_DEFINED |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 class GrTexture; | 22 class GrTexture; |
23 | 23 |
24 /////////////////////////////////////////////////////////////////////////////// | 24 /////////////////////////////////////////////////////////////////////////////// |
25 // Fragment Processor | 25 // Fragment Processor |
26 /////////////////////////////////////////////////////////////////////////////// | 26 /////////////////////////////////////////////////////////////////////////////// |
27 | 27 |
28 class GrCustomXferFP : public GrFragmentProcessor { | 28 class GrCustomXferFP : public GrFragmentProcessor { |
29 public: | 29 public: |
30 GrCustomXferFP(GrProcessorDataManager*, SkXfermode::Mode mode, GrTexture* ba
ckground); | 30 GrCustomXferFP(GrProcessorDataManager*, SkXfermode::Mode mode, GrTexture* ba
ckground); |
31 | 31 |
32 GrGLFragmentProcessor* createGLInstance() const override; | |
33 | |
34 const char* name() const override { return "Custom Xfermode"; } | 32 const char* name() const override { return "Custom Xfermode"; } |
35 | 33 |
36 SkXfermode::Mode mode() const { return fMode; } | 34 SkXfermode::Mode mode() const { return fMode; } |
37 const GrTextureAccess& backgroundAccess() const { return fBackgroundAccess;
} | 35 const GrTextureAccess& backgroundAccess() const { return fBackgroundAccess;
} |
38 | 36 |
39 private: | 37 private: |
| 38 GrGLFragmentProcessor* onCreateGLInstance() const override; |
| 39 |
40 void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c
onst override; | 40 void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c
onst override; |
41 | 41 |
42 bool onIsEqual(const GrFragmentProcessor& other) const override; | 42 bool onIsEqual(const GrFragmentProcessor& other) const override; |
43 | 43 |
44 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 44 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
45 | 45 |
46 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 46 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
47 | 47 |
48 SkXfermode::Mode fMode; | 48 SkXfermode::Mode fMode; |
49 GrCoordTransform fBackgroundTransform; | 49 GrCoordTransform fBackgroundTransform; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 GR_DECLARE_XP_FACTORY_TEST; | 87 GR_DECLARE_XP_FACTORY_TEST; |
88 | 88 |
89 SkXfermode::Mode fMode; | 89 SkXfermode::Mode fMode; |
90 GrBlendEquation fHWBlendEquation; | 90 GrBlendEquation fHWBlendEquation; |
91 | 91 |
92 typedef GrXPFactory INHERITED; | 92 typedef GrXPFactory INHERITED; |
93 }; | 93 }; |
94 #endif | 94 #endif |
95 | 95 |
OLD | NEW |