| bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| bsalomon@google.com | a68937c | 2012-08-03 15:00:52 +0000 | [diff] [blame] | 8 | #include "Test.h" |
| tfarina@chromium.org | 4ee16bf | 2014-01-10 22:08:27 +0000 | [diff] [blame] | 9 | |
| bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 10 | // This is a GPU-backend specific test |
| 11 | #if SK_SUPPORT_GPU |
| 12 | |
| bsalomon@google.com | 7fa1bb4 | 2013-03-11 20:22:38 +0000 | [diff] [blame] | 13 | #include "GrContextFactory.h" |
| bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 14 | |
| tfarina@chromium.org | 4ee16bf | 2014-01-10 22:08:27 +0000 | [diff] [blame] | 15 | DEF_GPUTEST(GLInterfaceValidation, reporter, factory) { |
| bsalomon@google.com | 7fa1bb4 | 2013-03-11 20:22:38 +0000 | [diff] [blame] | 16 | for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) { |
| 17 | GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContextType)i; |
| 18 | // this forces the factory to make the context if it hasn't yet |
| 19 | factory->get(glCtxType); |
| 20 | SkGLContextHelper* glCtxHelper = factory->getGLContext(glCtxType); |
| 21 | REPORTER_ASSERT(reporter, NULL != glCtxHelper); |
| 22 | if (NULL != glCtxHelper) { |
| 23 | const GrGLInterface* interface = glCtxHelper->gl(); |
| commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 24 | REPORTER_ASSERT(reporter, interface->validate()); |
| bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 25 | } |
| 26 | } |
| 27 | } |
| 28 | |
| bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 29 | #endif |