| 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 #include "SkTypes.h" |
| 9 |
| 8 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| 9 | 11 |
| 10 #include "GrContextFactory.h" | 12 #include "GrContextFactory.h" |
| 11 #include "Test.h" | 13 #include "Test.h" |
| 12 | 14 |
| 13 DEF_GPUTEST(GrContextFactory, reporter, factory) { | 15 DEF_GPUTEST(GrContextFactory, reporter, factory) { |
| 14 // Reset in case some other test has been using it first. | 16 // Reset in case some other test has been using it first. |
| 15 factory->destroyContexts(); | 17 factory->destroyContexts(); |
| 16 | 18 |
| 17 // Before we ask for a context, we expect the GL context to not be there. | 19 // Before we ask for a context, we expect the GL context to not be there. |
| 18 REPORTER_ASSERT(reporter, | 20 REPORTER_ASSERT(reporter, |
| 19 NULL == factory->getGLContext(GrContextFactory::kNull_GLCont
extType)); | 21 nullptr == factory->getGLContext(GrContextFactory::kNull_GLC
ontextType)); |
| 20 | 22 |
| 21 // After we ask for a context, we expect that the GL context to be there. | 23 // After we ask for a context, we expect that the GL context to be there. |
| 22 factory->get(GrContextFactory::kNull_GLContextType); | 24 factory->get(GrContextFactory::kNull_GLContextType); |
| 23 REPORTER_ASSERT(reporter, | 25 REPORTER_ASSERT(reporter, |
| 24 factory->getGLContext(GrContextFactory::kNull_GLContextType)
!= NULL); | 26 factory->getGLContext(GrContextFactory::kNull_GLContextType)
!= nullptr); |
| 25 | 27 |
| 26 // If we did not ask for a context with the particular GL context, we would | 28 // If we did not ask for a context with the particular GL context, we would |
| 27 // expect the particular GL context to not be there. | 29 // expect the particular GL context to not be there. |
| 28 REPORTER_ASSERT(reporter, | 30 REPORTER_ASSERT(reporter, |
| 29 NULL == factory->getGLContext(GrContextFactory::kDebug_GLCon
textType)); | 31 nullptr == factory->getGLContext(GrContextFactory::kDebug_GL
ContextType)); |
| 30 } | 32 } |
| 31 | 33 |
| 32 #endif | 34 #endif |
| OLD | NEW |