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

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

Issue 1117443002: create GrTestUtils.h, move some common functions into it (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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') | no next file » | 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 GrTexture* textures[]) { 292 GrTexture* textures[]) {
293 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : 293 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
294 GrProcessorUnitTest::kAlphaTextureIdx; 294 GrProcessorUnitTest::kAlphaTextureIdx;
295 SkRect domain; 295 SkRect domain;
296 domain.fLeft = random->nextUScalar1(); 296 domain.fLeft = random->nextUScalar1();
297 domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1); 297 domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1);
298 domain.fTop = random->nextUScalar1(); 298 domain.fTop = random->nextUScalar1();
299 domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1); 299 domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1);
300 GrTextureDomain::Mode mode = 300 GrTextureDomain::Mode mode =
301 (GrTextureDomain::Mode) random->nextULessThan(GrTextureDomain::kModeCoun t); 301 (GrTextureDomain::Mode) random->nextULessThan(GrTextureDomain::kModeCoun t);
302 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random); 302 const SkMatrix& matrix = GrTest::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 : kDevice_GrCoord Set; 304 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kDevice_GrCoord Set;
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/GrSimpleTextureEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698