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

Side by Side Diff: src/gpu/effects/GrMatrixConvolutionEffect.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/GrMatrixConvolutionEffect.h ('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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) { 148 for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) {
149 fKernel[i] = SkScalarToFloat(kernel[i]); 149 fKernel[i] = SkScalarToFloat(kernel[i]);
150 } 150 }
151 fKernelOffset[0] = static_cast<float>(kernelOffset.x()); 151 fKernelOffset[0] = static_cast<float>(kernelOffset.x());
152 fKernelOffset[1] = static_cast<float>(kernelOffset.y()); 152 fKernelOffset[1] = static_cast<float>(kernelOffset.y());
153 } 153 }
154 154
155 GrMatrixConvolutionEffect::~GrMatrixConvolutionEffect() { 155 GrMatrixConvolutionEffect::~GrMatrixConvolutionEffect() {
156 } 156 }
157 157
158 void GrMatrixConvolutionEffect::getGLProcessorKey(const GrGLSLCaps& caps, 158 void GrMatrixConvolutionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
159 GrProcessorKeyBuilder* b) cons t { 159 GrProcessorKeyBuilder* b) cons t {
160 GrGLMatrixConvolutionEffect::GenKey(*this, caps, b); 160 GrGLMatrixConvolutionEffect::GenKey(*this, caps, b);
161 } 161 }
162 162
163 GrGLFragmentProcessor* GrMatrixConvolutionEffect::createGLInstance() const { 163 GrGLFragmentProcessor* GrMatrixConvolutionEffect::createGLInstance() const {
164 return SkNEW_ARGS(GrGLMatrixConvolutionEffect, (*this)); 164 return SkNEW_ARGS(GrGLMatrixConvolutionEffect, (*this));
165 } 165 }
166 166
167 bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) cons t { 167 bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) cons t {
168 const GrMatrixConvolutionEffect& s = sBase.cast<GrMatrixConvolutionEffect>() ; 168 const GrMatrixConvolutionEffect& s = sBase.cast<GrMatrixConvolutionEffect>() ;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 d->fTextures[texIdx], 254 d->fTextures[texIdx],
255 bounds, 255 bounds,
256 kernelSize, 256 kernelSize,
257 kernel.get(), 257 kernel.get(),
258 gain, 258 gain,
259 bias, 259 bias,
260 kernelOffset, 260 kernelOffset,
261 tileMode, 261 tileMode,
262 convolveAlpha); 262 convolveAlpha);
263 } 263 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrMatrixConvolutionEffect.h ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698