blob: 37a83df6fbf766f76676eb5a016d143cb5e0e55b [file] [log] [blame]
bsalomon@google.com57f5d982011-10-24 21:17:53 +00001/*
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.coma68937c2012-08-03 15:00:52 +00008#include "Test.h"
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +00009
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000010// This is a GPU-backend specific test
11#if SK_SUPPORT_GPU
12
bsalomon@google.com7fa1bb42013-03-11 20:22:38 +000013#include "GrContextFactory.h"
bsalomon@google.com57f5d982011-10-24 21:17:53 +000014
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +000015DEF_GPUTEST(GLInterfaceValidation, reporter, factory) {
bsalomon@google.com7fa1bb42013-03-11 20:22:38 +000016 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.org9e90aed2014-01-16 16:35:09 +000024 REPORTER_ASSERT(reporter, interface->validate());
bsalomon@google.com57f5d982011-10-24 21:17:53 +000025 }
26 }
27}
28
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000029#endif