diff options
Diffstat (limited to 'clients/nested.c')
-rw-r--r-- | clients/nested.c | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/clients/nested.c b/clients/nested.c index 0b18dd5b..e2bdf684 100644 --- a/clients/nested.c +++ b/clients/nested.c @@ -1,23 +1,24 @@ /* * Copyright © 2013 Intel Corporation * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ #include "config.h" @@ -45,19 +46,12 @@ #define WL_HIDE_DEPRECATED #include <wayland-server.h> +#include "shared/helpers.h" +#include "shared/xalloc.h" #include "window.h" -#define MIN(x,y) (((x) < (y)) ? (x) : (y)) - -#ifndef EGL_WL_create_wayland_buffer_from_image -#define EGL_WL_create_wayland_buffer_from_image 1 - -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI struct wl_buffer * EGLAPIENTRY eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image); -#endif -typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (EGLDisplay dpy, EGLImageKHR image); +#include "weston-egl-ext.h" -#endif static int option_blit; @@ -234,8 +228,7 @@ nested_buffer_reference(struct nested_buffer_reference *ref, ref->buffer->busy_count--; if (ref->buffer->busy_count == 0) { assert(wl_resource_get_client(ref->buffer->resource)); - wl_resource_queue_event(ref->buffer->resource, - WL_BUFFER_RELEASE); + wl_buffer_send_release(ref->buffer->resource); } wl_list_remove(&ref->destroy_listener.link); } @@ -754,7 +747,7 @@ nested_init_compositor(struct nested *nested) nested->egl_display = display_get_egl_display(nested->display); extensions = eglQueryString(nested->egl_display, EGL_EXTENSIONS); - if (strstr(extensions, "EGL_WL_bind_wayland_display") == NULL) { + if (!weston_check_egl_extension(extensions, "EGL_WL_bind_wayland_display")) { fprintf(stderr, "no EGL_WL_bind_wayland_display extension\n"); return -1; } @@ -777,7 +770,7 @@ nested_init_compositor(struct nested *nested) const char *func = "eglCreateWaylandBufferFromImageWL"; const char *ext = "EGL_WL_create_wayland_buffer_from_image"; - if (strstr(extensions, ext)) { + if (weston_check_egl_extension(extensions, ext)) { create_wayland_buffer_from_image = (void *) eglGetProcAddress(func); use_ss_renderer = 1; |