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

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

Issue 794843002: Revert of Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: Created 6 years 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/GrBitmapTextGeoProc.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 /* 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 "GrBicubicEffect.h" 8 #include "GrBicubicEffect.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const { 170 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
171 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>(); 171 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>();
172 return !memcmp(fCoefficients, s.coefficients(), 16) && 172 return !memcmp(fCoefficients, s.coefficients(), 16) &&
173 fDomain == s.fDomain; 173 fDomain == s.fDomain;
174 } 174 }
175 175
176 void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { 176 void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
177 // FIXME: Perhaps we can do better. 177 // FIXME: Perhaps we can do better.
178 inout->mulByUnknownSingleComponent(); 178 inout->mulByUnknownAlpha();
179 } 179 }
180 180
181 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect); 181 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect);
182 182
183 GrFragmentProcessor* GrBicubicEffect::TestCreate(SkRandom* random, 183 GrFragmentProcessor* GrBicubicEffect::TestCreate(SkRandom* random,
184 GrContext* context, 184 GrContext* context,
185 const GrDrawTargetCaps&, 185 const GrDrawTargetCaps&,
186 GrTexture* textures[]) { 186 GrTexture* textures[]) {
187 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : 187 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
188 GrProcessorUnitTest::kAlphaTextureIdx; 188 GrProcessorUnitTest::kAlphaTextureIdx;
(...skipping 29 matching lines...) Expand all
218 // Use bilerp to handle rotation or fractional translation. 218 // Use bilerp to handle rotation or fractional translation.
219 *filterMode = GrTextureParams::kBilerp_FilterMode; 219 *filterMode = GrTextureParams::kBilerp_FilterMode;
220 } 220 }
221 return false; 221 return false;
222 } 222 }
223 // When we use the bicubic filtering effect each sample is read from the tex ture using 223 // When we use the bicubic filtering effect each sample is read from the tex ture using
224 // nearest neighbor sampling. 224 // nearest neighbor sampling.
225 *filterMode = GrTextureParams::kNone_FilterMode; 225 *filterMode = GrTextureParams::kNone_FilterMode;
226 return true; 226 return true;
227 } 227 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBezierEffect.h ('k') | src/gpu/effects/GrBitmapTextGeoProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698