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

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

Issue 418223009: 2D kernel initial wiring for Guassian (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/effects/SkGpuBlurUtils.cpp ('k') | src/gpu/effects/GrMatrixConvolutionEffect.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 7
8 #ifndef GrMatrixConvolutionEffect_DEFINED 8 #ifndef GrMatrixConvolutionEffect_DEFINED
9 #define GrMatrixConvolutionEffect_DEFINED 9 #define GrMatrixConvolutionEffect_DEFINED
10 10
(...skipping 20 matching lines...) Expand all
31 return SkNEW_ARGS(GrMatrixConvolutionEffect, (texture, 31 return SkNEW_ARGS(GrMatrixConvolutionEffect, (texture,
32 bounds, 32 bounds,
33 kernelSize, 33 kernelSize,
34 kernel, 34 kernel,
35 gain, 35 gain,
36 bias, 36 bias,
37 kernelOffset, 37 kernelOffset,
38 tileMode, 38 tileMode,
39 convolveAlpha)); 39 convolveAlpha));
40 } 40 }
41
42 static GrEffect* CreateGaussian(GrTexture* texture,
43 const SkIRect& bounds,
44 const SkISize& kernelSize,
45 SkScalar gain,
46 SkScalar bias,
47 const SkIPoint& kernelOffset,
48 GrTextureDomain::Mode tileMode,
49 bool convolveAlpha,
50 SkScalar sigmaX,
51 SkScalar sigmaY);
52
41 virtual ~GrMatrixConvolutionEffect(); 53 virtual ~GrMatrixConvolutionEffect();
42 54
43 virtual void getConstantColorComponents(GrColor* color, 55 virtual void getConstantColorComponents(GrColor* color,
44 uint32_t* validFlags) const SK_OVERR IDE { 56 uint32_t* validFlags) const SK_OVERR IDE {
45 // TODO: Try to do better? 57 // TODO: Try to do better?
46 *validFlags = 0; 58 *validFlags = 0;
47 } 59 }
48 60
49 static const char* Name() { return "MatrixConvolution"; } 61 static const char* Name() { return "MatrixConvolution"; }
50 const SkIRect& bounds() const { return fBounds; } 62 const SkIRect& bounds() const { return fBounds; }
(...skipping 17 matching lines...) Expand all
68 SkScalar gain, 80 SkScalar gain,
69 SkScalar bias, 81 SkScalar bias,
70 const SkIPoint& kernelOffset, 82 const SkIPoint& kernelOffset,
71 GrTextureDomain::Mode tileMode, 83 GrTextureDomain::Mode tileMode,
72 bool convolveAlpha); 84 bool convolveAlpha);
73 85
74 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; 86 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE;
75 87
76 SkIRect fBounds; 88 SkIRect fBounds;
77 SkISize fKernelSize; 89 SkISize fKernelSize;
78 float* fKernel; 90 float fKernel[MAX_KERNEL_SIZE];
79 float fGain; 91 float fGain;
80 float fBias; 92 float fBias;
81 float fKernelOffset[2]; 93 float fKernelOffset[2];
82 bool fConvolveAlpha; 94 bool fConvolveAlpha;
83 GrTextureDomain fDomain; 95 GrTextureDomain fDomain;
84 96
85 GR_DECLARE_EFFECT_TEST; 97 GR_DECLARE_EFFECT_TEST;
86 98
87 typedef GrSingleTextureEffect INHERITED; 99 typedef GrSingleTextureEffect INHERITED;
88 }; 100 };
89 101
90 #endif 102 #endif
OLDNEW
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/gpu/effects/GrMatrixConvolutionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698