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

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

Issue 791743003: Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: more windows fix 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/GrSingleTextureEffect.h ('k') | tests/GLProgramsTest.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 2012 Google Inc. 2 * Copyright 2012 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 "GrTextureDomain.h" 8 #include "GrTextureDomain.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrSimpleTextureEffect.h" 10 #include "GrSimpleTextureEffect.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 267
268 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const { 268 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
269 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>(); 269 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>();
270 return this->fTextureDomain == s.fTextureDomain; 270 return this->fTextureDomain == s.fTextureDomain;
271 } 271 }
272 272
273 void GrTextureDomainEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c onst { 273 void GrTextureDomainEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c onst {
274 if (GrTextureDomain::kDecal_Mode == fTextureDomain.mode()) { // TODO: helper 274 if (GrTextureDomain::kDecal_Mode == fTextureDomain.mode()) { // TODO: helper
275 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { 275 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) {
276 inout->mulByUnknownAlpha(); 276 inout->mulByUnknownSingleComponent();
277 } else { 277 } else {
278 inout->mulByUnknownColor(); 278 inout->mulByUnknownFourComponents();
279 } 279 }
280 } else { 280 } else {
281 this->updateInvariantOutputForModulation(inout); 281 this->updateInvariantOutputForModulation(inout);
282 } 282 }
283 } 283 }
284 284
285 /////////////////////////////////////////////////////////////////////////////// 285 ///////////////////////////////////////////////////////////////////////////////
286 286
287 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect); 287 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect);
288 288
(...skipping 13 matching lines...) Expand all
302 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random); 302 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random);
303 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse; 303 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse;
304 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet; 304 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet;
305 return GrTextureDomainEffect::Create(textures[texIdx], 305 return GrTextureDomainEffect::Create(textures[texIdx],
306 matrix, 306 matrix,
307 domain, 307 domain,
308 mode, 308 mode,
309 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 309 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
310 coords); 310 coords);
311 } 311 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSingleTextureEffect.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698