| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 this->radius() == s.radius() && | 172 this->radius() == s.radius() && |
| 173 this->direction() == s.direction() && | 173 this->direction() == s.direction() && |
| 174 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); | 174 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); |
| 175 } | 175 } |
| 176 | 176 |
| 177 /////////////////////////////////////////////////////////////////////////////// | 177 /////////////////////////////////////////////////////////////////////////////// |
| 178 | 178 |
| 179 GR_DEFINE_EFFECT_TEST(GrConvolutionEffect); | 179 GR_DEFINE_EFFECT_TEST(GrConvolutionEffect); |
| 180 | 180 |
| 181 GrEffectRef* GrConvolutionEffect::TestCreate(SkMWCRandom* random, | 181 GrEffectRef* GrConvolutionEffect::TestCreate(SkMWCRandom* random, |
| 182 GrContext* context, | 182 GrContext*, |
| 183 GrTexture* textures[]) { | 183 GrTexture* textures[]) { |
| 184 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 184 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
| 185 GrEffectUnitTest::kAlphaTextureIdx; | 185 GrEffectUnitTest::kAlphaTextureIdx; |
| 186 Direction dir = random->nextBool() ? kX_Direction : kY_Direction; | 186 Direction dir = random->nextBool() ? kX_Direction : kY_Direction; |
| 187 int radius = random->nextRangeU(1, kMaxKernelRadius); | 187 int radius = random->nextRangeU(1, kMaxKernelRadius); |
| 188 float kernel[kMaxKernelRadius]; | 188 float kernel[kMaxKernelRadius]; |
| 189 for (int i = 0; i < kMaxKernelRadius; ++i) { | 189 for (int i = 0; i < kMaxKernelRadius; ++i) { |
| 190 kernel[i] = random->nextSScalar1(); | 190 kernel[i] = random->nextSScalar1(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 return GrConvolutionEffect::Create(textures[texIdx], dir, radius,kernel); | 193 return GrConvolutionEffect::Create(textures[texIdx], dir, radius,kernel); |
| 194 } | 194 } |
| OLD | NEW |