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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 SkAutoTUnref<GrDrawBatch> batch(GrRandomDrawBatch(&random, context)); | 350 SkAutoTUnref<GrDrawBatch> batch(GrRandomDrawBatch(&random, context)); |
351 SkASSERT(batch); | 351 SkASSERT(batch); |
352 | 352 |
353 GrProcessorTestData ptd(&random, context, context->caps(), rt, dummyText
ures); | 353 GrProcessorTestData ptd(&random, context, context->caps(), rt, dummyText
ures); |
354 set_random_color_coverage_stages(&pipelineBuilder, &ptd, maxStages); | 354 set_random_color_coverage_stages(&pipelineBuilder, &ptd, maxStages); |
355 set_random_xpf(&pipelineBuilder, &ptd); | 355 set_random_xpf(&pipelineBuilder, &ptd); |
356 set_random_state(&pipelineBuilder, &random); | 356 set_random_state(&pipelineBuilder, &random); |
357 set_random_stencil(&pipelineBuilder, &random); | 357 set_random_stencil(&pipelineBuilder, &random); |
358 | 358 |
359 GrTestTarget tt; | 359 GrTestTarget tt; |
360 context->getTestTarget(&tt); | 360 context->getTestTarget(&tt, rt); |
361 | 361 |
362 tt.target()->drawBatch(pipelineBuilder, batch); | 362 tt.target()->drawBatch(pipelineBuilder, batch); |
363 } | 363 } |
364 // Flush everything, test passes if flush is successful(ie, no asserts are h
it, no crashes) | 364 // Flush everything, test passes if flush is successful(ie, no asserts are h
it, no crashes) |
365 drawingManager->flush(); | 365 drawingManager->flush(); |
366 | 366 |
367 // Validate that GrFPs work correctly without an input. | 367 // Validate that GrFPs work correctly without an input. |
368 GrSurfaceDesc rtDesc; | 368 GrSurfaceDesc rtDesc; |
369 rtDesc.fWidth = kRenderTargetWidth; | 369 rtDesc.fWidth = kRenderTargetWidth; |
370 rtDesc.fHeight = kRenderTargetHeight; | 370 rtDesc.fHeight = kRenderTargetHeight; |
(...skipping 13 matching lines...) Expand all Loading... |
384 builder.setRenderTarget(rt); | 384 builder.setRenderTarget(rt); |
385 builder.setClip(clip); | 385 builder.setClip(clip); |
386 | 386 |
387 SkAutoTUnref<const GrFragmentProcessor> fp( | 387 SkAutoTUnref<const GrFragmentProcessor> fp( |
388 GrProcessorTestFactory<GrFragmentProcessor>::CreateIdx(i, &ptd))
; | 388 GrProcessorTestFactory<GrFragmentProcessor>::CreateIdx(i, &ptd))
; |
389 SkAutoTUnref<const GrFragmentProcessor> blockFP( | 389 SkAutoTUnref<const GrFragmentProcessor> blockFP( |
390 BlockInputFragmentProcessor::Create(fp)); | 390 BlockInputFragmentProcessor::Create(fp)); |
391 builder.addColorFragmentProcessor(blockFP); | 391 builder.addColorFragmentProcessor(blockFP); |
392 | 392 |
393 GrTestTarget tt; | 393 GrTestTarget tt; |
394 context->getTestTarget(&tt); | 394 context->getTestTarget(&tt, rt); |
395 | 395 |
396 tt.target()->drawBatch(builder, batch); | 396 tt.target()->drawBatch(builder, batch); |
397 drawingManager->flush(); | 397 drawingManager->flush(); |
398 } | 398 } |
399 } | 399 } |
400 | 400 |
401 return true; | 401 return true; |
402 } | 402 } |
403 | 403 |
404 DEF_GPUTEST(GLPrograms, reporter, factory) { | 404 DEF_GPUTEST(GLPrograms, reporter, factory) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 if (type == GrContextFactory::kCommandBuffer_GLContextType) { | 446 if (type == GrContextFactory::kCommandBuffer_GLContextType) { |
447 maxStages = 2; | 447 maxStages = 2; |
448 } | 448 } |
449 #endif | 449 #endif |
450 REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(context,
maxStages)); | 450 REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(context,
maxStages)); |
451 } | 451 } |
452 } | 452 } |
453 } | 453 } |
454 | 454 |
455 #endif | 455 #endif |
OLD | NEW |