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

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

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More progress & refactoring Created 4 years, 5 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/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.h » ('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 "glsl/GrGLSLFragmentProcessor.h" 8 #include "glsl/GrGLSLFragmentProcessor.h"
9 #include "glsl/GrGLSLFragmentShaderBuilder.h" 9 #include "glsl/GrGLSLFragmentShaderBuilder.h"
10 #include "glsl/GrGLSLProgramDataManager.h" 10 #include "glsl/GrGLSLProgramDataManager.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture, 149 GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture,
150 const SkIRect& bounds, 150 const SkIRect& bounds,
151 const SkISize& kernelSize, 151 const SkISize& kernelSize,
152 const SkScalar* kernel, 152 const SkScalar* kernel,
153 SkScalar gain, 153 SkScalar gain,
154 SkScalar bias, 154 SkScalar bias,
155 const SkIPoint& kernelOffse t, 155 const SkIPoint& kernelOffse t,
156 GrTextureDomain::Mode tileM ode, 156 GrTextureDomain::Mode tileM ode,
157 bool convolveAlpha) 157 bool convolveAlpha)
158 : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture)), 158 : INHERITED(texture, nullptr, GrCoordTransform::MakeDivByTextureWHMatrix(textu re)),
159 fKernelSize(kernelSize), 159 fKernelSize(kernelSize),
160 fGain(SkScalarToFloat(gain)), 160 fGain(SkScalarToFloat(gain)),
161 fBias(SkScalarToFloat(bias) / 255.0f), 161 fBias(SkScalarToFloat(bias) / 255.0f),
162 fConvolveAlpha(convolveAlpha), 162 fConvolveAlpha(convolveAlpha),
163 fDomain(GrTextureDomain::MakeTexelDomainForMode(texture, bounds, tileMode), tileMode) { 163 fDomain(GrTextureDomain::MakeTexelDomainForMode(texture, bounds, tileMode), tileMode) {
164 this->initClassID<GrMatrixConvolutionEffect>(); 164 this->initClassID<GrMatrixConvolutionEffect>();
165 for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) { 165 for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) {
166 fKernel[i] = SkScalarToFloat(kernel[i]); 166 fKernel[i] = SkScalarToFloat(kernel[i]);
167 } 167 }
168 fKernelOffset[0] = static_cast<float>(kernelOffset.x()); 168 fKernelOffset[0] = static_cast<float>(kernelOffset.x());
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return GrMatrixConvolutionEffect::Make(d->fTextures[texIdx], 259 return GrMatrixConvolutionEffect::Make(d->fTextures[texIdx],
260 bounds, 260 bounds,
261 kernelSize, 261 kernelSize,
262 kernel.get(), 262 kernel.get(),
263 gain, 263 gain,
264 bias, 264 bias,
265 kernelOffset, 265 kernelOffset,
266 tileMode, 266 tileMode,
267 convolveAlpha); 267 convolveAlpha);
268 } 268 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698