OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This is a GPU-backend specific test. It relies on static intializers to work | 9 // This is a GPU-backend specific test. It relies on static intializers to work |
10 | 10 |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 GrDrawState* ds = this->drawState(); | 431 GrDrawState* ds = this->drawState(); |
432 ds->setRenderTarget(rt.get()); | 432 ds->setRenderTarget(rt.get()); |
433 | 433 |
434 // if path rendering we have to setup a couple of things like the draw t
ype | 434 // if path rendering we have to setup a couple of things like the draw t
ype |
435 bool usePathRendering = gpu->glCaps().pathRenderingSupport() && random.n
extBool(); | 435 bool usePathRendering = gpu->glCaps().pathRenderingSupport() && random.n
extBool(); |
436 | 436 |
437 GrGpu::DrawType drawType = usePathRendering ? GrGpu::kDrawPath_DrawType
: | 437 GrGpu::DrawType drawType = usePathRendering ? GrGpu::kDrawPath_DrawType
: |
438 GrGpu::kDrawPoints_DrawTyp
e; | 438 GrGpu::kDrawPoints_DrawTyp
e; |
439 | 439 |
440 // twiddle drawstate knobs randomly | 440 // twiddle drawstate knobs randomly |
441 bool hasGeometryProcessor = usePathRendering ? false : random.nextBool()
; | 441 bool hasGeometryProcessor = !usePathRendering; |
442 if (hasGeometryProcessor) { | 442 if (hasGeometryProcessor) { |
443 set_random_gp(fContext, gpu->glCaps(), ds, &random, dummyTextures); | 443 set_random_gp(fContext, gpu->glCaps(), ds, &random, dummyTextures); |
444 } | 444 } |
445 set_random_color_coverage_stages(gpu, | 445 set_random_color_coverage_stages(gpu, |
446 ds, | 446 ds, |
447 maxStages - hasGeometryProcessor, | 447 maxStages - hasGeometryProcessor, |
448 usePathRendering, | 448 usePathRendering, |
449 &random, | 449 &random, |
450 dummyTextures); | 450 dummyTextures); |
451 set_random_color(ds, &random); | 451 set_random_color(ds, &random); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 } | 516 } |
517 #endif | 517 #endif |
518 GrTestTarget target; | 518 GrTestTarget target; |
519 context->getTestTarget(&target); | 519 context->getTestTarget(&target); |
520 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 520 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
521 } | 521 } |
522 } | 522 } |
523 } | 523 } |
524 | 524 |
525 #endif | 525 #endif |
OLD | NEW |