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

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

Issue 1313573005: Revert of Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: Created 5 years, 3 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/GrSimpleTextureEffect.cpp ('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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 273 }
274 } else { 274 } else {
275 this->updateInvariantOutputForModulation(inout); 275 this->updateInvariantOutputForModulation(inout);
276 } 276 }
277 } 277 }
278 278
279 /////////////////////////////////////////////////////////////////////////////// 279 ///////////////////////////////////////////////////////////////////////////////
280 280
281 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect); 281 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect);
282 282
283 const GrFragmentProcessor* GrTextureDomainEffect::TestCreate(GrProcessorTestData * d) { 283 GrFragmentProcessor* GrTextureDomainEffect::TestCreate(GrProcessorTestData* d) {
284 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : 284 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
285 GrProcessorUnitTest::kAlphaTextureIdx; 285 GrProcessorUnitTest::kAlphaTextureIdx;
286 SkRect domain; 286 SkRect domain;
287 domain.fLeft = d->fRandom->nextUScalar1(); 287 domain.fLeft = d->fRandom->nextUScalar1();
288 domain.fRight = d->fRandom->nextRangeScalar(domain.fLeft, SK_Scalar1); 288 domain.fRight = d->fRandom->nextRangeScalar(domain.fLeft, SK_Scalar1);
289 domain.fTop = d->fRandom->nextUScalar1(); 289 domain.fTop = d->fRandom->nextUScalar1();
290 domain.fBottom = d->fRandom->nextRangeScalar(domain.fTop, SK_Scalar1); 290 domain.fBottom = d->fRandom->nextRangeScalar(domain.fTop, SK_Scalar1);
291 GrTextureDomain::Mode mode = 291 GrTextureDomain::Mode mode =
292 (GrTextureDomain::Mode) d->fRandom->nextULessThan(GrTextureDomain::kMode Count); 292 (GrTextureDomain::Mode) d->fRandom->nextULessThan(GrTextureDomain::kMode Count);
293 const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom); 293 const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
294 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false; 294 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false;
295 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC oordSet; 295 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC oordSet;
296 return GrTextureDomainEffect::Create(d->fProcDataManager, 296 return GrTextureDomainEffect::Create(d->fProcDataManager,
297 d->fTextures[texIdx], 297 d->fTextures[texIdx],
298 matrix, 298 matrix,
299 domain, 299 domain,
300 mode, 300 mode,
301 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 301 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
302 coords); 302 coords);
303 } 303 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698