| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "GrMatrixConvolutionEffect.h" | 7 #include "GrMatrixConvolutionEffect.h" |
| 8 #include "gl/GrGLProcessor.h" | 8 #include "gl/GrGLProcessor.h" |
| 9 #include "gl/GrGLSL.h" | 9 #include "gl/GrGLSL.h" |
| 10 #include "gl/GrGLTexture.h" | 10 #include "gl/GrGLTexture.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 bias, | 232 bias, |
| 233 kernelOffset, | 233 kernelOffset, |
| 234 tileMode, | 234 tileMode, |
| 235 convolveAlpha)); | 235 convolveAlpha)); |
| 236 } | 236 } |
| 237 | 237 |
| 238 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMatrixConvolutionEffect); | 238 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMatrixConvolutionEffect); |
| 239 | 239 |
| 240 GrFragmentProcessor* GrMatrixConvolutionEffect::TestCreate(SkRandom* random, | 240 GrFragmentProcessor* GrMatrixConvolutionEffect::TestCreate(SkRandom* random, |
| 241 GrContext* context, | 241 GrContext* context, |
| 242 const GrDrawTargetCap
s&, | 242 const GrCaps&, |
| 243 GrTexture* textures[]
) { | 243 GrTexture* textures[]
) { |
| 244 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : | 244 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : |
| 245 GrProcessorUnitTest::kAlphaTextureIdx; | 245 GrProcessorUnitTest::kAlphaTextureIdx; |
| 246 int width = random->nextRangeU(1, MAX_KERNEL_SIZE); | 246 int width = random->nextRangeU(1, MAX_KERNEL_SIZE); |
| 247 int height = random->nextRangeU(1, MAX_KERNEL_SIZE / width); | 247 int height = random->nextRangeU(1, MAX_KERNEL_SIZE / width); |
| 248 SkISize kernelSize = SkISize::Make(width, height); | 248 SkISize kernelSize = SkISize::Make(width, height); |
| 249 SkAutoTDeleteArray<SkScalar> kernel(new SkScalar[width * height]); | 249 SkAutoTDeleteArray<SkScalar> kernel(new SkScalar[width * height]); |
| 250 for (int i = 0; i < width * height; i++) { | 250 for (int i = 0; i < width * height; i++) { |
| 251 kernel.get()[i] = random->nextSScalar1(); | 251 kernel.get()[i] = random->nextSScalar1(); |
| 252 } | 252 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 263 return GrMatrixConvolutionEffect::Create(textures[texIdx], | 263 return GrMatrixConvolutionEffect::Create(textures[texIdx], |
| 264 bounds, | 264 bounds, |
| 265 kernelSize, | 265 kernelSize, |
| 266 kernel.get(), | 266 kernel.get(), |
| 267 gain, | 267 gain, |
| 268 bias, | 268 bias, |
| 269 kernelOffset, | 269 kernelOffset, |
| 270 tileMode, | 270 tileMode, |
| 271 convolveAlpha); | 271 convolveAlpha); |
| 272 } | 272 } |
| OLD | NEW |