[PATCH wayland 1/3 v2] shm: Deprecate wl_shm_buffer_create()
Derek Foreman
derekf at osg.samsung.com
Fri Jun 26 09:34:59 PDT 2015
>From irc:
<pq> it creates a wl_buffer object in a way that no client can ever
access the storage.
So, let's replace it with abort(); and mark it with WL_DEPRECATED
in the header.
Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
This time using WL_DEPRECATED
src/wayland-server-core.h | 2 +-
src/wayland-shm.c | 29 +----------------------------
2 files changed, 2 insertions(+), 29 deletions(-)
diff --git a/src/wayland-server-core.h b/src/wayland-server-core.h
index e605432..dc87168 100644
--- a/src/wayland-server-core.h
+++ b/src/wayland-server-core.h
@@ -397,7 +397,7 @@ wl_display_add_shm_format(struct wl_display *display, uint32_t format);
struct wl_shm_buffer *
wl_shm_buffer_create(struct wl_client *client,
uint32_t id, int32_t width, int32_t height,
- int32_t stride, uint32_t format);
+ int32_t stride, uint32_t format) WL_DEPRECATED;
void wl_log_set_handler_server(wl_log_func_t handler);
diff --git a/src/wayland-shm.c b/src/wayland-shm.c
index 5c419fa..a9a0b76 100644
--- a/src/wayland-shm.c
+++ b/src/wayland-shm.c
@@ -319,34 +319,7 @@ wl_shm_buffer_create(struct wl_client *client,
uint32_t id, int32_t width, int32_t height,
int32_t stride, uint32_t format)
{
- struct wl_shm_buffer *buffer;
-
- if (!format_is_supported(client, format))
- return NULL;
-
- buffer = malloc(sizeof *buffer + stride * height);
- if (buffer == NULL)
- return NULL;
-
- buffer->width = width;
- buffer->height = height;
- buffer->format = format;
- buffer->stride = stride;
- buffer->offset = 0;
- buffer->pool = NULL;
-
- buffer->resource =
- wl_resource_create(client, &wl_buffer_interface, 1, id);
- if (buffer->resource == NULL) {
- free(buffer);
- return NULL;
- }
-
- wl_resource_set_implementation(buffer->resource,
- &shm_buffer_interface,
- buffer, destroy_buffer);
-
- return buffer;
+ abort();
}
WL_EXPORT struct wl_shm_buffer *
--
2.1.4
More information about the wayland-devel
mailing list