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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 GrDrawState* ds = this->drawState(); | 432 GrDrawState* ds = this->drawState(); |
433 ds->setRenderTarget(rt.get()); | 433 ds->setRenderTarget(rt.get()); |
434 | 434 |
435 // if path rendering we have to setup a couple of things like the draw t
ype | 435 // if path rendering we have to setup a couple of things like the draw t
ype |
436 bool usePathRendering = gpu->glCaps().pathRenderingSupport() && random.n
extBool(); | 436 bool usePathRendering = gpu->glCaps().pathRenderingSupport() && random.n
extBool(); |
437 | 437 |
438 GrGpu::DrawType drawType = usePathRendering ? GrGpu::kDrawPath_DrawType
: | 438 GrGpu::DrawType drawType = usePathRendering ? GrGpu::kDrawPath_DrawType
: |
439 GrGpu::kDrawPoints_DrawTyp
e; | 439 GrGpu::kDrawPoints_DrawTyp
e; |
440 | 440 |
441 // twiddle drawstate knobs randomly | 441 // twiddle drawstate knobs randomly |
442 bool hasGeometryProcessor = usePathRendering ? false : random.nextBool()
; | 442 bool hasGeometryProcessor = !usePathRendering; |
443 if (hasGeometryProcessor) { | 443 if (hasGeometryProcessor) { |
444 set_random_gp(fContext, gpu->glCaps(), ds, &random, dummyTextures); | 444 set_random_gp(fContext, gpu->glCaps(), ds, &random, dummyTextures); |
445 } | 445 } |
446 set_random_color_coverage_stages(gpu, | 446 set_random_color_coverage_stages(gpu, |
447 ds, | 447 ds, |
448 maxStages - hasGeometryProcessor, | 448 maxStages - hasGeometryProcessor, |
449 usePathRendering, | 449 usePathRendering, |
450 &random, | 450 &random, |
451 dummyTextures); | 451 dummyTextures); |
452 set_random_color(ds, &random); | 452 set_random_color(ds, &random); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 } | 517 } |
518 #endif | 518 #endif |
519 GrTestTarget target; | 519 GrTestTarget target; |
520 context->getTestTarget(&target); | 520 context->getTestTarget(&target); |
521 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 521 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
522 } | 522 } |
523 } | 523 } |
524 } | 524 } |
525 | 525 |
526 #endif | 526 #endif |
OLD | NEW |