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 #include "GrConvolutionEffect.h" | 8 #include "GrConvolutionEffect.h" |
9 #include "gl/GrGLEffect.h" | 9 #include "gl/GrGLEffect.h" |
10 #include "gl/GrGLEffectMatrix.h" | 10 #include "gl/GrGLEffectMatrix.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 this->direction() == s.direction() && | 176 this->direction() == s.direction() && |
177 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); | 177 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); |
178 } | 178 } |
179 | 179 |
180 /////////////////////////////////////////////////////////////////////////////// | 180 /////////////////////////////////////////////////////////////////////////////// |
181 | 181 |
182 GR_DEFINE_EFFECT_TEST(GrConvolutionEffect); | 182 GR_DEFINE_EFFECT_TEST(GrConvolutionEffect); |
183 | 183 |
184 GrEffectRef* GrConvolutionEffect::TestCreate(SkMWCRandom* random, | 184 GrEffectRef* GrConvolutionEffect::TestCreate(SkMWCRandom* random, |
185 GrContext*, | 185 GrContext*, |
| 186 const GrDrawTargetCaps&, |
186 GrTexture* textures[]) { | 187 GrTexture* textures[]) { |
187 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 188 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
188 GrEffectUnitTest::kAlphaTextureIdx; | 189 GrEffectUnitTest::kAlphaTextureIdx; |
189 Direction dir = random->nextBool() ? kX_Direction : kY_Direction; | 190 Direction dir = random->nextBool() ? kX_Direction : kY_Direction; |
190 int radius = random->nextRangeU(1, kMaxKernelRadius); | 191 int radius = random->nextRangeU(1, kMaxKernelRadius); |
191 float kernel[kMaxKernelRadius]; | 192 float kernel[kMaxKernelRadius]; |
192 for (int i = 0; i < kMaxKernelRadius; ++i) { | 193 for (int i = 0; i < kMaxKernelRadius; ++i) { |
193 kernel[i] = random->nextSScalar1(); | 194 kernel[i] = random->nextSScalar1(); |
194 } | 195 } |
195 | 196 |
196 return GrConvolutionEffect::Create(textures[texIdx], dir, radius,kernel); | 197 return GrConvolutionEffect::Create(textures[texIdx], dir, radius,kernel); |
197 } | 198 } |
OLD | NEW |