Update e_wayland surface and renderer for changes in wayland protocol.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-06-24 10:29:56 +01:00
parent 016793098e
commit fc2c2344a5
2 changed files with 13 additions and 6 deletions

View File

@ -267,6 +267,7 @@ _e_renderer_cb_attach(E_Surface *surface, struct wl_buffer *buffer)
Evas_Coord w = 0, h = 0; Evas_Coord w = 0, h = 0;
void *data; void *data;
int stride = 0; int stride = 0;
struct wl_shm_buffer *shm_buffer;
state = surface->state; state = surface->state;
@ -277,7 +278,13 @@ _e_renderer_cb_attach(E_Surface *surface, struct wl_buffer *buffer)
if (!buffer) return; if (!buffer) return;
switch (wl_shm_buffer_get_format(buffer)) if (!(shm_buffer = wl_shm_buffer_get(&buffer->resource)))
{
e_buffer_reference(&state->buffer_reference, NULL);
return;
}
switch (wl_shm_buffer_get_format(shm_buffer))
{ {
case WL_SHM_FORMAT_XRGB8888: case WL_SHM_FORMAT_XRGB8888:
format = PIXMAN_x8r8g8b8; format = PIXMAN_x8r8g8b8;
@ -287,10 +294,10 @@ _e_renderer_cb_attach(E_Surface *surface, struct wl_buffer *buffer)
break; break;
} }
w = wl_shm_buffer_get_width(buffer); w = wl_shm_buffer_get_width(shm_buffer);
h = wl_shm_buffer_get_height(buffer); h = wl_shm_buffer_get_height(shm_buffer);
data = wl_shm_buffer_get_data(buffer); data = wl_shm_buffer_get_data(shm_buffer);
stride = wl_shm_buffer_get_stride(buffer); stride = wl_shm_buffer_get_stride(shm_buffer);
state->image = pixman_image_create_bits(format, w, h, data, stride); state->image = pixman_image_create_bits(format, w, h, data, stride);
} }

View File

@ -191,7 +191,7 @@ e_surface_damage_calculate(E_Surface *es, pixman_region32_t *opaque)
if (es->buffer.reference.buffer) if (es->buffer.reference.buffer)
{ {
/* if this is an shm buffer, flush any pending damage */ /* if this is an shm buffer, flush any pending damage */
if (wl_buffer_is_shm(es->buffer.reference.buffer)) if (wl_shm_buffer_get(es->buffer.reference.buffer))
{ {
if (_e_comp->renderer->damage_flush) if (_e_comp->renderer->damage_flush)
_e_comp->renderer->damage_flush(es); _e_comp->renderer->damage_flush(es);