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

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

Issue 282293004: Centralize decision about whether to do bicubic filtering, and fallbacks to mip, bilerp, or nearest (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add braces to case Created 6 years, 7 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 | Annotate | Revision Log
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 /** 72 /**
73 * Create a Mitchell filter effect with a texture matrix and a domain. 73 * Create a Mitchell filter effect with a texture matrix and a domain.
74 */ 74 */
75 static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix, const SkR ect& domain) { 75 static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix, const SkR ect& domain) {
76 AutoEffectUnref effect(SkNEW_ARGS(GrBicubicEffect, (tex, gMitchellCoeffi cients, matrix, 76 AutoEffectUnref effect(SkNEW_ARGS(GrBicubicEffect, (tex, gMitchellCoeffi cients, matrix,
77 domain))); 77 domain)));
78 return CreateEffectRef(effect); 78 return CreateEffectRef(effect);
79 } 79 }
80 80
81 /**
robertphillips 2014/05/20 15:34:50 The return value discussion doesn't seem right. Ma
bsalomon 2014/05/20 16:13:06 Done.
82 * Determines whether the bicubic effect should be used based on the transfo rmation from the
83 * local coords to the device. filterMode will be set to kNearest if true is returned (as no
84 * built-in filtering should be used with the bicubic effect) or the fallbac k filterMode that
85 * should be used if false is returned.
86 */
87 static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice,
88 GrTextureParams::FilterMode* filterMode);
89
81 private: 90 private:
82 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], 91 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16],
83 const SkMatrix &matrix, const SkShader::TileMode tileModes[2 ]); 92 const SkMatrix &matrix, const SkShader::TileMode tileModes[2 ]);
84 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], 93 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16],
85 const SkMatrix &matrix, const SkRect& domain); 94 const SkMatrix &matrix, const SkRect& domain);
86 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; 95 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE;
87 96
88 float fCoefficients[16]; 97 float fCoefficients[16];
89 GrTextureDomain fDomain; 98 GrTextureDomain fDomain;
90 99
91 GR_DECLARE_EFFECT_TEST; 100 GR_DECLARE_EFFECT_TEST;
92 101
93 static const SkScalar gMitchellCoefficients[16]; 102 static const SkScalar gMitchellCoefficients[16];
94 103
95 typedef GrSingleTextureEffect INHERITED; 104 typedef GrSingleTextureEffect INHERITED;
96 }; 105 };
97 106
98 #endif 107 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698