Chromium Code Reviews| 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 #ifndef skiatest_Test_DEFINED | 7 #ifndef skiatest_Test_DEFINED |
| 8 #define skiatest_Test_DEFINED | 8 #define skiatest_Test_DEFINED |
| 9 | 9 |
| 10 #include "SkString.h" | 10 #include "SkString.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 sk_gpu_test::GrContextFactory* factory) { \ | 163 sk_gpu_test::GrContextFactory* factory) { \ |
| 164 skiatest::RunWithGPUTestContexts(test_##name, context_filter, reporter, factory); \ | 164 skiatest::RunWithGPUTestContexts(test_##name, context_filter, reporter, factory); \ |
| 165 } \ | 165 } \ |
| 166 skiatest::TestRegistry name##TestRegistry( \ | 166 skiatest::TestRegistry name##TestRegistry( \ |
| 167 skiatest::Test(#name, true, test_gpu_contexts_##name)); \ | 167 skiatest::Test(#name, true, test_gpu_contexts_##name)); \ |
| 168 void test_##name(skiatest::Reporter* reporter, \ | 168 void test_##name(skiatest::Reporter* reporter, \ |
| 169 const sk_gpu_test::ContextInfo& context_info) | 169 const sk_gpu_test::ContextInfo& context_info) |
| 170 | 170 |
| 171 #define DEF_GPUTEST_FOR_ALL_CONTEXTS(name, reporter, context_info) \ | 171 #define DEF_GPUTEST_FOR_ALL_CONTEXTS(name, reporter, context_info) \ |
| 172 DEF_GPUTEST_FOR_CONTEXTS(name, nullptr, reporter, context_info) | 172 DEF_GPUTEST_FOR_CONTEXTS(name, nullptr, reporter, context_info) |
| 173 #define DEF_GPUTEST_FOR_RENDERING_CONTEXTS(name, reporter, context_info) \ | |
| 174 DEF_GPUTEST_FOR_CONTEXTS(name, sk_gpu_test::GrContextFactory::IsRenderin gContext, \ | |
|
jvanverth1
2016/04/12 16:49:40
Why is this sk_gpu_test while the others are skiat
bsalomon
2016/04/12 16:58:34
The other predicates are declared above in this fu
| |
| 175 reporter, context_info) | |
| 173 #define DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(name, reporter, context_info) \ | 176 #define DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(name, reporter, context_info) \ |
| 174 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsGLContextType, reporter, con text_info) | 177 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsGLContextType, reporter, con text_info) |
| 175 #define DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(name, reporter, context_info) \ | 178 #define DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(name, reporter, context_info) \ |
| 176 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsRenderingGLContextType, repo rter, context_info) | 179 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsRenderingGLContextType, repo rter, context_info) |
| 177 #define DEF_GPUTEST_FOR_NULLGL_CONTEXT(name, reporter, context_info) \ | 180 #define DEF_GPUTEST_FOR_NULLGL_CONTEXT(name, reporter, context_info) \ |
| 178 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsNullGLContextType, reporter, context_info) | 181 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsNullGLContextType, reporter, context_info) |
| 179 #define DEF_GPUTEST_FOR_VULKAN_CONTEXT(name, reporter, context_info) \ | 182 #define DEF_GPUTEST_FOR_VULKAN_CONTEXT(name, reporter, context_info) \ |
| 180 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsVulkanContextType, reporter, context_info) | 183 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsVulkanContextType, reporter, context_info) |
| 181 | 184 |
| 182 #define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER) \ | 185 #define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER) \ |
| 183 do { \ | 186 do { \ |
| 184 SkDynamicMemoryWStream testStream; \ | 187 SkDynamicMemoryWStream testStream; \ |
| 185 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ | 188 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ |
| 186 if (!testDoc) { \ | 189 if (!testDoc) { \ |
| 187 INFOF(REPORTER, "PDF disabled; %s test skipped.", #TEST_NAME); \ | 190 INFOF(REPORTER, "PDF disabled; %s test skipped.", #TEST_NAME); \ |
| 188 return; \ | 191 return; \ |
| 189 } \ | 192 } \ |
| 190 } while (false) | 193 } while (false) |
| 191 | 194 |
| 192 #endif | 195 #endif |
| OLD | NEW |