OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrConvolutionEffect_DEFINED | 8 #ifndef GrConvolutionEffect_DEFINED |
9 #define GrConvolutionEffect_DEFINED | 9 #define GrConvolutionEffect_DEFINED |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 public: | 21 public: |
22 | 22 |
23 /// Convolve with an arbitrary user-specified kernel | 23 /// Convolve with an arbitrary user-specified kernel |
24 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, | 24 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, |
25 GrTexture* tex, | 25 GrTexture* tex, |
26 Direction dir, | 26 Direction dir, |
27 int halfWidth, | 27 int halfWidth, |
28 const float* kernel, | 28 const float* kernel, |
29 bool useBounds, | 29 bool useBounds, |
30 float bounds[2]) { | 30 float bounds[2]) { |
31 return SkNEW_ARGS(GrConvolutionEffect, (procDataManager, | 31 return new GrConvolutionEffect(procDataManager, tex, dir, halfWidth, ker
nel, useBounds, |
32 tex, | 32 bounds); |
33 dir, | |
34 halfWidth, | |
35 kernel, | |
36 useBounds, | |
37 bounds)); | |
38 } | 33 } |
39 | 34 |
40 /// Convolve with a Gaussian kernel | 35 /// Convolve with a Gaussian kernel |
41 static GrFragmentProcessor* CreateGaussian(GrProcessorDataManager* procDataM
anager, | 36 static GrFragmentProcessor* CreateGaussian(GrProcessorDataManager* procDataM
anager, |
42 GrTexture* tex, | 37 GrTexture* tex, |
43 Direction dir, | 38 Direction dir, |
44 int halfWidth, | 39 int halfWidth, |
45 float gaussianSigma, | 40 float gaussianSigma, |
46 bool useBounds, | 41 bool useBounds, |
47 float bounds[2]) { | 42 float bounds[2]) { |
48 return SkNEW_ARGS(GrConvolutionEffect, (procDataManager, | 43 return new GrConvolutionEffect(procDataManager, tex, dir, halfWidth, gau
ssianSigma, |
49 tex, | 44 useBounds, bounds); |
50 dir, | |
51 halfWidth, | |
52 gaussianSigma, | |
53 useBounds, | |
54 bounds)); | |
55 } | 45 } |
56 | 46 |
57 virtual ~GrConvolutionEffect(); | 47 virtual ~GrConvolutionEffect(); |
58 | 48 |
59 const float* kernel() const { return fKernel; } | 49 const float* kernel() const { return fKernel; } |
60 | 50 |
61 const float* bounds() const { return fBounds; } | 51 const float* bounds() const { return fBounds; } |
62 bool useBounds() const { return fUseBounds; } | 52 bool useBounds() const { return fUseBounds; } |
63 | 53 |
64 const char* name() const override { return "Convolution"; } | 54 const char* name() const override { return "Convolution"; } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // kernel values. | 97 // kernel values. |
108 inout->mulByUnknownFourComponents(); | 98 inout->mulByUnknownFourComponents(); |
109 } | 99 } |
110 | 100 |
111 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 101 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
112 | 102 |
113 typedef Gr1DKernelEffect INHERITED; | 103 typedef Gr1DKernelEffect INHERITED; |
114 }; | 104 }; |
115 | 105 |
116 #endif | 106 #endif |
OLD | NEW |