blob: a82524e88c40b7bc670e5a0fbde25c3d03ea428b [file] [log] [blame]
commit-bot@chromium.org99017272013-11-08 18:45:27 +00001
2/*
3 * Copyright 2013 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9#if SK_SUPPORT_GPU
10
11#include "GrContext.h"
12#include "GrContextFactory.h"
13#include "GrGpu.h"
14#include "GrDrawTargetCaps.h"
15#include "Test.h"
16
17static void test_print(skiatest::Reporter*, const GrDrawTargetCaps* caps) {
18 // This used to assert.
19 caps->print();
20}
21
22static void TestGrDrawTarget(skiatest::Reporter* reporter, GrContextFactory* factory) {
23 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
24 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::GLContextType>(type);
25
26 GrContext* grContext = factory->get(glType);
27 if (NULL == grContext) {
28 continue;
29 }
30
31 test_print(reporter, grContext->getGpu()->caps());
32 }
33}
34
35#include "TestClassDef.h"
36DEFINE_GPUTESTCLASS("GrDrawTarget", TestGrDrawTargetClass, TestGrDrawTarget)
37
38#endif