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(GrShaderDataManager* shaderDataManager, f
loat k1, float k2, | 34 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
float k1, float k2, |
35 float k3, float k4, bool enforcePMColor, | 35 float k3, float k4, bool enforcePMColor, |
36 GrTexture* background) { | 36 GrTexture* background) { |
37 return SkNEW_ARGS(GrArithmeticFP, (shaderDataManager, k1, k2, k3, k4, en
forcePMColor, | 37 return SkNEW_ARGS(GrArithmeticFP, (procDataManager, k1, k2, k3, k4, enfo
rcePMColor, |
38 background)); | 38 background)); |
39 } | 39 } |
40 | 40 |
41 ~GrArithmeticFP() override {}; | 41 ~GrArithmeticFP() override {}; |
42 | 42 |
43 const char* name() const override { return "Arithmetic"; } | 43 const char* name() const override { return "Arithmetic"; } |
44 | 44 |
45 void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) con
st override; | 45 void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) con
st override; |
46 | 46 |
47 GrGLFragmentProcessor* createGLInstance() const override; | 47 GrGLFragmentProcessor* createGLInstance() const override; |
48 | 48 |
49 float k1() const { return fK1; } | 49 float k1() const { return fK1; } |
50 float k2() const { return fK2; } | 50 float k2() const { return fK2; } |
51 float k3() const { return fK3; } | 51 float k3() const { return fK3; } |
52 float k4() const { return fK4; } | 52 float k4() const { return fK4; } |
53 bool enforcePMColor() const { return fEnforcePMColor; } | 53 bool enforcePMColor() const { return fEnforcePMColor; } |
54 | 54 |
55 private: | 55 private: |
56 bool onIsEqual(const GrFragmentProcessor&) const override; | 56 bool onIsEqual(const GrFragmentProcessor&) const override; |
57 | 57 |
58 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 58 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
59 | 59 |
60 GrArithmeticFP(GrShaderDataManager*, float k1, float k2, float k3, float k4, | 60 GrArithmeticFP(GrProcessorDataManager*, float k1, float k2, float k3, float
k4, |
61 bool enforcePMColor, GrTexture* background); | 61 bool enforcePMColor, GrTexture* background); |
62 | 62 |
63 float fK1, fK2, fK3, fK4; | 63 float fK1, fK2, fK3, fK4; |
64 bool fEnforcePMColor; | 64 bool fEnforcePMColor; |
65 GrCoordTransform fBackgroundTransform; | 65 GrCoordTransform fBackgroundTransform; |
66 GrTextureAccess fBackgroundAccess; | 66 GrTextureAccess fBackgroundAccess; |
67 | 67 |
68 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 68 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
69 typedef GrFragmentProcessor INHERITED; | 69 typedef GrFragmentProcessor INHERITED; |
70 }; | 70 }; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 GR_DECLARE_XP_FACTORY_TEST; | 117 GR_DECLARE_XP_FACTORY_TEST; |
118 | 118 |
119 float fK1, fK2, fK3, fK4; | 119 float fK1, fK2, fK3, fK4; |
120 bool fEnforcePMColor; | 120 bool fEnforcePMColor; |
121 | 121 |
122 typedef GrXPFactory INHERITED; | 122 typedef GrXPFactory INHERITED; |
123 }; | 123 }; |
124 | 124 |
125 #endif | 125 #endif |
126 #endif | 126 #endif |
OLD | NEW |