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 SkArithmeticMode_gpu_DEFINED | 8 #ifndef SkArithmeticMode_gpu_DEFINED |
9 #define SkArithmeticMode_gpu_DEFINED | 9 #define SkArithmeticMode_gpu_DEFINED |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 class GrTexture; | 24 class GrTexture; |
25 | 25 |
26 /////////////////////////////////////////////////////////////////////////////// | 26 /////////////////////////////////////////////////////////////////////////////// |
27 // Fragment Processor | 27 // Fragment Processor |
28 /////////////////////////////////////////////////////////////////////////////// | 28 /////////////////////////////////////////////////////////////////////////////// |
29 | 29 |
30 class GrGLArtithmeticFP; | 30 class GrGLArtithmeticFP; |
31 | 31 |
32 class GrArithmeticFP : public GrFragmentProcessor { | 32 class GrArithmeticFP : public GrFragmentProcessor { |
33 public: | 33 public: |
34 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
float k1, float k2, | 34 static const GrFragmentProcessor* Create(GrProcessorDataManager* procDataMan
ager, |
35 float k3, float k4, bool enforcePMColor, | 35 float k1, float k2, float k3, float
k4, |
36 GrTexture* background) { | 36 bool enforcePMColor, const GrFragme
ntProcessor* dst) { |
37 return new GrArithmeticFP(procDataManager, k1, k2, k3, k4, enforcePMColo
r, background); | 37 return new GrArithmeticFP(procDataManager, k1, k2, k3, k4, enforcePMColo
r, dst); |
38 } | 38 } |
39 | 39 |
40 ~GrArithmeticFP() override {}; | 40 ~GrArithmeticFP() override {}; |
41 | 41 |
42 const char* name() const override { return "Arithmetic"; } | 42 const char* name() const override { return "Arithmetic"; } |
43 | 43 |
44 float k1() const { return fK1; } | 44 float k1() const { return fK1; } |
45 float k2() const { return fK2; } | 45 float k2() const { return fK2; } |
46 float k3() const { return fK3; } | 46 float k3() const { return fK3; } |
47 float k4() const { return fK4; } | 47 float k4() const { return fK4; } |
48 bool enforcePMColor() const { return fEnforcePMColor; } | 48 bool enforcePMColor() const { return fEnforcePMColor; } |
49 | 49 |
50 private: | 50 private: |
51 GrGLFragmentProcessor* onCreateGLInstance() const override; | 51 GrGLFragmentProcessor* onCreateGLInstance() const override; |
52 | 52 |
53 void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c
onst override; | 53 void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c
onst override; |
54 | 54 |
55 bool onIsEqual(const GrFragmentProcessor&) const override; | 55 bool onIsEqual(const GrFragmentProcessor&) const override; |
56 | 56 |
57 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 57 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
58 | 58 |
59 GrArithmeticFP(GrProcessorDataManager*, float k1, float k2, float k3, float
k4, | 59 GrArithmeticFP(GrProcessorDataManager*, float k1, float k2, float k3, float
k4, |
60 bool enforcePMColor, GrTexture* background); | 60 bool enforcePMColor, const GrFragmentProcessor* dst); |
61 | 61 |
62 float fK1, fK2, fK3, fK4; | 62 float fK1, fK2, fK3, fK4; |
63 bool fEnforcePMColor; | 63 bool fEnforcePMColor; |
64 GrCoordTransform fBackgroundTransform; | |
65 GrTextureAccess fBackgroundAccess; | |
66 | 64 |
67 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 65 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
68 typedef GrFragmentProcessor INHERITED; | 66 typedef GrFragmentProcessor INHERITED; |
69 }; | 67 }; |
70 | 68 |
71 /////////////////////////////////////////////////////////////////////////////// | 69 /////////////////////////////////////////////////////////////////////////////// |
72 // Xfer Processor | 70 // Xfer Processor |
73 /////////////////////////////////////////////////////////////////////////////// | 71 /////////////////////////////////////////////////////////////////////////////// |
74 | 72 |
75 class GrArithmeticXPFactory : public GrXPFactory { | 73 class GrArithmeticXPFactory : public GrXPFactory { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 GR_DECLARE_XP_FACTORY_TEST; | 114 GR_DECLARE_XP_FACTORY_TEST; |
117 | 115 |
118 float fK1, fK2, fK3, fK4; | 116 float fK1, fK2, fK3, fK4; |
119 bool fEnforcePMColor; | 117 bool fEnforcePMColor; |
120 | 118 |
121 typedef GrXPFactory INHERITED; | 119 typedef GrXPFactory INHERITED; |
122 }; | 120 }; |
123 | 121 |
124 #endif | 122 #endif |
125 #endif | 123 #endif |
OLD | NEW |