Introduce ConfigParameters test helper struct.

This allows us to more easily compare sets of parameters used in our
tests. The config parameters are stuff like the red / gree / blue bits
used in an EGL config. Or particular sets of extensions or other
EGL options.

This will more easily allow us to determine when we need to use a new
EGL display instead of reusing a prior.

Bug: angleproject:3261
Change-Id: Ia1f0ede988e0b4084fbb4d55097e94fd89ee4899
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1531535
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
This commit is contained in:
Jamie Madill
2019-03-20 11:36:29 -04:00
committed by Commit Bot
parent a532570a09
commit 0f566fc77c
11 changed files with 300 additions and 214 deletions

View File

@@ -69,8 +69,11 @@ WGLWindow::WGLWindow(int glesMajorVersion, int glesMinorVersion)
WGLWindow::~WGLWindow() {}
// Internally initializes GL resources.
bool WGLWindow::initializeGL(OSWindow *osWindow, angle::Library *glWindowingLibrary)
bool WGLWindow::initializeGL(OSWindow *osWindow,
angle::Library *glWindowingLibrary,
const ConfigParameters &params)
{
mConfigParams = params;
glWindowingLibrary->getAs("wglGetProcAddress", &gCurrentWGLGetProcAddress);
if (!gCurrentWGLGetProcAddress)
@@ -135,7 +138,7 @@ bool WGLWindow::initializeGL(OSWindow *osWindow, angle::Library *glWindowingLibr
return false;
}
if (mWebGLCompatibility.valid() || mRobustResourceInit.valid())
if (mConfigParams.webGLCompatibility.valid() || mConfigParams.robustResourceInit.valid())
{
std::cerr << "WGLWindow does not support the requested feature set." << std::endl;
return false;
@@ -163,11 +166,11 @@ bool WGLWindow::initializeGL(OSWindow *osWindow, angle::Library *glWindowingLibr
makeCurrent();
if (mSwapInterval != -1)
if (mConfigParams.swapInterval != -1)
{
if (_wglSwapIntervalEXT)
{
if (_wglSwapIntervalEXT(mSwapInterval) == FALSE)
if (_wglSwapIntervalEXT(mConfigParams.swapInterval) == FALSE)
{
std::cerr << "Error setting swap interval." << std::endl;
}