blob: ce3da8098e5573c702300fb0ab76ca852ca0e59c [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());
cdalton626e1ff2015-06-12 13:56:46 -070021 SkString shaderResult = caps->shaderCaps()->dump();
22 SkASSERT(!shaderResult.isEmpty());
commit-bot@chromium.org99017272013-11-08 18:45:27 +000023}
24
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +000025DEF_GPUTEST(GrDrawTarget, reporter, factory) {
commit-bot@chromium.org99017272013-11-08 18:45:27 +000026 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
27 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::GLContextType>(type);
28
29 GrContext* grContext = factory->get(glType);
halcanary96fcdcc2015-08-27 07:41:13 -070030 if (nullptr == grContext) {
commit-bot@chromium.org99017272013-11-08 18:45:27 +000031 continue;
32 }
33
bsalomon76228632015-05-29 08:02:10 -070034 test_print(reporter, grContext->caps());
commit-bot@chromium.org99017272013-11-08 18:45:27 +000035 }
36}
37
commit-bot@chromium.org99017272013-11-08 18:45:27 +000038#endif