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

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

Issue 374923002: Goodbye GrEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@noref3
Patch Set: Address comments Created 6 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/GrBicubicEffect.h ('k') | src/gpu/effects/GrConfigConversionEffect.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 #include "GrBicubicEffect.h" 1 #include "GrBicubicEffect.h"
2 2
3 #define DS(x) SkDoubleToScalar(x) 3 #define DS(x) SkDoubleToScalar(x)
4 4
5 const SkScalar GrBicubicEffect::gMitchellCoefficients[16] = { 5 const SkScalar GrBicubicEffect::gMitchellCoefficients[16] = {
6 DS( 1.0 / 18.0), DS(-9.0 / 18.0), DS( 15.0 / 18.0), DS( -7.0 / 18.0), 6 DS( 1.0 / 18.0), DS(-9.0 / 18.0), DS( 15.0 / 18.0), DS( -7.0 / 18.0),
7 DS(16.0 / 18.0), DS( 0.0 / 18.0), DS(-36.0 / 18.0), DS( 21.0 / 18.0), 7 DS(16.0 / 18.0), DS( 0.0 / 18.0), DS(-36.0 / 18.0), DS( 21.0 / 18.0),
8 DS( 1.0 / 18.0), DS( 9.0 / 18.0), DS( 27.0 / 18.0), DS(-21.0 / 18.0), 8 DS( 1.0 / 18.0), DS( 9.0 / 18.0), DS( 27.0 / 18.0), DS(-21.0 / 18.0),
9 DS( 0.0 / 18.0), DS( 0.0 / 18.0), DS( -6.0 / 18.0), DS( 7.0 / 18.0), 9 DS( 0.0 / 18.0), DS( 0.0 / 18.0), DS( -6.0 / 18.0), DS( 7.0 / 18.0),
10 }; 10 };
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 159
160 void GrBicubicEffect::getConstantColorComponents(GrColor* color, uint32_t* valid Flags) const { 160 void GrBicubicEffect::getConstantColorComponents(GrColor* color, uint32_t* valid Flags) const {
161 // FIXME: Perhaps we can do better. 161 // FIXME: Perhaps we can do better.
162 *validFlags = 0; 162 *validFlags = 0;
163 return; 163 return;
164 } 164 }
165 165
166 GR_DEFINE_EFFECT_TEST(GrBicubicEffect); 166 GR_DEFINE_EFFECT_TEST(GrBicubicEffect);
167 167
168 GrEffectRef* GrBicubicEffect::TestCreate(SkRandom* random, 168 GrEffect* GrBicubicEffect::TestCreate(SkRandom* random,
169 GrContext* context, 169 GrContext* context,
170 const GrDrawTargetCaps&, 170 const GrDrawTargetCaps&,
171 GrTexture* textures[]) { 171 GrTexture* textures[]) {
172 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : 172 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
173 GrEffectUnitTest::kAlphaTextureIdx; 173 GrEffectUnitTest::kAlphaTextureIdx;
174 SkScalar coefficients[16]; 174 SkScalar coefficients[16];
175 for (int i = 0; i < 16; i++) { 175 for (int i = 0; i < 16; i++) {
176 coefficients[i] = random->nextSScalar1(); 176 coefficients[i] = random->nextSScalar1();
177 } 177 }
178 return GrBicubicEffect::Create(textures[texIdx], coefficients); 178 return GrBicubicEffect::Create(textures[texIdx], coefficients);
179 } 179 }
180 180
181 ////////////////////////////////////////////////////////////////////////////// 181 //////////////////////////////////////////////////////////////////////////////
(...skipping 21 matching lines...) Expand all
203 // Use bilerp to handle rotation or fractional translation. 203 // Use bilerp to handle rotation or fractional translation.
204 *filterMode = GrTextureParams::kBilerp_FilterMode; 204 *filterMode = GrTextureParams::kBilerp_FilterMode;
205 } 205 }
206 return false; 206 return false;
207 } 207 }
208 // When we use the bicubic filtering effect each sample is read from the tex ture using 208 // When we use the bicubic filtering effect each sample is read from the tex ture using
209 // nearest neighbor sampling. 209 // nearest neighbor sampling.
210 *filterMode = GrTextureParams::kNone_FilterMode; 210 *filterMode = GrTextureParams::kNone_FilterMode;
211 return true; 211 return true;
212 } 212 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBicubicEffect.h ('k') | src/gpu/effects/GrConfigConversionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698