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

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

Issue 1443743002: Rename some processor functions from GL to GLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@primProcs
Patch Set: nits Created 5 years, 1 month 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/GrConvolutionEffect.h ('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 "glsl/GrGLSLFragmentProcessor.h" 9 #include "glsl/GrGLSLFragmentProcessor.h"
10 #include "glsl/GrGLSLFragmentShaderBuilder.h" 10 #include "glsl/GrGLSLFragmentShaderBuilder.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 float scale = 1.0f / sum; 187 float scale = 1.0f / sum;
188 for (int i = 0; i < width; ++i) { 188 for (int i = 0; i < width; ++i) {
189 fKernel[i] *= scale; 189 fKernel[i] *= scale;
190 } 190 }
191 memcpy(fBounds, bounds, sizeof(fBounds)); 191 memcpy(fBounds, bounds, sizeof(fBounds));
192 } 192 }
193 193
194 GrConvolutionEffect::~GrConvolutionEffect() { 194 GrConvolutionEffect::~GrConvolutionEffect() {
195 } 195 }
196 196
197 void GrConvolutionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, 197 void GrConvolutionEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
198 GrProcessorKeyBuilder* b) const { 198 GrProcessorKeyBuilder* b) const {
199 GrGLConvolutionEffect::GenKey(*this, caps, b); 199 GrGLConvolutionEffect::GenKey(*this, caps, b);
200 } 200 }
201 201
202 GrGLSLFragmentProcessor* GrConvolutionEffect::onCreateGLInstance() const { 202 GrGLSLFragmentProcessor* GrConvolutionEffect::onCreateGLSLInstance() const {
203 return new GrGLConvolutionEffect(*this); 203 return new GrGLConvolutionEffect(*this);
204 } 204 }
205 205
206 bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const { 206 bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
207 const GrConvolutionEffect& s = sBase.cast<GrConvolutionEffect>(); 207 const GrConvolutionEffect& s = sBase.cast<GrConvolutionEffect>();
208 return (this->radius() == s.radius() && 208 return (this->radius() == s.radius() &&
209 this->direction() == s.direction() && 209 this->direction() == s.direction() &&
210 this->useBounds() == s.useBounds() && 210 this->useBounds() == s.useBounds() &&
211 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && 211 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) &&
212 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); 212 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float)));
(...skipping 18 matching lines...) Expand all
231 } 231 }
232 232
233 bool useBounds = d->fRandom->nextBool(); 233 bool useBounds = d->fRandom->nextBool();
234 return GrConvolutionEffect::Create(d->fTextures[texIdx], 234 return GrConvolutionEffect::Create(d->fTextures[texIdx],
235 dir, 235 dir,
236 radius, 236 radius,
237 kernel, 237 kernel,
238 useBounds, 238 useBounds,
239 bounds); 239 bounds);
240 } 240 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.h ('k') | src/gpu/effects/GrCoverageSetOpXP.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698