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

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

Issue 522873005: Move MakeDivByTextureWHMatrix to GrCoordTransform (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/GrBicubicEffect.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.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 "gl/builders/GrGLProgramBuilder.h" 7 #include "gl/builders/GrGLProgramBuilder.h"
8 #include "GrMatrixConvolutionEffect.h" 8 #include "GrMatrixConvolutionEffect.h"
9 #include "gl/GrGLEffect.h" 9 #include "gl/GrGLEffect.h"
10 #include "gl/GrGLSL.h" 10 #include "gl/GrGLSL.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture, 151 GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture,
152 const SkIRect& bounds, 152 const SkIRect& bounds,
153 const SkISize& kernelSize, 153 const SkISize& kernelSize,
154 const SkScalar* kernel, 154 const SkScalar* kernel,
155 SkScalar gain, 155 SkScalar gain,
156 SkScalar bias, 156 SkScalar bias,
157 const SkIPoint& kernelOffse t, 157 const SkIPoint& kernelOffse t,
158 GrTextureDomain::Mode tileM ode, 158 GrTextureDomain::Mode tileM ode,
159 bool convolveAlpha) 159 bool convolveAlpha)
160 : INHERITED(texture, MakeDivByTextureWHMatrix(texture)), 160 : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture)),
161 fKernelSize(kernelSize), 161 fKernelSize(kernelSize),
162 fGain(SkScalarToFloat(gain)), 162 fGain(SkScalarToFloat(gain)),
163 fBias(SkScalarToFloat(bias) / 255.0f), 163 fBias(SkScalarToFloat(bias) / 255.0f),
164 fConvolveAlpha(convolveAlpha), 164 fConvolveAlpha(convolveAlpha),
165 fDomain(GrTextureDomain::MakeTexelDomain(texture, bounds), tileMode) { 165 fDomain(GrTextureDomain::MakeTexelDomain(texture, bounds), tileMode) {
166 for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) { 166 for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) {
167 fKernel[i] = SkScalarToFloat(kernel[i]); 167 fKernel[i] = SkScalarToFloat(kernel[i]);
168 } 168 }
169 fKernelOffset[0] = static_cast<float>(kernelOffset.x()); 169 fKernelOffset[0] = static_cast<float>(kernelOffset.x());
170 fKernelOffset[1] = static_cast<float>(kernelOffset.y()); 170 fKernelOffset[1] = static_cast<float>(kernelOffset.y());
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 return GrMatrixConvolutionEffect::Create(textures[texIdx], 266 return GrMatrixConvolutionEffect::Create(textures[texIdx],
267 bounds, 267 bounds,
268 kernelSize, 268 kernelSize,
269 kernel.get(), 269 kernel.get(),
270 gain, 270 gain,
271 bias, 271 bias,
272 kernelOffset, 272 kernelOffset,
273 tileMode, 273 tileMode,
274 convolveAlpha); 274 convolveAlpha);
275 } 275 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBicubicEffect.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698