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

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

Issue 1266633003: Added registerChild; transforms, textures, glKey automatically handled. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: refactored to onGetGLProcessorKey; removed emitSamplers specialized template; fixed nits Created 5 years, 4 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/GrConvolutionEffect.h ('k') | src/gpu/effects/GrCustomXfermode.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 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::getGLProcessorKey(const GrGLSLCaps& caps, 197 void GrConvolutionEffect::onGetGLProcessorKey(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 GrGLFragmentProcessor* GrConvolutionEffect::createGLInstance() const { 202 GrGLFragmentProcessor* GrConvolutionEffect::createGLInstance() const {
203 return SkNEW_ARGS(GrGLConvolutionEffect, (*this)); 203 return SkNEW_ARGS(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>();
(...skipping 24 matching lines...) Expand all
232 232
233 bool useBounds = d->fRandom->nextBool(); 233 bool useBounds = d->fRandom->nextBool();
234 return GrConvolutionEffect::Create(d->fProcDataManager, 234 return GrConvolutionEffect::Create(d->fProcDataManager,
235 d->fTextures[texIdx], 235 d->fTextures[texIdx],
236 dir, 236 dir,
237 radius, 237 radius,
238 kernel, 238 kernel,
239 useBounds, 239 useBounds,
240 bounds); 240 bounds);
241 } 241 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.h ('k') | src/gpu/effects/GrCustomXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698