diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-02-01 12:54:11 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-02-01 12:54:11 +0100 |
commit | c951a75ef10bd30260ef9762d2883360750cd1f5 (patch) | |
tree | f8327a9bda010fcfa43c6ce03e3c098d94a994bb | |
parent | 5ca1856c61339d97f017cd73d24c0cab76312682 (diff) |
wayland-egl: Add visual param to wl_egl_create_native_surface
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 11 | ||||
-rw-r--r-- | src/egl/wayland/wayland-egl-priv.h | 1 | ||||
-rw-r--r-- | src/egl/wayland/wayland-egl.c | 5 | ||||
-rw-r--r-- | src/egl/wayland/wayland-egl.h | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/wayland/native_wayland.c | 3 |
5 files changed, 10 insertions, 14 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 9c5f68ef93..48cb5423ee 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2107,19 +2107,10 @@ wayland_create_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display); - struct wl_visual *visual; - - switch (buffer->cpp) { - case 4: - visual = wl_display_get_premultiplied_argb_visual(dri2_dpy->wl->display); - break; - default: - return NULL; - } return wl_drm_create_buffer(dri2_dpy->wl->drm, buffer->name, dri2_surf->base.Width, dri2_surf->base.Height, - buffer->pitch, visual); + buffer->pitch, dri2_surf->wl->visual); } static void diff --git a/src/egl/wayland/wayland-egl-priv.h b/src/egl/wayland/wayland-egl-priv.h index 2ee0ee13da..f34ccbcb5a 100644 --- a/src/egl/wayland/wayland-egl-priv.h +++ b/src/egl/wayland/wayland-egl-priv.h @@ -34,6 +34,7 @@ struct wl_egl_display { struct wl_egl_surface { struct wl_surface *surface; + struct wl_visual *visual; int width; int height; diff --git a/src/egl/wayland/wayland-egl.c b/src/egl/wayland/wayland-egl.c index 3f7c5f7c35..88af0d90bd 100644 --- a/src/egl/wayland/wayland-egl.c +++ b/src/egl/wayland/wayland-egl.c @@ -158,7 +158,9 @@ wl_egl_surface_resize(struct wl_egl_surface *egl_surface, } WL_EGL_EXPORT struct wl_egl_surface * -wl_egl_create_native_surface(struct wl_surface *surface, int width, int height) +wl_egl_create_native_surface(struct wl_surface *surface, + int width, int height, + struct wl_visual *visual) { struct wl_egl_surface *egl_surface; @@ -167,6 +169,7 @@ wl_egl_create_native_surface(struct wl_surface *surface, int width, int height) return NULL; egl_surface->surface = surface; + egl_surface->visual = visual; wl_egl_surface_resize(egl_surface, width, height, 0, 0); return egl_surface; diff --git a/src/egl/wayland/wayland-egl.h b/src/egl/wayland/wayland-egl.h index 6bf1b072fb..ad5248a807 100644 --- a/src/egl/wayland/wayland-egl.h +++ b/src/egl/wayland/wayland-egl.h @@ -27,7 +27,9 @@ void * wl_egl_display_get_user_data(struct wl_egl_display *egl_display); struct wl_egl_surface * -wl_egl_create_native_surface(struct wl_surface *, int width, int height); +wl_egl_create_native_surface(struct wl_surface *, + int width, int height, + struct wl_visual *); void wl_egl_destroy_native_surface(struct wl_egl_surface *); diff --git a/src/gallium/state_trackers/egl/wayland/native_wayland.c b/src/gallium/state_trackers/egl/wayland/native_wayland.c index 9242e26377..62e38c3ab6 100644 --- a/src/gallium/state_trackers/egl/wayland/native_wayland.c +++ b/src/gallium/state_trackers/egl/wayland/native_wayland.c @@ -197,10 +197,9 @@ wayland_create_buffer(struct wayland_surface *surface, pipe_resource_reference(&resource, NULL); - visual = wl_display_get_premultiplied_argb_visual(display->wl->display); return wl_drm_create_buffer(display->wl->drm, wsh.handle, surface->wl->width, surface->wl->height, - wsh.stride, visual); + wsh.stride, surface->wl->visual); } static boolean |