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 GrCircleBlurFragmentProcessor_DEFINED | 8 #ifndef GrCircleBlurFragmentProcessor_DEFINED |
9 #define GrCircleBlurFragmentProcessor_DEFINED | 9 #define GrCircleBlurFragmentProcessor_DEFINED |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 GrCircleBlurFragmentProcessor(const SkRect& circle, float sigma, | 57 GrCircleBlurFragmentProcessor(const SkRect& circle, float sigma, |
58 float offset, GrTexture* blurProfile); | 58 float offset, GrTexture* blurProfile); |
59 | 59 |
60 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; | 60 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
61 | 61 |
62 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b)
const override; | 62 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b)
const override; |
63 | 63 |
64 bool onIsEqual(const GrFragmentProcessor& other) const override { | 64 bool onIsEqual(const GrFragmentProcessor& other) const override { |
65 const GrCircleBlurFragmentProcessor& cbfp = other.cast<GrCircleBlurFragm
entProcessor>(); | 65 const GrCircleBlurFragmentProcessor& cbfp = other.cast<GrCircleBlurFragm
entProcessor>(); |
66 // fOffset is computed from the circle width and the sigma | 66 // fOffset is computed from the circle width and the sigma |
67 return this->circle().width() == cbfp.circle().width() && fSigma == cbfp
.fSigma; | 67 return this->circle() == cbfp.circle() && fSigma == cbfp.fSigma; |
68 } | 68 } |
69 | 69 |
70 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 70 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
71 | 71 |
72 static GrTexture* CreateCircleBlurProfileTexture(GrTextureProvider*, | 72 static GrTexture* CreateCircleBlurProfileTexture(GrTextureProvider*, |
73 const SkRect& circle, | 73 const SkRect& circle, |
74 float sigma, float* offset)
; | 74 float sigma, float* offset)
; |
75 | 75 |
76 SkRect fCircle; | 76 SkRect fCircle; |
77 float fSigma; | 77 float fSigma; |
78 float fOffset; | 78 float fOffset; |
79 GrTextureAccess fBlurProfileAccess; | 79 GrTextureAccess fBlurProfileAccess; |
80 | 80 |
81 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 81 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
82 | 82 |
83 typedef GrFragmentProcessor INHERITED; | 83 typedef GrFragmentProcessor INHERITED; |
84 }; | 84 }; |
85 | 85 |
86 #endif | 86 #endif |
87 #endif | 87 #endif |
OLD | NEW |