OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 // This is a GPU-backend specific test. It relies on static intializers to work | 8 // This is a GPU-backend specific test. It relies on static intializers to work |
9 | 9 |
10 #include "SkTypes.h" | 10 #include "SkTypes.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // If we don't have an MSAA rendertarget then we have to disable useHWAA | 270 // If we don't have an MSAA rendertarget then we have to disable useHWAA |
271 if ((state | GrPipelineBuilder::kHWAntialias_Flag) && | 271 if ((state | GrPipelineBuilder::kHWAntialias_Flag) && |
272 !pipelineBuilder->getRenderTarget()->isUnifiedMultisampled()) { | 272 !pipelineBuilder->getRenderTarget()->isUnifiedMultisampled()) { |
273 state &= ~GrPipelineBuilder::kHWAntialias_Flag; | 273 state &= ~GrPipelineBuilder::kHWAntialias_Flag; |
274 } | 274 } |
275 pipelineBuilder->enableState(state); | 275 pipelineBuilder->enableState(state); |
276 } | 276 } |
277 | 277 |
278 // right now, the only thing we seem to care about in drawState's stencil is 'do
esWrite()' | 278 // right now, the only thing we seem to care about in drawState's stencil is 'do
esWrite()' |
279 static void set_random_stencil(GrPipelineBuilder* pipelineBuilder, SkRandom* ran
dom) { | 279 static void set_random_stencil(GrPipelineBuilder* pipelineBuilder, SkRandom* ran
dom) { |
280 static constexpr GrStencilSettings kDoesWriteStencil( | 280 static constexpr GrUserStencilSettings kDoesWriteStencil( |
281 kReplace_StencilOp, | 281 GrUserStencilSettings::StaticInit< |
282 kReplace_StencilOp, | 282 0xffff, |
283 kAlways_StencilFunc, | 283 GrUserStencilTest::kAlways, |
284 0xffff, | 284 0xffff, |
285 0xffff, | 285 GrUserStencilOp::kReplace, |
286 0xffff); | 286 GrUserStencilOp::kReplace, |
287 static constexpr GrStencilSettings kDoesNotWriteStencil( | 287 0xffff>() |
288 kKeep_StencilOp, | 288 ); |
289 kKeep_StencilOp, | 289 static constexpr GrUserStencilSettings kDoesNotWriteStencil( |
290 kNever_StencilFunc, | 290 GrUserStencilSettings::StaticInit< |
291 0xffff, | 291 0xffff, |
292 0xffff, | 292 GrUserStencilTest::kNever, |
293 0xffff); | 293 0xffff, |
| 294 GrUserStencilOp::kKeep, |
| 295 GrUserStencilOp::kKeep, |
| 296 0xffff>() |
| 297 ); |
294 | 298 |
295 if (random->nextBool()) { | 299 if (random->nextBool()) { |
296 pipelineBuilder->setStencil(kDoesWriteStencil); | 300 pipelineBuilder->setUserStencil(&kDoesWriteStencil); |
297 } else { | 301 } else { |
298 pipelineBuilder->setStencil(kDoesNotWriteStencil); | 302 pipelineBuilder->setUserStencil(&kDoesNotWriteStencil); |
299 } | 303 } |
300 } | 304 } |
301 | 305 |
302 bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { | 306 bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { |
303 GrDrawingManager* drawingManager = context->drawingManager(); | 307 GrDrawingManager* drawingManager = context->drawingManager(); |
304 | 308 |
305 // setup dummy textures | 309 // setup dummy textures |
306 GrSurfaceDesc dummyDesc; | 310 GrSurfaceDesc dummyDesc; |
307 dummyDesc.fFlags = kRenderTarget_GrSurfaceFlag; | 311 dummyDesc.fFlags = kRenderTarget_GrSurfaceFlag; |
308 dummyDesc.fConfig = kSkia8888_GrPixelConfig; | 312 dummyDesc.fConfig = kSkia8888_GrPixelConfig; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 GrContextOptions opts; | 473 GrContextOptions opts; |
470 opts.fSuppressPrints = true; | 474 opts.fSuppressPrints = true; |
471 sk_gpu_test::GrContextFactory debugFactory(opts); | 475 sk_gpu_test::GrContextFactory debugFactory(opts); |
472 skiatest::RunWithGPUTestContexts(test_glprograms_native, &is_native_gl_conte
xt_type, | 476 skiatest::RunWithGPUTestContexts(test_glprograms_native, &is_native_gl_conte
xt_type, |
473 reporter, &debugFactory); | 477 reporter, &debugFactory); |
474 skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, | 478 skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, |
475 &is_other_rendering_gl_context_type, report
er, &debugFactory); | 479 &is_other_rendering_gl_context_type, report
er, &debugFactory); |
476 } | 480 } |
477 | 481 |
478 #endif | 482 #endif |
OLD | NEW |