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

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

Issue 643743003: Create helper functions to use in computeInvariantOutput calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update blurMaskFilter 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/GrConfigConversionEffect.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 #include "gl/builders/GrGLProgramBuilder.h" 8 #include "gl/builders/GrGLProgramBuilder.h"
9 #include "GrBicubicEffect.h" 9 #include "GrBicubicEffect.h"
10 10
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 bool GrBicubicEffect::onIsEqual(const GrProcessor& sBase) const { 165 bool GrBicubicEffect::onIsEqual(const GrProcessor& sBase) const {
166 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>(); 166 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>();
167 return this->textureAccess(0) == s.textureAccess(0) && 167 return this->textureAccess(0) == s.textureAccess(0) &&
168 !memcmp(fCoefficients, s.coefficients(), 16) && 168 !memcmp(fCoefficients, s.coefficients(), 16) &&
169 fDomain == s.fDomain; 169 fDomain == s.fDomain;
170 } 170 }
171 171
172 void GrBicubicEffect::onComputeInvariantOutput(InvariantOutput* inout) const { 172 void GrBicubicEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
173 // FIXME: Perhaps we can do better. 173 // FIXME: Perhaps we can do better.
174 inout->fValidFlags = 0; 174 inout->mulByUnknownAlpha();
175 inout->fIsSingleComponent = false;
176 return;
177 } 175 }
178 176
179 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect); 177 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect);
180 178
181 GrFragmentProcessor* GrBicubicEffect::TestCreate(SkRandom* random, 179 GrFragmentProcessor* GrBicubicEffect::TestCreate(SkRandom* random,
182 GrContext* context, 180 GrContext* context,
183 const GrDrawTargetCaps&, 181 const GrDrawTargetCaps&,
184 GrTexture* textures[]) { 182 GrTexture* textures[]) {
185 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : 183 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
186 GrProcessorUnitTest::kAlphaTextureIdx; 184 GrProcessorUnitTest::kAlphaTextureIdx;
(...skipping 29 matching lines...) Expand all
216 // Use bilerp to handle rotation or fractional translation. 214 // Use bilerp to handle rotation or fractional translation.
217 *filterMode = GrTextureParams::kBilerp_FilterMode; 215 *filterMode = GrTextureParams::kBilerp_FilterMode;
218 } 216 }
219 return false; 217 return false;
220 } 218 }
221 // When we use the bicubic filtering effect each sample is read from the tex ture using 219 // When we use the bicubic filtering effect each sample is read from the tex ture using
222 // nearest neighbor sampling. 220 // nearest neighbor sampling.
223 *filterMode = GrTextureParams::kNone_FilterMode; 221 *filterMode = GrTextureParams::kNone_FilterMode;
224 return true; 222 return true;
225 } 223 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBezierEffect.h ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698