window: make display_create_surface() shm-only
authorPekka Paalanen <ppaalanen@gmail.com>
Mon, 19 Nov 2012 15:15:57 +0000 (17:15 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 19 Nov 2012 21:00:01 +0000 (16:00 -0500)
Nothing uses it to create EGL-surfaces outside of window.c. This makes
refactoring the EGL-based code easier, since we do not need to support
EGL-based Cairo surfaces without an associated struct window.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
clients/window.c

index 44a057c..8cf53d3 100644 (file)
@@ -636,13 +636,8 @@ display_create_surface(struct display *display,
 {
        if (check_size(rectangle) < 0)
                return NULL;
-#ifdef HAVE_CAIRO_EGL
-       if (display->dpy && !(flags & SURFACE_SHM))
-               return display_create_egl_window_surface(display,
-                                                        surface,
-                                                        flags,
-                                                        rectangle);
-#endif
+
+       assert(flags & SURFACE_SHM);
        return display_create_shm_surface(display, rectangle, flags, NULL);
 }
 
@@ -940,10 +935,13 @@ window_create_surface(struct window *window)
                        window_resize_cairo_window_surface(window);
                        return;
                }
-               surface = display_create_surface(window->display,
-                                                window->surface,
-                                                &window->allocation, flags);
-               break;
+               if (window->display->dpy) {
+                       surface = display_create_egl_window_surface(
+                                       window->display, window->surface,
+                                       flags, &window->allocation);
+                       break;
+               }
+               /* fall through */
 #endif
        case WINDOW_BUFFER_TYPE_SHM:
                surface = display_create_shm_surface(window->display,