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

Side by Side Diff: src/gpu/effects/GrBezierEffect.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/GrTestUtils.cpp ('k') | src/gpu/effects/GrBitmapTextGeoProc.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 2013 Google Inc. 2 * Copyright 2013 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 "GrBezierEffect.h" 8 #include "GrBezierEffect.h"
9 9
10 #include "gl/GrGLProcessor.h" 10 #include "gl/GrGLProcessor.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect); 229 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect);
230 230
231 GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random, 231 GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random,
232 GrContext*, 232 GrContext*,
233 const GrDrawTargetCaps& caps, 233 const GrDrawTargetCaps& caps,
234 GrTexture*[]) { 234 GrTexture*[]) {
235 GrGeometryProcessor* gp; 235 GrGeometryProcessor* gp;
236 do { 236 do {
237 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( 237 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
238 random->nextULessThan(kGrPro cessorEdgeTypeCnt)); 238 random->nextULessThan(kGrPro cessorEdgeTypeCnt));
239 gp = GrConicEffect::Create(GrRandomColor(random), GrProcessorUnitTest::T estMatrix(random), 239 gp = GrConicEffect::Create(GrRandomColor(random), GrTest::TestMatrix(ran dom),
240 edgeType, caps, 240 edgeType, caps,
241 GrProcessorUnitTest::TestMatrix(random)); 241 GrTest::TestMatrix(random));
242 } while (NULL == gp); 242 } while (NULL == gp);
243 return gp; 243 return gp;
244 } 244 }
245 245
246 ////////////////////////////////////////////////////////////////////////////// 246 //////////////////////////////////////////////////////////////////////////////
247 // Quad 247 // Quad
248 ////////////////////////////////////////////////////////////////////////////// 248 //////////////////////////////////////////////////////////////////////////////
249 249
250 struct QuadBatchTracker { 250 struct QuadBatchTracker {
251 GrGPInput fInputColorType; 251 GrGPInput fInputColorType;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 451
452 GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random, 452 GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random,
453 GrContext*, 453 GrContext*,
454 const GrDrawTargetCaps& caps, 454 const GrDrawTargetCaps& caps,
455 GrTexture*[]) { 455 GrTexture*[]) {
456 GrGeometryProcessor* gp; 456 GrGeometryProcessor* gp;
457 do { 457 do {
458 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( 458 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
459 random->nextULessThan(kGrProcessorEdgeTypeCnt)); 459 random->nextULessThan(kGrProcessorEdgeTypeCnt));
460 gp = GrQuadEffect::Create(GrRandomColor(random), 460 gp = GrQuadEffect::Create(GrRandomColor(random),
461 GrProcessorUnitTest::TestMatrix(random), 461 GrTest::TestMatrix(random),
462 edgeType, caps, 462 edgeType, caps,
463 GrProcessorUnitTest::TestMatrix(random)); 463 GrTest::TestMatrix(random));
464 } while (NULL == gp); 464 } while (NULL == gp);
465 return gp; 465 return gp;
466 } 466 }
467 467
468 ////////////////////////////////////////////////////////////////////////////// 468 //////////////////////////////////////////////////////////////////////////////
469 // Cubic 469 // Cubic
470 ////////////////////////////////////////////////////////////////////////////// 470 //////////////////////////////////////////////////////////////////////////////
471 471
472 struct CubicBatchTracker { 472 struct CubicBatchTracker {
473 GrGPInput fInputColorType; 473 GrGPInput fInputColorType;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 691
692 GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random, 692 GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random,
693 GrContext*, 693 GrContext*,
694 const GrDrawTargetCaps& caps, 694 const GrDrawTargetCaps& caps,
695 GrTexture*[]) { 695 GrTexture*[]) {
696 GrGeometryProcessor* gp; 696 GrGeometryProcessor* gp;
697 do { 697 do {
698 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( 698 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
699 random->nextULessThan(kGrPro cessorEdgeTypeCnt)); 699 random->nextULessThan(kGrPro cessorEdgeTypeCnt));
700 gp = GrCubicEffect::Create(GrRandomColor(random), 700 gp = GrCubicEffect::Create(GrRandomColor(random),
701 GrProcessorUnitTest::TestMatrix(random), edge Type, caps); 701 GrTest::TestMatrix(random), edgeType, caps);
702 } while (NULL == gp); 702 } while (NULL == gp);
703 return gp; 703 return gp;
704 } 704 }
705 705
OLDNEW
« no previous file with comments | « src/gpu/GrTestUtils.cpp ('k') | src/gpu/effects/GrBitmapTextGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698