From 9901727f213e459901a175c119b2fad8816002a0 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Fri, 8 Nov 2013 18:45:27 +0000 Subject: Fix stale assert in GrDrawTarget::print Fix stale assert in GrDrawTarget::print. R=bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/66333002 git-svn-id: http://skia.googlecode.com/svn/trunk@12201 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/GrDrawTargetTest.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/GrDrawTargetTest.cpp (limited to 'tests/GrDrawTargetTest.cpp') diff --git a/tests/GrDrawTargetTest.cpp b/tests/GrDrawTargetTest.cpp new file mode 100644 index 0000000000..a82524e88c --- /dev/null +++ b/tests/GrDrawTargetTest.cpp @@ -0,0 +1,38 @@ + +/* + * Copyright 2013 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#if SK_SUPPORT_GPU + +#include "GrContext.h" +#include "GrContextFactory.h" +#include "GrGpu.h" +#include "GrDrawTargetCaps.h" +#include "Test.h" + +static void test_print(skiatest::Reporter*, const GrDrawTargetCaps* caps) { + // This used to assert. + caps->print(); +} + +static void TestGrDrawTarget(skiatest::Reporter* reporter, GrContextFactory* factory) { + for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { + GrContextFactory::GLContextType glType = static_cast(type); + + GrContext* grContext = factory->get(glType); + if (NULL == grContext) { + continue; + } + + test_print(reporter, grContext->getGpu()->caps()); + } +} + +#include "TestClassDef.h" +DEFINE_GPUTESTCLASS("GrDrawTarget", TestGrDrawTargetClass, TestGrDrawTarget) + +#endif -- cgit v1.2.3