OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "Test.h" | 8 #include "Test.h" |
9 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 11 matching lines...) Expand all Loading... |
22 #if SK_SUPPORT_GPU | 22 #if SK_SUPPORT_GPU |
23 DEF_GPUTEST(TestGpuFactory, reporter, factory) { | 23 DEF_GPUTEST(TestGpuFactory, reporter, factory) { |
24 REPORTER_ASSERT(reporter, reporter); | 24 REPORTER_ASSERT(reporter, reporter); |
25 REPORTER_ASSERT(reporter, factory); | 25 REPORTER_ASSERT(reporter, factory); |
26 } | 26 } |
27 #endif | 27 #endif |
28 | 28 |
29 // This is an example of a GPU test that tests a property that should work for a
ll GPU contexts. | 29 // This is an example of a GPU test that tests a property that should work for a
ll GPU contexts. |
30 // Note: Some of the contexts might not produce a rendering output. | 30 // Note: Some of the contexts might not produce a rendering output. |
31 #if SK_SUPPORT_GPU | 31 #if SK_SUPPORT_GPU |
32 DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, context) { | 32 DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, ctxInfo) { |
33 REPORTER_ASSERT(reporter, reporter); | 33 REPORTER_ASSERT(reporter, reporter); |
34 REPORTER_ASSERT(reporter, context); | 34 REPORTER_ASSERT(reporter, ctxInfo.fGrContext); |
35 } | 35 } |
36 #endif | 36 #endif |
37 | 37 |
38 // This is an example of a GPU test that tests a property that should work for a
ll GPU contexts that | 38 // This is an example of a GPU test that tests a property that should work for a
ll GPU contexts that |
39 // produce a rendering output. | 39 // produce a rendering output. |
40 #if SK_SUPPORT_GPU | 40 #if SK_SUPPORT_GPU |
41 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, context)
{ | 41 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, ctxInfo)
{ |
42 REPORTER_ASSERT(reporter, reporter); | 42 REPORTER_ASSERT(reporter, reporter); |
43 REPORTER_ASSERT(reporter, context); | 43 REPORTER_ASSERT(reporter, ctxInfo.fGrContext); |
44 } | 44 } |
45 #endif | 45 #endif |
46 | 46 |
47 // This is an example of a GPU test that tests a property that uses the null GPU
context. It should | 47 // This is an example of a GPU test that tests a property that uses the null GPU
context. It should |
48 // be used if the test tests some behavior that is mocked with the null context. | 48 // be used if the test tests some behavior that is mocked with the null context. |
49 #if SK_SUPPORT_GPU | 49 #if SK_SUPPORT_GPU |
50 DEF_GPUTEST_FOR_NULL_CONTEXT(TestGpuNullContext, reporter, context) { | 50 DEF_GPUTEST_FOR_NULL_CONTEXT(TestGpuNullContext, reporter, ctxInfo) { |
51 REPORTER_ASSERT(reporter, reporter); | 51 REPORTER_ASSERT(reporter, reporter); |
52 REPORTER_ASSERT(reporter, context); | 52 REPORTER_ASSERT(reporter, ctxInfo.fGrContext); |
53 } | 53 } |
54 #endif | 54 #endif |
55 | |
56 // This is an example of a GPU test that tests a property that should work for a
ll GPU contexts. | |
57 // It uses the additional GLTestContext* glContext to implement the test. | |
58 #if SK_SUPPORT_GPU | |
59 DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuGrContextAndGLContext, reporter, context, gl
Context) { | |
60 REPORTER_ASSERT(reporter, reporter); | |
61 REPORTER_ASSERT(reporter, context); | |
62 REPORTER_ASSERT(reporter, glContext); | |
63 } | |
64 #endif | |
OLD | NEW |