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

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

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/GrDitherEffect.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const SkISize& kernelSize() const { return fKernelSize; } 58 const SkISize& kernelSize() const { return fKernelSize; }
59 const float* kernelOffset() const { return fKernelOffset; } 59 const float* kernelOffset() const { return fKernelOffset; }
60 const float* kernel() const { return fKernel; } 60 const float* kernel() const { return fKernel; }
61 float gain() const { return fGain; } 61 float gain() const { return fGain; }
62 float bias() const { return fBias; } 62 float bias() const { return fBias; }
63 bool convolveAlpha() const { return fConvolveAlpha; } 63 bool convolveAlpha() const { return fConvolveAlpha; }
64 const GrTextureDomain& domain() const { return fDomain; } 64 const GrTextureDomain& domain() const { return fDomain; }
65 65
66 const char* name() const override { return "MatrixConvolution"; } 66 const char* name() const override { return "MatrixConvolution"; }
67 67
68 void getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const over ride;
69
70 GrGLFragmentProcessor* createGLInstance() const override; 68 GrGLFragmentProcessor* createGLInstance() const override;
71 69
72 private: 70 private:
73 GrMatrixConvolutionEffect(GrProcessorDataManager*, 71 GrMatrixConvolutionEffect(GrProcessorDataManager*,
74 GrTexture*, 72 GrTexture*,
75 const SkIRect& bounds, 73 const SkIRect& bounds,
76 const SkISize& kernelSize, 74 const SkISize& kernelSize,
77 const SkScalar* kernel, 75 const SkScalar* kernel,
78 SkScalar gain, 76 SkScalar gain,
79 SkScalar bias, 77 SkScalar bias,
80 const SkIPoint& kernelOffset, 78 const SkIPoint& kernelOffset,
81 GrTextureDomain::Mode tileMode, 79 GrTextureDomain::Mode tileMode,
82 bool convolveAlpha); 80 bool convolveAlpha);
83 81
82 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov erride;
83
84 bool onIsEqual(const GrFragmentProcessor&) const override; 84 bool onIsEqual(const GrFragmentProcessor&) const override;
85 85
86 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { 86 void onComputeInvariantOutput(GrInvariantOutput* inout) const override {
87 // TODO: Try to do better? 87 // TODO: Try to do better?
88 inout->mulByUnknownFourComponents(); 88 inout->mulByUnknownFourComponents();
89 } 89 }
90 90
91 SkIRect fBounds; 91 SkIRect fBounds;
92 SkISize fKernelSize; 92 SkISize fKernelSize;
93 float fKernel[MAX_KERNEL_SIZE]; 93 float fKernel[MAX_KERNEL_SIZE];
94 float fGain; 94 float fGain;
95 float fBias; 95 float fBias;
96 float fKernelOffset[2]; 96 float fKernelOffset[2];
97 bool fConvolveAlpha; 97 bool fConvolveAlpha;
98 GrTextureDomain fDomain; 98 GrTextureDomain fDomain;
99 99
100 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 100 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
101 101
102 typedef GrSingleTextureEffect INHERITED; 102 typedef GrSingleTextureEffect INHERITED;
103 }; 103 };
104 104
105 #endif 105 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDitherEffect.cpp ('k') | src/gpu/effects/GrMatrixConvolutionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698