Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

surface: accept commits with buffer size not divisible by scale #2998

Merged
merged 1 commit into from
Jun 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions types/wlr_surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static void surface_state_viewport_src_size(struct wlr_surface_state *state,
}
}

static bool surface_state_finalize(struct wlr_surface *surface,
static void surface_state_finalize(struct wlr_surface *surface,
struct wlr_surface_state *state) {
if ((state->committed & WLR_SURFACE_STATE_BUFFER)) {
if (state->buffer_resource != NULL) {
Expand All @@ -188,7 +188,6 @@ static bool surface_state_finalize(struct wlr_surface *surface,
wlr_log(WLR_DEBUG, "Client bug: submitted a buffer whose size (%dx%d) "
"is not divisible by scale (%d)", state->buffer_width,
state->buffer_height, state->scale);
return false;
}

if (state->viewport.has_dst) {
Expand All @@ -208,8 +207,6 @@ static bool surface_state_finalize(struct wlr_surface *surface,
pixman_region32_intersect_rect(&state->buffer_damage,
&state->buffer_damage, 0, 0, state->buffer_width,
state->buffer_height);

return true;
}

static void surface_update_damage(pixman_region32_t *buffer_damage,
Expand Down Expand Up @@ -471,9 +468,7 @@ static void surface_commit_state(struct wlr_surface *surface,
}

static void surface_commit_pending(struct wlr_surface *surface) {
if (!surface_state_finalize(surface, &surface->pending)) {
return;
}
surface_state_finalize(surface, &surface->pending);

if (surface->role && surface->role->precommit) {
surface->role->precommit(surface);
Expand Down