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

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

Issue 608253002: Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix isSolidWhite Created 6 years, 2 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/GrBezierEffect.h ('k') | src/gpu/effects/GrBicubicEffect.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 2013 Google Inc. 2 * Copyright 2013 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 GrBicubicTextureEffect_DEFINED 8 #ifndef GrBicubicTextureEffect_DEFINED
9 #define GrBicubicTextureEffect_DEFINED 9 #define GrBicubicTextureEffect_DEFINED
10 10
(...skipping 11 matching lines...) Expand all
22 // surrounding texels are needed by the kernel in x and y. 22 // surrounding texels are needed by the kernel in x and y.
23 }; 23 };
24 virtual ~GrBicubicEffect(); 24 virtual ~GrBicubicEffect();
25 25
26 static const char* Name() { return "Bicubic"; } 26 static const char* Name() { return "Bicubic"; }
27 const float* coefficients() const { return fCoefficients; } 27 const float* coefficients() const { return fCoefficients; }
28 28
29 typedef GrGLBicubicEffect GLProcessor; 29 typedef GrGLBicubicEffect GLProcessor;
30 30
31 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR IDE; 31 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR IDE;
32 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const SK_OVERRIDE;
33 32
34 const GrTextureDomain& domain() const { return fDomain; } 33 const GrTextureDomain& domain() const { return fDomain; }
35 34
36 /** 35 /**
37 * Create a simple filter effect with custom bicubic coefficients and option al domain. 36 * Create a simple filter effect with custom bicubic coefficients and option al domain.
38 */ 37 */
39 static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficien ts[16], 38 static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficien ts[16],
40 const SkRect* domain = NULL) { 39 const SkRect* domain = NULL) {
41 if (NULL == domain) { 40 if (NULL == domain) {
42 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti leMode, 41 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti leMode,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice, 85 static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice,
87 GrTextureParams::FilterMode* filterMode); 86 GrTextureParams::FilterMode* filterMode);
88 87
89 private: 88 private:
90 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], 89 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16],
91 const SkMatrix &matrix, const SkShader::TileMode tileModes[2 ]); 90 const SkMatrix &matrix, const SkShader::TileMode tileModes[2 ]);
92 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], 91 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16],
93 const SkMatrix &matrix, const SkRect& domain); 92 const SkMatrix &matrix, const SkRect& domain);
94 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; 93 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE;
95 94
95 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE;
96
96 float fCoefficients[16]; 97 float fCoefficients[16];
97 GrTextureDomain fDomain; 98 GrTextureDomain fDomain;
98 99
99 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 100 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
100 101
101 static const SkScalar gMitchellCoefficients[16]; 102 static const SkScalar gMitchellCoefficients[16];
102 103
103 typedef GrSingleTextureEffect INHERITED; 104 typedef GrSingleTextureEffect INHERITED;
104 }; 105 };
105 106
106 #endif 107 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBezierEffect.h ('k') | src/gpu/effects/GrBicubicEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698