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

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

Issue 1313573005: Revert of Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: 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/GrConvexPolyEffect.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.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 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/GrGLFragmentProcessor.h" 9 #include "gl/GrGLFragmentProcessor.h"
10 #include "gl/GrGLTexture.h" 10 #include "gl/GrGLTexture.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 this->direction() == s.direction() && 210 this->direction() == s.direction() &&
211 this->useBounds() == s.useBounds() && 211 this->useBounds() == s.useBounds() &&
212 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && 212 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) &&
213 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); 213 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float)));
214 } 214 }
215 215
216 /////////////////////////////////////////////////////////////////////////////// 216 ///////////////////////////////////////////////////////////////////////////////
217 217
218 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConvolutionEffect); 218 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConvolutionEffect);
219 219
220 const GrFragmentProcessor* GrConvolutionEffect::TestCreate(GrProcessorTestData* d) { 220 GrFragmentProcessor* GrConvolutionEffect::TestCreate(GrProcessorTestData* d) {
221 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : 221 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
222 GrProcessorUnitTest::kAlphaTextureIdx; 222 GrProcessorUnitTest::kAlphaTextureIdx;
223 Direction dir = d->fRandom->nextBool() ? kX_Direction : kY_Direction; 223 Direction dir = d->fRandom->nextBool() ? kX_Direction : kY_Direction;
224 int radius = d->fRandom->nextRangeU(1, kMaxKernelRadius); 224 int radius = d->fRandom->nextRangeU(1, kMaxKernelRadius);
225 float kernel[kMaxKernelWidth]; 225 float kernel[kMaxKernelWidth];
226 for (size_t i = 0; i < SK_ARRAY_COUNT(kernel); ++i) { 226 for (size_t i = 0; i < SK_ARRAY_COUNT(kernel); ++i) {
227 kernel[i] = d->fRandom->nextSScalar1(); 227 kernel[i] = d->fRandom->nextSScalar1();
228 } 228 }
229 float bounds[2]; 229 float bounds[2];
230 for (size_t i = 0; i < SK_ARRAY_COUNT(bounds); ++i) { 230 for (size_t i = 0; i < SK_ARRAY_COUNT(bounds); ++i) {
231 bounds[i] = d->fRandom->nextF(); 231 bounds[i] = d->fRandom->nextF();
232 } 232 }
233 233
234 bool useBounds = d->fRandom->nextBool(); 234 bool useBounds = d->fRandom->nextBool();
235 return GrConvolutionEffect::Create(d->fProcDataManager, 235 return GrConvolutionEffect::Create(d->fProcDataManager,
236 d->fTextures[texIdx], 236 d->fTextures[texIdx],
237 dir, 237 dir,
238 radius, 238 radius,
239 kernel, 239 kernel,
240 useBounds, 240 useBounds,
241 bounds); 241 bounds);
242 } 242 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvexPolyEffect.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698