blob: 14d4f78314f83f9e5a2443a6a46c9dbf988900be [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
bsalomon4b91f762015-05-19 09:29:46 -07009#include "Test.h"
commit-bot@chromium.org99017272013-11-08 18:45:27 +000010#if SK_SUPPORT_GPU
11
bsalomoneb1cb5c2015-05-22 08:01:09 -070012#include "GrCaps.h"
commit-bot@chromium.org99017272013-11-08 18:45:27 +000013#include "GrContext.h"
14#include "GrContextFactory.h"
tfarina@chromium.org8f6884a2014-01-24 20:56:26 +000015#include "GrGpu.h"
commit-bot@chromium.org99017272013-11-08 18:45:27 +000016
bsalomon4b91f762015-05-19 09:29:46 -070017static void test_print(skiatest::Reporter*, const GrCaps* caps) {
commit-bot@chromium.org99017272013-11-08 18:45:27 +000018 // 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
bsalomon76228632015-05-29 08:02:10 -070032 test_print(reporter, grContext->caps());
commit-bot@chromium.org99017272013-11-08 18:45:27 +000033 }
34}
35
commit-bot@chromium.org99017272013-11-08 18:45:27 +000036#endif