| 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 const GrFragmentProcessor* Create(GrProcessorDataManager* procDataMan
ager, | 34 static const GrFragmentProcessor* Create(float k1, float k2, float k3, float
k4, |
| 35 float k1, float k2, float k3, float
k4, | |
| 36 bool enforcePMColor, const GrFragme
ntProcessor* dst) { | 35 bool enforcePMColor, const GrFragme
ntProcessor* dst) { |
| 37 return new GrArithmeticFP(procDataManager, k1, k2, k3, k4, enforcePMColo
r, dst); | 36 return new GrArithmeticFP(k1, k2, k3, k4, enforcePMColor, dst); |
| 38 } | 37 } |
| 39 | 38 |
| 40 ~GrArithmeticFP() override {}; | 39 ~GrArithmeticFP() override {}; |
| 41 | 40 |
| 42 const char* name() const override { return "Arithmetic"; } | 41 const char* name() const override { return "Arithmetic"; } |
| 43 | 42 |
| 44 float k1() const { return fK1; } | 43 float k1() const { return fK1; } |
| 45 float k2() const { return fK2; } | 44 float k2() const { return fK2; } |
| 46 float k3() const { return fK3; } | 45 float k3() const { return fK3; } |
| 47 float k4() const { return fK4; } | 46 float k4() const { return fK4; } |
| 48 bool enforcePMColor() const { return fEnforcePMColor; } | 47 bool enforcePMColor() const { return fEnforcePMColor; } |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 GrGLFragmentProcessor* onCreateGLInstance() const override; | 50 GrGLFragmentProcessor* onCreateGLInstance() const override; |
| 52 | 51 |
| 53 void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c
onst override; | 52 void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c
onst override; |
| 54 | 53 |
| 55 bool onIsEqual(const GrFragmentProcessor&) const override; | 54 bool onIsEqual(const GrFragmentProcessor&) const override; |
| 56 | 55 |
| 57 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 56 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
| 58 | 57 |
| 59 GrArithmeticFP(GrProcessorDataManager*, float k1, float k2, float k3, float
k4, | 58 GrArithmeticFP(float k1, float k2, float k3, float k4, bool enforcePMColor, |
| 60 bool enforcePMColor, const GrFragmentProcessor* dst); | 59 const GrFragmentProcessor* dst); |
| 61 | 60 |
| 62 float fK1, fK2, fK3, fK4; | 61 float fK1, fK2, fK3, fK4; |
| 63 bool fEnforcePMColor; | 62 bool fEnforcePMColor; |
| 64 | 63 |
| 65 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 64 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 66 typedef GrFragmentProcessor INHERITED; | 65 typedef GrFragmentProcessor INHERITED; |
| 67 }; | 66 }; |
| 68 | 67 |
| 69 /////////////////////////////////////////////////////////////////////////////// | 68 /////////////////////////////////////////////////////////////////////////////// |
| 70 // Xfer Processor | 69 // Xfer Processor |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 GR_DECLARE_XP_FACTORY_TEST; | 113 GR_DECLARE_XP_FACTORY_TEST; |
| 115 | 114 |
| 116 float fK1, fK2, fK3, fK4; | 115 float fK1, fK2, fK3, fK4; |
| 117 bool fEnforcePMColor; | 116 bool fEnforcePMColor; |
| 118 | 117 |
| 119 typedef GrXPFactory INHERITED; | 118 typedef GrXPFactory INHERITED; |
| 120 }; | 119 }; |
| 121 | 120 |
| 122 #endif | 121 #endif |
| 123 #endif | 122 #endif |
| OLD | NEW |