blob: c032d88bd0dab1b29da83a0fd633975023542f18 [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"
commit-bot@chromium.org99017272013-11-08 18:45:27 +000013#include "GrDrawTargetCaps.h"
tfarina@chromium.org8f6884a2014-01-24 20:56:26 +000014#include "GrGpu.h"
commit-bot@chromium.org99017272013-11-08 18:45:27 +000015#include "Test.h"
16
17static void test_print(skiatest::Reporter*, const GrDrawTargetCaps* caps) {
18 // This used to assert.
commit-bot@chromium.org8b656c62013-11-21 15:23:15 +000019 SkString result = caps->dump();
20 SkASSERT(!result.isEmpty());
commit-bot@chromium.org99017272013-11-08 18:45:27 +000021}
22
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +000023DEF_GPUTEST(GrDrawTarget, reporter, factory) {
commit-bot@chromium.org99017272013-11-08 18:45:27 +000024 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
25 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::GLContextType>(type);
26
27 GrContext* grContext = factory->get(glType);
28 if (NULL == grContext) {
29 continue;
30 }
31
32 test_print(reporter, grContext->getGpu()->caps());
33 }
34}
35
commit-bot@chromium.org99017272013-11-08 18:45:27 +000036#endif