Commit 73afaf1e by Yuly Novikov Committed by Commit Bot

Add EGL_WINDOW_BIT to all Ozone configs' EGL_SURFACE_TYPE

Ozone's EGL windows are emulated, so we can always create one, thus setting EGL_WINDOW_BIT in all configs is safe. This is now required because in http://crrev.com/c/2378922 EGL_WINDOW_BIT becomes a requirement to be able to run tests. Previously Ozone's configs copied native EGL_SURFACE_TYPE, which was either 0 or having just EGL_PBUFFER_BIT. Bug: chromium:1181952, chromium:1034840 Change-Id: Ic2b14b43b3c32b47ea05d9d8da9fba7439f14d19 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2725273Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent c508e707
...@@ -461,8 +461,7 @@ egl::ConfigSet DisplayEGL::generateConfigs() ...@@ -461,8 +461,7 @@ egl::ConfigSet DisplayEGL::generateConfigs()
&config.colorComponentType, "EGL_EXT_pixel_format_float", &config.colorComponentType, "EGL_EXT_pixel_format_float",
EGL_COLOR_COMPONENT_TYPE_FIXED_EXT); EGL_COLOR_COMPONENT_TYPE_FIXED_EXT);
// Pixmaps are not supported on EGL, make sure the config doesn't expose them. config.surfaceType = fixSurfaceType(config.surfaceType);
config.surfaceType &= ~EGL_PIXMAP_BIT;
if (config.colorBufferType == EGL_RGB_BUFFER) if (config.colorBufferType == EGL_RGB_BUFFER)
{ {
...@@ -809,4 +808,10 @@ ExternalImageSiblingImpl *DisplayEGL::createExternalImageSibling(const gl::Conte ...@@ -809,4 +808,10 @@ ExternalImageSiblingImpl *DisplayEGL::createExternalImageSibling(const gl::Conte
} }
} }
EGLint DisplayEGL::fixSurfaceType(EGLint surfaceType) const
{
// Pixmaps are not supported on EGL, make sure the config doesn't expose them.
return surfaceType & ~EGL_PIXMAP_BIT;
}
} // namespace rx } // namespace rx
...@@ -112,6 +112,8 @@ class DisplayEGL : public DisplayGL ...@@ -112,6 +112,8 @@ class DisplayEGL : public DisplayGL
egl::Error makeCurrentSurfaceless(gl::Context *context) override; egl::Error makeCurrentSurfaceless(gl::Context *context) override;
virtual EGLint fixSurfaceType(EGLint surfaceType) const;
template <typename T> template <typename T>
void getConfigAttrib(EGLConfig config, EGLint attribute, T *value) const; void getConfigAttrib(EGLConfig config, EGLint attribute, T *value) const;
......
...@@ -1037,4 +1037,12 @@ WorkerContext *DisplayGbm::createWorkerContext(std::string *infoLog, ...@@ -1037,4 +1037,12 @@ WorkerContext *DisplayGbm::createWorkerContext(std::string *infoLog,
return new WorkerContextGbm(context, mEGL); return new WorkerContextGbm(context, mEGL);
} }
EGLint DisplayGbm::fixSurfaceType(EGLint surfaceType) const
{
EGLint type = DisplayEGL::fixSurfaceType(surfaceType);
// Ozone native surfaces don't support EGL_WINDOW_BIT,
// but ANGLE uses renderbuffers to emulate windows
return type | EGL_WINDOW_BIT;
}
} // namespace rx } // namespace rx
...@@ -136,6 +136,7 @@ class DisplayGbm final : public DisplayEGL ...@@ -136,6 +136,7 @@ class DisplayGbm final : public DisplayEGL
private: private:
void generateExtensions(egl::DisplayExtensions *outExtensions) const override; void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
EGLint fixSurfaceType(EGLint surfaceType) const override;
GLuint makeShader(GLuint type, const char *src); GLuint makeShader(GLuint type, const char *src);
void drawBuffer(const gl::Context *context, Buffer *buffer); void drawBuffer(const gl::Context *context, Buffer *buffer);
......
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