2012-08-14 22:02:48 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2015-08-27 14:41:13 +00:00
|
|
|
#include "SkTypes.h"
|
|
|
|
|
2012-08-14 22:02:48 +00:00
|
|
|
#if SK_SUPPORT_GPU
|
2014-01-10 22:08:27 +00:00
|
|
|
|
2012-08-14 22:02:48 +00:00
|
|
|
#include "GrContextFactory.h"
|
2014-01-10 22:08:27 +00:00
|
|
|
#include "Test.h"
|
2012-08-14 22:02:48 +00:00
|
|
|
|
2014-06-24 13:50:39 +00:00
|
|
|
DEF_GPUTEST(GrContextFactory, reporter, factory) {
|
2013-04-19 13:24:28 +00:00
|
|
|
// Reset in case some other test has been using it first.
|
2014-01-10 22:08:27 +00:00
|
|
|
factory->destroyContexts();
|
2012-08-14 22:02:48 +00:00
|
|
|
|
|
|
|
// Before we ask for a context, we expect the GL context to not be there.
|
|
|
|
REPORTER_ASSERT(reporter,
|
2015-08-27 14:41:13 +00:00
|
|
|
nullptr == factory->getGLContext(GrContextFactory::kNull_GLContextType));
|
2012-08-14 22:02:48 +00:00
|
|
|
|
|
|
|
// After we ask for a context, we expect that the GL context to be there.
|
2014-07-17 17:50:59 +00:00
|
|
|
factory->get(GrContextFactory::kNull_GLContextType);
|
2012-08-14 22:02:48 +00:00
|
|
|
REPORTER_ASSERT(reporter,
|
2015-08-27 14:41:13 +00:00
|
|
|
factory->getGLContext(GrContextFactory::kNull_GLContextType) != nullptr);
|
2012-08-14 22:02:48 +00:00
|
|
|
|
|
|
|
// If we did not ask for a context with the particular GL context, we would
|
|
|
|
// expect the particular GL context to not be there.
|
|
|
|
REPORTER_ASSERT(reporter,
|
2015-08-27 14:41:13 +00:00
|
|
|
nullptr == factory->getGLContext(GrContextFactory::kDebug_GLContextType));
|
2012-08-14 22:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|