summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-08-05 00:25:47 +0100
committerEmil Velikov <[email protected]>2017-08-10 19:27:03 +0100
commit92b23683ebc839b13a565252cf13f5c2a715dcaa (patch)
tree49860d767bb605474ca1707a06fd45cfe969d909 /src/egl/drivers
parent47b06f5821551375e98699ca8ea41d06dc4ba0e9 (diff)
egl: drop unreachable BAD_NATIVE_WINDOW conditions
The code in _eglCreateWindowSurfaceCommon() already has a NULL check which handles the condition. There's no point in checking again further down the stack. v2: Split the WINDOW vs PIXMAP into separate patches v3: Resolve typos, s/EGL_PIXMAP_BIT_BIT/EGL_PIXMAP_BIT/ Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/platform_android.c2
-rw-r--r--src/egl/drivers/dri2/platform_drm.c5
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c5
-rw-r--r--src/egl/drivers/dri2/platform_x11.c6
4 files changed, 3 insertions, 15 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 50a82486956..beb474025f7 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -329,7 +329,7 @@ droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
if (type == EGL_WINDOW_BIT) {
int format;
- if (!window || window->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
+ if (window->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
_eglError(EGL_BAD_NATIVE_WINDOW, "droid_create_surface");
goto cleanup_surface;
}
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index a952aa54560..7ea43e62010 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -115,11 +115,6 @@ dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
switch (type) {
case EGL_WINDOW_BIT:
- if (!window) {
- _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
- goto cleanup_surf;
- }
-
surf = gbm_dri_surface(window);
dri2_surf->gbm_surf = surf;
dri2_surf->base.Width = surf->base.width;
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index e0febf8c4cb..3535c4bef08 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -162,11 +162,6 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
dri2_surf->format = WL_SHM_FORMAT_ARGB8888;
}
- if (!window) {
- _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
- goto cleanup_surf;
- }
-
dri2_surf->wl_win = window;
dri2_surf->wl_queue = wl_display_create_queue(dri2_dpy->wl_dpy);
if (!dri2_surf->wl_queue) {
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index f9aaf47e7d1..ec38e8123d8 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -247,10 +247,8 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
dri2_surf->base.Width, dri2_surf->base.Height);
} else {
if (!drawable) {
- if (type == EGL_WINDOW_BIT)
- _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
- else
- _eglError(EGL_BAD_NATIVE_PIXMAP, "dri2_create_surface");
+ assert(type == EGL_PIXMAP_BIT)
+ _eglError(EGL_BAD_NATIVE_PIXMAP, "dri2_create_surface");
goto cleanup_surf;
}
dri2_surf->drawable = drawable;