| 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" |
| 11 | 11 |
| 12 #if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 12 #if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
| 13 | 13 |
| 14 #include "GrAutoLocaleSetter.h" | 14 #include "GrAutoLocaleSetter.h" |
| 15 #include "GrBatchTest.h" | 15 #include "GrBatchTest.h" |
| 16 #include "GrContextFactory.h" | 16 #include "GrContextFactory.h" |
| 17 #include "GrContextPriv.h" |
| 17 #include "GrDrawContextPriv.h" | 18 #include "GrDrawContextPriv.h" |
| 18 #include "GrDrawingManager.h" | 19 #include "GrDrawingManager.h" |
| 19 #include "GrInvariantOutput.h" | 20 #include "GrInvariantOutput.h" |
| 20 #include "GrPipeline.h" | 21 #include "GrPipeline.h" |
| 21 #include "GrResourceProvider.h" | 22 #include "GrResourceProvider.h" |
| 22 #include "GrTest.h" | 23 #include "GrTest.h" |
| 23 #include "GrXferProcessor.h" | 24 #include "GrXferProcessor.h" |
| 24 #include "SkChecksum.h" | 25 #include "SkChecksum.h" |
| 25 #include "SkRandom.h" | 26 #include "SkRandom.h" |
| 26 #include "Test.h" | 27 #include "Test.h" |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 ); | 282 ); |
| 282 | 283 |
| 283 if (random->nextBool()) { | 284 if (random->nextBool()) { |
| 284 return &kDoesWriteStencil; | 285 return &kDoesWriteStencil; |
| 285 } else { | 286 } else { |
| 286 return &kDoesNotWriteStencil; | 287 return &kDoesNotWriteStencil; |
| 287 } | 288 } |
| 288 } | 289 } |
| 289 | 290 |
| 290 bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { | 291 bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { |
| 291 GrDrawingManager* drawingManager = context->drawingManager(); | 292 GrDrawingManager* drawingManager = context->contextPriv().drawingManager(); |
| 292 | 293 |
| 293 // setup dummy textures | 294 // setup dummy textures |
| 294 GrSurfaceDesc dummyDesc; | 295 GrSurfaceDesc dummyDesc; |
| 295 dummyDesc.fFlags = kRenderTarget_GrSurfaceFlag; | 296 dummyDesc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 296 dummyDesc.fConfig = kSkia8888_GrPixelConfig; | 297 dummyDesc.fConfig = kSkia8888_GrPixelConfig; |
| 297 dummyDesc.fWidth = 34; | 298 dummyDesc.fWidth = 34; |
| 298 dummyDesc.fHeight = 18; | 299 dummyDesc.fHeight = 18; |
| 299 SkAutoTUnref<GrTexture> dummyTexture1( | 300 SkAutoTUnref<GrTexture> dummyTexture1( |
| 300 context->textureProvider()->createTexture(dummyDesc, SkBudgeted::kNo, nu
llptr, 0)); | 301 context->textureProvider()->createTexture(dummyDesc, SkBudgeted::kNo, nu
llptr, 0)); |
| 301 dummyDesc.fFlags = kNone_GrSurfaceFlags; | 302 dummyDesc.fFlags = kNone_GrSurfaceFlags; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 GrContextOptions opts; | 443 GrContextOptions opts; |
| 443 opts.fSuppressPrints = true; | 444 opts.fSuppressPrints = true; |
| 444 sk_gpu_test::GrContextFactory debugFactory(opts); | 445 sk_gpu_test::GrContextFactory debugFactory(opts); |
| 445 skiatest::RunWithGPUTestContexts(test_glprograms_native, &is_native_gl_conte
xt_type, | 446 skiatest::RunWithGPUTestContexts(test_glprograms_native, &is_native_gl_conte
xt_type, |
| 446 reporter, &debugFactory); | 447 reporter, &debugFactory); |
| 447 skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, | 448 skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, |
| 448 &is_other_rendering_gl_context_type, report
er, &debugFactory); | 449 &is_other_rendering_gl_context_type, report
er, &debugFactory); |
| 449 } | 450 } |
| 450 | 451 |
| 451 #endif | 452 #endif |
| OLD | NEW |