2013-11-08 22:45:27 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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 "GrDrawTargetCaps.h"
|
2014-01-25 00:56:26 +04:00
|
|
|
#include "GrGpu.h"
|
2013-11-08 22:45:27 +04:00
|
|
|
#include "Test.h"
|
|
|
|
|
|
|
|
static void test_print(skiatest::Reporter*, const GrDrawTargetCaps* caps) {
|
|
|
|
// This used to assert.
|
2013-11-21 19:23:15 +04:00
|
|
|
SkString result = caps->dump();
|
|
|
|
SkASSERT(!result.isEmpty());
|
2013-11-08 22:45:27 +04:00
|
|
|
}
|
|
|
|
|
2014-01-11 02:08:27 +04:00
|
|
|
DEF_GPUTEST(GrDrawTarget, reporter, factory) {
|
2013-11-08 22:45:27 +04:00
|
|
|
for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
|
|
|
|
GrContextFactory::GLContextType glType = static_cast<GrContextFactory::GLContextType>(type);
|
|
|
|
|
|
|
|
GrContext* grContext = factory->get(glType);
|
|
|
|
if (NULL == grContext) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
test_print(reporter, grContext->getGpu()->caps());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|