Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: src/gpu/effects/GrMatrixConvolutionEffect.cpp

Issue 1316513002: Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: Address comments, fix roll(?) Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/GrGLFragmentProcessor.h" 8 #include "gl/GrGLFragmentProcessor.h"
9 #include "gl/GrGLTexture.h" 9 #include "gl/GrGLTexture.h"
10 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 float scale = 1.0f / sum; 215 float scale = 1.0f / sum;
216 for (int i = 0; i < width * height; ++i) { 216 for (int i = 0; i < width * height; ++i) {
217 kernel[i] *= scale; 217 kernel[i] *= scale;
218 } 218 }
219 return new GrMatrixConvolutionEffect(procDataManager, texture, bounds, kerne lSize, kernel, gain, 219 return new GrMatrixConvolutionEffect(procDataManager, texture, bounds, kerne lSize, kernel, gain,
220 bias, kernelOffset, tileMode, convolveA lpha); 220 bias, kernelOffset, tileMode, convolveA lpha);
221 } 221 }
222 222
223 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMatrixConvolutionEffect); 223 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMatrixConvolutionEffect);
224 224
225 GrFragmentProcessor* GrMatrixConvolutionEffect::TestCreate(GrProcessorTestData* d) { 225 const GrFragmentProcessor* GrMatrixConvolutionEffect::TestCreate(GrProcessorTest Data* d) {
226 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : 226 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
227 GrProcessorUnitTest::kAlphaTextureIdx; 227 GrProcessorUnitTest::kAlphaTextureIdx;
228 int width = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE); 228 int width = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE);
229 int height = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE / width); 229 int height = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE / width);
230 SkISize kernelSize = SkISize::Make(width, height); 230 SkISize kernelSize = SkISize::Make(width, height);
231 SkAutoTDeleteArray<SkScalar> kernel(new SkScalar[width * height]); 231 SkAutoTDeleteArray<SkScalar> kernel(new SkScalar[width * height]);
232 for (int i = 0; i < width * height; i++) { 232 for (int i = 0; i < width * height; i++) {
233 kernel.get()[i] = d->fRandom->nextSScalar1(); 233 kernel.get()[i] = d->fRandom->nextSScalar1();
234 } 234 }
235 SkScalar gain = d->fRandom->nextSScalar1(); 235 SkScalar gain = d->fRandom->nextSScalar1();
(...skipping 11 matching lines...) Expand all
247 d->fTextures[texIdx], 247 d->fTextures[texIdx],
248 bounds, 248 bounds,
249 kernelSize, 249 kernelSize,
250 kernel.get(), 250 kernel.get(),
251 gain, 251 gain,
252 bias, 252 bias,
253 kernelOffset, 253 kernelOffset,
254 tileMode, 254 tileMode,
255 convolveAlpha); 255 convolveAlpha);
256 } 256 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698