2012-08-15 02:02:48 +04: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-11 02:08:27 +04:00
|
|
|
|
2012-08-15 02:02:48 +04:00
|
|
|
#include "GrContextFactory.h"
|
2014-01-11 02:08:27 +04:00
|
|
|
#include "Test.h"
|
2012-08-15 02:02:48 +04:00
|
|
|
|
2014-06-24 17:50:39 +04:00
|
|
|
DEF_GPUTEST(GrContextFactory, reporter, factory) {
|
2013-04-19 17:24:28 +04:00
|
|
|
// Reset in case some other test has been using it first.
|
2014-01-11 02:08:27 +04:00
|
|
|
factory->destroyContexts();
|
2012-08-15 02:02:48 +04:00
|
|
|
|
|
|
|
// Before we ask for a context, we expect the GL context to not be there.
|
|
|
|
REPORTER_ASSERT(reporter,
|
2014-07-17 21:50:59 +04:00
|
|
|
NULL == factory->getGLContext(GrContextFactory::kNull_GLContextType));
|
2012-08-15 02:02:48 +04:00
|
|
|
|
|
|
|
// After we ask for a context, we expect that the GL context to be there.
|
2014-07-17 21:50:59 +04:00
|
|
|
factory->get(GrContextFactory::kNull_GLContextType);
|
2012-08-15 02:02:48 +04:00
|
|
|
REPORTER_ASSERT(reporter,
|
2014-07-17 21:50:59 +04:00
|
|
|
factory->getGLContext(GrContextFactory::kNull_GLContextType) != NULL);
|
2012-08-15 02:02:48 +04: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-07-17 21:50:59 +04:00
|
|
|
NULL == factory->getGLContext(GrContextFactory::kDebug_GLContextType));
|
2012-08-15 02:02:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|