tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "GrConvolutionEffect.h" |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 9 | #include "glsl/GrGLSLFragmentProcessor.h" |
egdaniel | 2d721d3 | 2015-11-11 13:06:05 -0800 | [diff] [blame] | 10 | #include "glsl/GrGLSLFragmentShaderBuilder.h" |
egdaniel | 018fb62 | 2015-10-28 07:26:40 -0700 | [diff] [blame] | 11 | #include "glsl/GrGLSLProgramDataManager.h" |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 12 | #include "glsl/GrGLSLUniformHandler.h" |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 13 | |
bsalomon@google.com | dbbc4e2 | 2012-07-25 17:48:39 +0000 | [diff] [blame] | 14 | // For brevity |
egdaniel | 018fb62 | 2015-10-28 07:26:40 -0700 | [diff] [blame] | 15 | typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; |
bsalomon@google.com | 032b221 | 2012-07-16 13:36:18 +0000 | [diff] [blame] | 16 | |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 17 | class GrGLConvolutionEffect : public GrGLSLFragmentProcessor { |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 18 | public: |
robertphillips | 9cdb992 | 2016-02-03 12:25:40 -0800 | [diff] [blame] | 19 | void emitCode(EmitArgs&) override; |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 20 | |
jvanverth | cfc1886 | 2015-04-28 08:48:20 -0700 | [diff] [blame] | 21 | static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*); |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 22 | |
wangyix | b1daa86 | 2015-08-18 11:29:31 -0700 | [diff] [blame] | 23 | protected: |
egdaniel | 018fb62 | 2015-10-28 07:26:40 -0700 | [diff] [blame] | 24 | void onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor&) override; |
wangyix | b1daa86 | 2015-08-18 11:29:31 -0700 | [diff] [blame] | 25 | |
ericrk | 0f38612 | 2015-07-21 13:15:47 -0700 | [diff] [blame] | 26 | private: |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 27 | UniformHandle fKernelUni; |
| 28 | UniformHandle fImageIncrementUni; |
| 29 | UniformHandle fBoundsUni; |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 30 | |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 31 | typedef GrGLSLFragmentProcessor INHERITED; |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 32 | }; |
| 33 | |
wangyix | 7c157a9 | 2015-07-22 15:08:53 -0700 | [diff] [blame] | 34 | void GrGLConvolutionEffect::emitCode(EmitArgs& args) { |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 35 | const GrConvolutionEffect& ce = args.fFp.cast<GrConvolutionEffect>(); |
| 36 | |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 37 | GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
| 38 | fImageIncrementUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
| 39 | kVec2f_GrSLType, kDefault_GrSLPrecision, |
| 40 | "ImageIncrement"); |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 41 | if (ce.useBounds()) { |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 42 | fBoundsUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
| 43 | kVec2f_GrSLType, kDefault_GrSLPrecision, |
| 44 | "Bounds"); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 45 | } |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 46 | |
| 47 | int width = Gr1DKernelEffect::WidthFromRadius(ce.radius()); |
| 48 | |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 49 | fKernelUni = uniformHandler->addUniformArray(GrGLSLUniformHandler::kFragment_Visibility, |
| 50 | kFloat_GrSLType, kDefault_GrSLPrecision, |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 51 | "Kernel", width); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 52 | |
egdaniel | 4ca2e60 | 2015-11-18 08:01:26 -0800 | [diff] [blame] | 53 | GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; |
| 54 | SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 55 | |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 56 | fragBuilder->codeAppendf("%s = vec4(0, 0, 0, 0);", args.fOutputColor); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 57 | |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 58 | const GrGLSLShaderVar& kernel = uniformHandler->getUniformVariable(fKernelUni); |
| 59 | const char* imgInc = uniformHandler->getUniformCStr(fImageIncrementUni); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 60 | |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 61 | fragBuilder->codeAppendf("vec2 coord = %s - %d.0 * %s;", coords2D.c_str(), ce.radius(), imgInc); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 62 | |
| 63 | // Manually unroll loop because some drivers don't; yields 20-30% speedup. |
| 64 | for (int i = 0; i < width; i++) { |
| 65 | SkString index; |
| 66 | SkString kernelIndex; |
| 67 | index.appendS32(i); |
| 68 | kernel.appendArrayAccess(index.c_str(), &kernelIndex); |
| 69 | |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 70 | if (ce.useBounds()) { |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 71 | // We used to compute a bool indicating whether we're in bounds or not, cast it to a |
| 72 | // float, and then mul weight*texture_sample by the float. However, the Adreno 430 seems |
| 73 | // to have a bug that caused corruption. |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 74 | const char* bounds = uniformHandler->getUniformCStr(fBoundsUni); |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 75 | const char* component = ce.direction() == Gr1DKernelEffect::kY_Direction ? "y" : "x"; |
egdaniel | 4ca2e60 | 2015-11-18 08:01:26 -0800 | [diff] [blame] | 76 | fragBuilder->codeAppendf("if (coord.%s >= %s.x && coord.%s <= %s.y) {", |
| 77 | component, bounds, component, bounds); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 78 | } |
egdaniel | 4ca2e60 | 2015-11-18 08:01:26 -0800 | [diff] [blame] | 79 | fragBuilder->codeAppendf("\t\t%s += ", args.fOutputColor); |
| 80 | fragBuilder->appendTextureLookup(args.fSamplers[0], "coord"); |
| 81 | fragBuilder->codeAppendf(" * %s;\n", kernelIndex.c_str()); |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 82 | if (ce.useBounds()) { |
egdaniel | 4ca2e60 | 2015-11-18 08:01:26 -0800 | [diff] [blame] | 83 | fragBuilder->codeAppend("}"); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 84 | } |
egdaniel | 4ca2e60 | 2015-11-18 08:01:26 -0800 | [diff] [blame] | 85 | fragBuilder->codeAppendf("\t\tcoord += %s;\n", imgInc); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | SkString modulate; |
wangyix | 7c157a9 | 2015-07-22 15:08:53 -0700 | [diff] [blame] | 89 | GrGLSLMulVarBy4f(&modulate, args.fOutputColor, args.fInputColor); |
egdaniel | 4ca2e60 | 2015-11-18 08:01:26 -0800 | [diff] [blame] | 90 | fragBuilder->codeAppend(modulate.c_str()); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 91 | } |
| 92 | |
egdaniel | 018fb62 | 2015-10-28 07:26:40 -0700 | [diff] [blame] | 93 | void GrGLConvolutionEffect::onSetData(const GrGLSLProgramDataManager& pdman, |
| 94 | const GrProcessor& processor) { |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 95 | const GrConvolutionEffect& conv = processor.cast<GrConvolutionEffect>(); |
| 96 | GrTexture& texture = *conv.texture(0); |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 97 | |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 98 | float imageIncrement[2] = { 0 }; |
| 99 | float ySign = texture.origin() != kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f; |
| 100 | switch (conv.direction()) { |
| 101 | case Gr1DKernelEffect::kX_Direction: |
| 102 | imageIncrement[0] = 1.0f / texture.width(); |
| 103 | break; |
| 104 | case Gr1DKernelEffect::kY_Direction: |
| 105 | imageIncrement[1] = ySign / texture.height(); |
| 106 | break; |
| 107 | default: |
| 108 | SkFAIL("Unknown filter direction."); |
| 109 | } |
| 110 | pdman.set2fv(fImageIncrementUni, 1, imageIncrement); |
| 111 | if (conv.useBounds()) { |
| 112 | const float* bounds = conv.bounds(); |
| 113 | if (Gr1DKernelEffect::kY_Direction == conv.direction() && |
| 114 | texture.origin() != kTopLeft_GrSurfaceOrigin) { |
| 115 | pdman.set2f(fBoundsUni, 1.0f - bounds[1], 1.0f - bounds[0]); |
| 116 | } else { |
| 117 | pdman.set2f(fBoundsUni, bounds[0], bounds[1]); |
| 118 | } |
| 119 | } |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 120 | int width = Gr1DKernelEffect::WidthFromRadius(conv.radius()); |
| 121 | |
| 122 | pdman.set1fv(fKernelUni, width, conv.kernel()); |
ericrk | 7a787b4 | 2015-07-21 14:06:16 -0700 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | void GrGLConvolutionEffect::GenKey(const GrProcessor& processor, const GrGLSLCaps&, |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 126 | GrProcessorKeyBuilder* b) { |
| 127 | const GrConvolutionEffect& conv = processor.cast<GrConvolutionEffect>(); |
bsalomon | 63e99f7 | 2014-07-21 08:03:14 -0700 | [diff] [blame] | 128 | uint32_t key = conv.radius(); |
senorblanco@chromium.org | e8232bc | 2013-07-29 18:45:44 +0000 | [diff] [blame] | 129 | key <<= 2; |
| 130 | if (conv.useBounds()) { |
| 131 | key |= 0x2; |
| 132 | key |= GrConvolutionEffect::kY_Direction == conv.direction() ? 0x1 : 0x0; |
| 133 | } |
bsalomon | 63e99f7 | 2014-07-21 08:03:14 -0700 | [diff] [blame] | 134 | b->add32(key); |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 135 | } |
| 136 | |
bsalomon@google.com | b505a12 | 2012-05-31 18:40:36 +0000 | [diff] [blame] | 137 | /////////////////////////////////////////////////////////////////////////////// |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 138 | |
bsalomon | 4a33952 | 2015-10-06 08:40:50 -0700 | [diff] [blame] | 139 | GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture, |
tomhudson@google.com | d0c1a06 | 2012-07-12 17:23:52 +0000 | [diff] [blame] | 140 | Direction direction, |
bsalomon@google.com | b505a12 | 2012-05-31 18:40:36 +0000 | [diff] [blame] | 141 | int radius, |
senorblanco@chromium.org | 194d775 | 2013-07-24 22:19:24 +0000 | [diff] [blame] | 142 | const float* kernel, |
senorblanco@chromium.org | e8232bc | 2013-07-29 18:45:44 +0000 | [diff] [blame] | 143 | bool useBounds, |
| 144 | float bounds[2]) |
bsalomon | 4a33952 | 2015-10-06 08:40:50 -0700 | [diff] [blame] | 145 | : INHERITED(texture, direction, radius), fUseBounds(useBounds) { |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 146 | this->initClassID<GrConvolutionEffect>(); |
tfarina@chromium.org | f6de475 | 2013-08-17 00:02:59 +0000 | [diff] [blame] | 147 | SkASSERT(radius <= kMaxKernelRadius); |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 148 | SkASSERT(kernel); |
bsalomon@google.com | b505a12 | 2012-05-31 18:40:36 +0000 | [diff] [blame] | 149 | int width = this->width(); |
bsalomon@google.com | b4a55b7 | 2012-11-02 20:45:37 +0000 | [diff] [blame] | 150 | for (int i = 0; i < width; i++) { |
| 151 | fKernel[i] = kernel[i]; |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 152 | } |
senorblanco@chromium.org | e8232bc | 2013-07-29 18:45:44 +0000 | [diff] [blame] | 153 | memcpy(fBounds, bounds, sizeof(fBounds)); |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 154 | } |
| 155 | |
bsalomon | 4a33952 | 2015-10-06 08:40:50 -0700 | [diff] [blame] | 156 | GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture, |
tomhudson@google.com | fde2c0a | 2012-07-16 12:23:32 +0000 | [diff] [blame] | 157 | Direction direction, |
| 158 | int radius, |
senorblanco@chromium.org | 194d775 | 2013-07-24 22:19:24 +0000 | [diff] [blame] | 159 | float gaussianSigma, |
senorblanco@chromium.org | e8232bc | 2013-07-29 18:45:44 +0000 | [diff] [blame] | 160 | bool useBounds, |
| 161 | float bounds[2]) |
bsalomon | 4a33952 | 2015-10-06 08:40:50 -0700 | [diff] [blame] | 162 | : INHERITED(texture, direction, radius), fUseBounds(useBounds) { |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 163 | this->initClassID<GrConvolutionEffect>(); |
tfarina@chromium.org | f6de475 | 2013-08-17 00:02:59 +0000 | [diff] [blame] | 164 | SkASSERT(radius <= kMaxKernelRadius); |
tomhudson@google.com | fde2c0a | 2012-07-16 12:23:32 +0000 | [diff] [blame] | 165 | int width = this->width(); |
| 166 | |
| 167 | float sum = 0.0f; |
| 168 | float denom = 1.0f / (2.0f * gaussianSigma * gaussianSigma); |
| 169 | for (int i = 0; i < width; ++i) { |
| 170 | float x = static_cast<float>(i - this->radius()); |
| 171 | // Note that the constant term (1/(sqrt(2*pi*sigma^2)) of the Gaussian |
| 172 | // is dropped here, since we renormalize the kernel below. |
| 173 | fKernel[i] = sk_float_exp(- x * x * denom); |
| 174 | sum += fKernel[i]; |
| 175 | } |
| 176 | // Normalize the kernel |
| 177 | float scale = 1.0f / sum; |
| 178 | for (int i = 0; i < width; ++i) { |
| 179 | fKernel[i] *= scale; |
| 180 | } |
senorblanco@chromium.org | e8232bc | 2013-07-29 18:45:44 +0000 | [diff] [blame] | 181 | memcpy(fBounds, bounds, sizeof(fBounds)); |
tomhudson@google.com | fde2c0a | 2012-07-16 12:23:32 +0000 | [diff] [blame] | 182 | } |
| 183 | |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 184 | GrConvolutionEffect::~GrConvolutionEffect() { |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 185 | } |
| 186 | |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame] | 187 | void GrConvolutionEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
| 188 | GrProcessorKeyBuilder* b) const { |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 189 | GrGLConvolutionEffect::GenKey(*this, caps, b); |
| 190 | } |
| 191 | |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame] | 192 | GrGLSLFragmentProcessor* GrConvolutionEffect::onCreateGLSLInstance() const { |
robertphillips | bf536af | 2016-02-04 06:11:53 -0800 | [diff] [blame^] | 193 | return new GrGLConvolutionEffect; |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 194 | } |
| 195 | |
bsalomon | 0e08fc1 | 2014-10-15 08:19:04 -0700 | [diff] [blame] | 196 | bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
joshualitt | 49586be | 2014-09-16 08:21:41 -0700 | [diff] [blame] | 197 | const GrConvolutionEffect& s = sBase.cast<GrConvolutionEffect>(); |
bsalomon | 420d7e9 | 2014-10-16 09:18:09 -0700 | [diff] [blame] | 198 | return (this->radius() == s.radius() && |
tomhudson@google.com | d0c1a06 | 2012-07-12 17:23:52 +0000 | [diff] [blame] | 199 | this->direction() == s.direction() && |
senorblanco@chromium.org | e8232bc | 2013-07-29 18:45:44 +0000 | [diff] [blame] | 200 | this->useBounds() == s.useBounds() && |
| 201 | 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && |
tomhudson@google.com | d0c1a06 | 2012-07-12 17:23:52 +0000 | [diff] [blame] | 202 | 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); |
tomhudson@google.com | d8f856c | 2012-05-10 12:13:36 +0000 | [diff] [blame] | 203 | } |
bsalomon@google.com | 0a7672f | 2012-08-03 18:12:20 +0000 | [diff] [blame] | 204 | |
| 205 | /////////////////////////////////////////////////////////////////////////////// |
| 206 | |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 207 | GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConvolutionEffect); |
bsalomon@google.com | 0a7672f | 2012-08-03 18:12:20 +0000 | [diff] [blame] | 208 | |
bsalomon | c21b09e | 2015-08-28 18:46:56 -0700 | [diff] [blame] | 209 | const GrFragmentProcessor* GrConvolutionEffect::TestCreate(GrProcessorTestData* d) { |
joshualitt | 0067ff5 | 2015-07-08 14:26:19 -0700 | [diff] [blame] | 210 | int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : |
| 211 | GrProcessorUnitTest::kAlphaTextureIdx; |
| 212 | Direction dir = d->fRandom->nextBool() ? kX_Direction : kY_Direction; |
| 213 | int radius = d->fRandom->nextRangeU(1, kMaxKernelRadius); |
bungeman@google.com | 4348663 | 2013-08-20 15:20:34 +0000 | [diff] [blame] | 214 | float kernel[kMaxKernelWidth]; |
| 215 | for (size_t i = 0; i < SK_ARRAY_COUNT(kernel); ++i) { |
joshualitt | 0067ff5 | 2015-07-08 14:26:19 -0700 | [diff] [blame] | 216 | kernel[i] = d->fRandom->nextSScalar1(); |
bsalomon@google.com | 0a7672f | 2012-08-03 18:12:20 +0000 | [diff] [blame] | 217 | } |
senorblanco@chromium.org | e8232bc | 2013-07-29 18:45:44 +0000 | [diff] [blame] | 218 | float bounds[2]; |
bungeman@google.com | 4348663 | 2013-08-20 15:20:34 +0000 | [diff] [blame] | 219 | for (size_t i = 0; i < SK_ARRAY_COUNT(bounds); ++i) { |
joshualitt | 0067ff5 | 2015-07-08 14:26:19 -0700 | [diff] [blame] | 220 | bounds[i] = d->fRandom->nextF(); |
senorblanco@chromium.org | 194d775 | 2013-07-24 22:19:24 +0000 | [diff] [blame] | 221 | } |
bsalomon@google.com | 0a7672f | 2012-08-03 18:12:20 +0000 | [diff] [blame] | 222 | |
joshualitt | 0067ff5 | 2015-07-08 14:26:19 -0700 | [diff] [blame] | 223 | bool useBounds = d->fRandom->nextBool(); |
bsalomon | 4a33952 | 2015-10-06 08:40:50 -0700 | [diff] [blame] | 224 | return GrConvolutionEffect::Create(d->fTextures[texIdx], |
senorblanco@chromium.org | 194d775 | 2013-07-24 22:19:24 +0000 | [diff] [blame] | 225 | dir, |
| 226 | radius, |
| 227 | kernel, |
senorblanco@chromium.org | e8232bc | 2013-07-29 18:45:44 +0000 | [diff] [blame] | 228 | useBounds, |
| 229 | bounds); |
bsalomon@google.com | 0a7672f | 2012-08-03 18:12:20 +0000 | [diff] [blame] | 230 | } |