| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 virtual ~GrConvolutionEffect(); | 53 virtual ~GrConvolutionEffect(); |
| 54 | 54 |
| 55 const float* kernel() const { return fKernel; } | 55 const float* kernel() const { return fKernel; } |
| 56 | 56 |
| 57 const float* bounds() const { return fBounds; } | 57 const float* bounds() const { return fBounds; } |
| 58 bool useBounds() const { return fUseBounds; } | 58 bool useBounds() const { return fUseBounds; } |
| 59 | 59 |
| 60 const char* name() const override { return "Convolution"; } | 60 const char* name() const override { return "Convolution"; } |
| 61 | 61 |
| 62 void getGLProcessorKey(const GrGLCaps&, GrProcessorKeyBuilder*) const overri
de; | 62 void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const over
ride; |
| 63 | 63 |
| 64 GrGLFragmentProcessor* createGLInstance() const override; | 64 GrGLFragmentProcessor* createGLInstance() const override; |
| 65 | 65 |
| 66 enum { | 66 enum { |
| 67 // This was decided based on the min allowed value for the max texture | 67 // This was decided based on the min allowed value for the max texture |
| 68 // samples per fragment program run in DX9SM2 (32). A sigma param of 4.0 | 68 // samples per fragment program run in DX9SM2 (32). A sigma param of 4.0 |
| 69 // on a blur filter gives a kernel width of 25 while a sigma of 5.0 | 69 // on a blur filter gives a kernel width of 25 while a sigma of 5.0 |
| 70 // would exceed a 32 wide kernel. | 70 // would exceed a 32 wide kernel. |
| 71 kMaxKernelRadius = 12, | 71 kMaxKernelRadius = 12, |
| 72 // With a C++11 we could have a constexpr version of WidthFromRadius() | 72 // With a C++11 we could have a constexpr version of WidthFromRadius() |
| (...skipping 28 matching lines...) Expand all Loading... |
| 101 // kernel values. | 101 // kernel values. |
| 102 inout->mulByUnknownFourComponents(); | 102 inout->mulByUnknownFourComponents(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 105 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 106 | 106 |
| 107 typedef Gr1DKernelEffect INHERITED; | 107 typedef Gr1DKernelEffect INHERITED; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 #endif | 110 #endif |
| OLD | NEW |