Commit 7d82d293 by Jiajia Qin Committed by Commit Bot

Refactor DisplayGbm::generateConfigs

Bug: angleproject:4809 Change-Id: I5f352f737bbd53c78d9e01055c17eabd17d5fb8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2278667Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
parent 120e1d66
...@@ -924,24 +924,36 @@ egl::Error DisplayGbm::makeCurrent(egl::Surface *drawSurface, ...@@ -924,24 +924,36 @@ egl::Error DisplayGbm::makeCurrent(egl::Surface *drawSurface,
egl::ConfigSet DisplayGbm::generateConfigs() egl::ConfigSet DisplayGbm::generateConfigs()
{ {
egl::ConfigSet configs;
gl::Version eglVersion(mEGL->majorVersion, mEGL->minorVersion);
egl::Config config; ASSERT(eglVersion >= gl::Version(1, 4));
config.bufferSize = 32;
config.redSize = 8; bool supportES3 =
config.greenSize = 8; (eglVersion >= gl::Version(1, 5) || mEGL->hasExtension("EGL_KHR_create_context")) &&
config.blueSize = 8; (mRenderer->getMaxSupportedESVersion() >= gl::Version(3, 0));
config.alphaSize = 8; EGLint renderType = EGL_OPENGL_ES2_BIT | (supportES3 ? EGL_OPENGL_ES3_BIT : 0);
config.depthSize = 24;
config.stencilSize = 8; // clang-format off
config.bindToTextureRGBA = EGL_TRUE; std::vector<EGLint> configAttribs8888 =
config.renderableType = EGL_OPENGL_ES2_BIT; {
config.surfaceType = EGL_WINDOW_BIT | EGL_PBUFFER_BIT; EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
config.renderTargetFormat = GL_RGBA8; // CrOS doesn't support window and pixmaps?
config.depthStencilFormat = GL_DEPTH24_STENCIL8; EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
EGL_CONFIG_CAVEAT, EGL_NONE,
configs.add(config); EGL_CONFORMANT, renderType,
return configs; EGL_RENDERABLE_TYPE, renderType,
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_BUFFER_SIZE, 32,
EGL_DEPTH_SIZE, 24,
EGL_NONE
};
// clang-format on
mConfigAttribList = configAttribs8888;
return DisplayEGL::generateConfigs();
} }
bool DisplayGbm::isValidNativeWindow(EGLNativeWindowType window) const bool DisplayGbm::isValidNativeWindow(EGLNativeWindowType window) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment