| 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 | #include "TestClassDef.h" |
| 10 | |
| bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 11 | // This is a GPU-backend specific test |
| 12 | #if SK_SUPPORT_GPU |
| 13 | |
| bsalomon@google.com | 7fa1bb4 | 2013-03-11 20:22:38 +0000 | [diff] [blame] | 14 | #include "GrContextFactory.h" |
| bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 15 | |
| tfarina@chromium.org | 4ee16bf | 2014-01-10 22:08:27 +0000 | [diff] [blame^] | 16 | DEF_GPUTEST(GLInterfaceValidation, reporter, factory) { |
| bsalomon@google.com | 7fa1bb4 | 2013-03-11 20:22:38 +0000 | [diff] [blame] | 17 | for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) { |
| 18 | GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContextType)i; |
| 19 | // this forces the factory to make the context if it hasn't yet |
| 20 | factory->get(glCtxType); |
| 21 | SkGLContextHelper* glCtxHelper = factory->getGLContext(glCtxType); |
| 22 | REPORTER_ASSERT(reporter, NULL != glCtxHelper); |
| 23 | if (NULL != glCtxHelper) { |
| 24 | const GrGLInterface* interface = glCtxHelper->gl(); |
| bsalomon@google.com | b447d21 | 2012-02-10 20:25:36 +0000 | [diff] [blame] | 25 | for (GrGLBinding binding = kFirstGrGLBinding; |
| bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 26 | binding <= kLastGrGLBinding; |
| 27 | binding = static_cast<GrGLBinding>(binding << 1)) { |
| bsalomon@google.com | 7fa1bb4 | 2013-03-11 20:22:38 +0000 | [diff] [blame] | 28 | if (interface->fBindingsExported & binding) { |
| 29 | REPORTER_ASSERT(reporter, interface->validate(binding)); |
| bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 30 | } |
| 31 | } |
| bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 36 | #endif |