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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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-01-10 22:08:27 +00:00
|
|
|
DEF_GPUTEST(GrContextFactoryTest, 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,
|
2014-01-10 22:08:27 +00:00
|
|
|
NULL == factory->getGLContext(GrContextFactory::kNative_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-01-10 22:08:27 +00:00
|
|
|
factory->get(GrContextFactory::kNative_GLContextType);
|
2012-08-14 22:02:48 +00:00
|
|
|
REPORTER_ASSERT(reporter,
|
2014-01-10 22:08:27 +00:00
|
|
|
factory->getGLContext(GrContextFactory::kNative_GLContextType) != NULL);
|
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,
|
2014-01-10 22:08:27 +00:00
|
|
|
NULL == factory->getGLContext(GrContextFactory::kNull_GLContextType));
|
2012-08-14 22:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|