summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglsurface.c
diff options
context:
space:
mode:
authorPlamena Manolova <[email protected]>2016-06-01 17:31:29 +0100
committerAnuj Phogat <[email protected]>2016-06-02 16:07:31 -0700
commit0b67efaed2038c68e08eb8b550d7b78494b54254 (patch)
treee1009c19a02e4afbf820d57e5c81698994627c10 /src/egl/main/eglsurface.c
parent28590eb9492f2e06c95483df7bd7f67b0fee7b8e (diff)
egl: Account for default values of texture target and format
When validating attributes during surface creation we should account for the default values of texture target and format (EGL_NO_TEXTURE) since the user is not obligated to explicitly set both via the attribute list passed to eglCreatePbufferSurface. Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/egl/main/eglsurface.c')
-rw-r--r--src/egl/main/eglsurface.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c
index 17d79077837..99e24dd8895 100644
--- a/src/egl/main/eglsurface.c
+++ b/src/egl/main/eglsurface.c
@@ -236,6 +236,12 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
}
if (type == EGL_PBUFFER_BIT) {
+ if (tex_target == -1)
+ tex_target = surf->TextureTarget;
+
+ if (tex_format == -1)
+ tex_format = surf->TextureFormat;
+
if ((tex_target == EGL_NO_TEXTURE && tex_format != EGL_NO_TEXTURE) ||
(tex_format == EGL_NO_TEXTURE && tex_target != EGL_NO_TEXTURE)) {
err = EGL_BAD_MATCH;