weston_buffer: Prepare for buffer to outlive resource
We currently allow a weston_buffer to outlive the underlying wl_buffer iff the renderer/backend has cached it. Currently the 'is this buffer valid?' test relies on looking for the validity of the weston_buffer itself; shift these tests to looking at the validity of the underlying resource. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
@@ -1983,7 +1983,11 @@ weston_view_is_opaque(struct weston_view *ev, pixman_region32_t *region)
|
|||||||
WL_EXPORT bool
|
WL_EXPORT bool
|
||||||
weston_view_has_valid_buffer(struct weston_view *ev)
|
weston_view_has_valid_buffer(struct weston_view *ev)
|
||||||
{
|
{
|
||||||
return ev->surface->buffer_ref.buffer != NULL;
|
if (!ev->surface->buffer_ref.buffer)
|
||||||
|
return false;
|
||||||
|
if (!ev->surface->buffer_ref.buffer->resource)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if the view matches the entire output
|
/** Check if the view matches the entire output
|
||||||
|
|||||||
@@ -420,6 +420,7 @@ drag_surface_configure(struct weston_drag *drag,
|
|||||||
assert((pointer != NULL && touch == NULL) ||
|
assert((pointer != NULL && touch == NULL) ||
|
||||||
(pointer == NULL && touch != NULL));
|
(pointer == NULL && touch != NULL));
|
||||||
|
|
||||||
|
/* XXX: Why are we checking for a valid buffer here too ... ? */
|
||||||
if (!weston_surface_is_mapped(es) && es->buffer_ref.buffer) {
|
if (!weston_surface_is_mapped(es) && es->buffer_ref.buffer) {
|
||||||
if (pointer && pointer->sprite &&
|
if (pointer && pointer->sprite &&
|
||||||
weston_view_is_mapped(pointer->sprite))
|
weston_view_is_mapped(pointer->sprite))
|
||||||
|
|||||||
Reference in New Issue
Block a user