diff --git a/libweston/backend-drm/state-propose.c b/libweston/backend-drm/state-propose.c index 41fb7b2dd..99a291e25 100644 --- a/libweston/backend-drm/state-propose.c +++ b/libweston/backend-drm/state-propose.c @@ -641,7 +641,7 @@ drm_output_find_plane_for_view(struct drm_output_state *state, } /* check view for valid buffer, doesn't make sense to even try */ - if (!weston_view_has_valid_buffer(ev)) { + if (!weston_paint_node_has_valid_buffer(pnode)) { pnode->try_view_on_plane_failure_reasons |= FAILURE_REASONS_NO_BUFFER; return NULL; @@ -1104,13 +1104,13 @@ drm_output_propose_state_try_reuse(struct weston_output *output_base, /* FIXME: If we get here, there should be a valid weston_buffer, and that's * all we should ever need at this point. If the buffer is deleted while - * attached to a surface right now weston_view_has_valid_buffer() sees the + * attached to a surface right now weston_paint_node_has_valid_buffer() sees the * buffer as invalid. We don't want that to be the case, but we also don't * want paint node DIRTY bits to track that. This will be cleaned up in the * future by chasing down remaining bugs in buffer lifecycle management, at * which point we replace this with a weston_assert() instead. */ - if (!weston_view_has_valid_buffer(pnode->view)) { + if (!weston_paint_node_has_valid_buffer(pnode)) { drm_debug(b, "\t\t[reuse] view %s no longer has a valid buffer\n", pnode->view->internal_name); drm_output_state_free(state); @@ -1368,7 +1368,7 @@ drm_output_propose_state(struct weston_output *output_base, pnode->try_view_on_plane_failure_reasons |= FAILURE_REASONS_NO_GBM; - if (!weston_view_has_valid_buffer(ev)) + if (!weston_paint_node_has_valid_buffer(pnode)) pnode->try_view_on_plane_failure_reasons |= FAILURE_REASONS_NO_BUFFER; @@ -1635,7 +1635,7 @@ drm_assign_planes(struct weston_output *output_base) /* Test whether this buffer can ever go into a plane: * non-shm, or small enough to be a cursor. */ ev->surface->keep_buffer = false; - if (weston_view_has_valid_buffer(ev)) { + if (weston_paint_node_has_valid_buffer(pnode)) { struct weston_buffer *buffer = ev->surface->buffer_ref.buffer; if (buffer->type == WESTON_BUFFER_DMABUF || diff --git a/libweston/backend-vnc/vnc.c b/libweston/backend-vnc/vnc.c index 554143059..92e8d527b 100644 --- a/libweston/backend-vnc/vnc.c +++ b/libweston/backend-vnc/vnc.c @@ -597,7 +597,9 @@ vnc_output_assign_cursor_plane(struct vnc_output *output) return; view = pointer->sprite; - if (!weston_view_has_valid_buffer(view)) + assert(pointer_pnode); + + if (!weston_paint_node_has_valid_buffer(pointer_pnode)) return; buffer = view->surface->buffer_ref.buffer; @@ -608,8 +610,6 @@ vnc_output_assign_cursor_plane(struct vnc_output *output) if (format != WL_SHM_FORMAT_ARGB8888) return; - assert(pointer_pnode); - weston_paint_node_move_to_plane(pointer_pnode, &output->cursor_plane); output->cursor_surface = view->surface; diff --git a/libweston/compositor.c b/libweston/compositor.c index b773c8e52..13a17f06a 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -2357,18 +2357,18 @@ weston_view_is_fully_blended(struct weston_view *ev, pixman_region32_t *region) return !pixman_region32_not_empty(&ev->transform.opaque); } -/** Check if the view has a valid buffer available +/** Check if the paint node has a valid buffer available * - * @param ev The view to check if it has a valid buffer. + * @param pnode The view to check if it has a valid buffer. * * Returns true if the view has a valid buffer or false otherwise. */ WL_EXPORT bool -weston_view_has_valid_buffer(struct weston_view *ev) +weston_paint_node_has_valid_buffer(struct weston_paint_node *pnode) { - if (!ev->surface->buffer_ref.buffer) + if (!pnode->surface->buffer_ref.buffer) return false; - if (!ev->surface->buffer_ref.buffer->resource) + if (!pnode->surface->buffer_ref.buffer->resource) return false; return true; } diff --git a/libweston/libweston-internal.h b/libweston/libweston-internal.h index a35af8e5b..46924f698 100644 --- a/libweston/libweston-internal.h +++ b/libweston/libweston-internal.h @@ -545,7 +545,7 @@ bool weston_view_is_opaque(struct weston_view *ev, pixman_region32_t *region); bool -weston_view_has_valid_buffer(struct weston_view *ev); +weston_paint_node_has_valid_buffer(struct weston_paint_node *pnode); bool weston_view_takes_input_at_point(struct weston_view *view,