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 GrUserStencilSettings kDoesWriteStencil( | 280 static constexpr GrStencilSettings kDoesWriteStencil( |
281 GrUserStencilSettings::StaticInit< | 281 kReplace_StencilOp, |
282 0xffff, | 282 kReplace_StencilOp, |
283 GrUserStencilTest::kAlways, | 283 kAlways_StencilFunc, |
284 0xffff, | 284 0xffff, |
285 GrUserStencilOp::kReplace, | 285 0xffff, |
286 GrUserStencilOp::kReplace, | 286 0xffff); |
287 0xffff>() | 287 static constexpr GrStencilSettings kDoesNotWriteStencil( |
288 ); | 288 kKeep_StencilOp, |
289 static constexpr GrUserStencilSettings kDoesNotWriteStencil( | 289 kKeep_StencilOp, |
290 GrUserStencilSettings::StaticInit< | 290 kNever_StencilFunc, |
291 0xffff, | 291 0xffff, |
292 GrUserStencilTest::kNever, | 292 0xffff, |
293 0xffff, | 293 0xffff); |
294 GrUserStencilOp::kKeep, | |
295 GrUserStencilOp::kKeep, | |
296 0xffff>() | |
297 ); | |
298 | 294 |
299 if (random->nextBool()) { | 295 if (random->nextBool()) { |
300 pipelineBuilder->setUserStencil(&kDoesWriteStencil); | 296 pipelineBuilder->setStencil(kDoesWriteStencil); |
301 } else { | 297 } else { |
302 pipelineBuilder->setUserStencil(&kDoesNotWriteStencil); | 298 pipelineBuilder->setStencil(kDoesNotWriteStencil); |
303 } | 299 } |
304 } | 300 } |
305 | 301 |
306 bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { | 302 bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { |
307 GrDrawingManager* drawingManager = context->drawingManager(); | 303 GrDrawingManager* drawingManager = context->drawingManager(); |
308 | 304 |
309 // setup dummy textures | 305 // setup dummy textures |
310 GrSurfaceDesc dummyDesc; | 306 GrSurfaceDesc dummyDesc; |
311 dummyDesc.fFlags = kRenderTarget_GrSurfaceFlag; | 307 dummyDesc.fFlags = kRenderTarget_GrSurfaceFlag; |
312 dummyDesc.fConfig = kSkia8888_GrPixelConfig; | 308 dummyDesc.fConfig = kSkia8888_GrPixelConfig; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 GrContextOptions opts; | 469 GrContextOptions opts; |
474 opts.fSuppressPrints = true; | 470 opts.fSuppressPrints = true; |
475 sk_gpu_test::GrContextFactory debugFactory(opts); | 471 sk_gpu_test::GrContextFactory debugFactory(opts); |
476 skiatest::RunWithGPUTestContexts(test_glprograms_native, &is_native_gl_conte
xt_type, | 472 skiatest::RunWithGPUTestContexts(test_glprograms_native, &is_native_gl_conte
xt_type, |
477 reporter, &debugFactory); | 473 reporter, &debugFactory); |
478 skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, | 474 skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, |
479 &is_other_rendering_gl_context_type, report
er, &debugFactory); | 475 &is_other_rendering_gl_context_type, report
er, &debugFactory); |
480 } | 476 } |
481 | 477 |
482 #endif | 478 #endif |
OLD | NEW |