mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
backend: remove const casts for pixman_region32_t
Pixman 0.42.0 has constified APIs for pixman_region32_t. We no longer need the casts.
This commit is contained in:
parent
8bbe8624df
commit
feb5691240
3 changed files with 10 additions and 11 deletions
|
@ -240,11 +240,11 @@ static bool atomic_crtc_commit(struct wlr_drm_connector *conn,
|
|||
|
||||
uint32_t fb_damage_clips = 0;
|
||||
if ((state->base->committed & WLR_OUTPUT_STATE_DAMAGE) &&
|
||||
pixman_region32_not_empty((pixman_region32_t *)&state->base->damage) &&
|
||||
pixman_region32_not_empty(&state->base->damage) &&
|
||||
crtc->primary->props.fb_damage_clips != 0) {
|
||||
int rects_len;
|
||||
const pixman_box32_t *rects = pixman_region32_rectangles(
|
||||
(pixman_region32_t *)&state->base->damage, &rects_len);
|
||||
const pixman_box32_t *rects =
|
||||
pixman_region32_rectangles(&state->base->damage, &rects_len);
|
||||
if (drmModeCreatePropertyBlob(drm->fd, rects,
|
||||
sizeof(*rects) * rects_len, &fb_damage_clips) != 0) {
|
||||
wlr_log_errno(WLR_ERROR, "Failed to create FB_DAMAGE_CLIPS property blob");
|
||||
|
|
|
@ -291,9 +291,9 @@ static bool output_commit(struct wlr_output *wlr_output,
|
|||
output->surface);
|
||||
}
|
||||
|
||||
pixman_region32_t *damage = NULL;
|
||||
const pixman_region32_t *damage = NULL;
|
||||
if (state->committed & WLR_OUTPUT_STATE_DAMAGE) {
|
||||
damage = (pixman_region32_t *) &state->damage;
|
||||
damage = &state->damage;
|
||||
}
|
||||
|
||||
if (output->frame_callback != NULL) {
|
||||
|
@ -318,10 +318,10 @@ static bool output_commit(struct wlr_output *wlr_output,
|
|||
0, 0, INT32_MAX, INT32_MAX);
|
||||
} else {
|
||||
int rects_len;
|
||||
pixman_box32_t *rects =
|
||||
const pixman_box32_t *rects =
|
||||
pixman_region32_rectangles(damage, &rects_len);
|
||||
for (int i = 0; i < rects_len; i++) {
|
||||
pixman_box32_t *r = &rects[i];
|
||||
const pixman_box32_t *r = &rects[i];
|
||||
wl_surface_damage_buffer(output->surface, r->x1, r->y1,
|
||||
r->x2 - r->x1, r->y2 - r->y1);
|
||||
}
|
||||
|
|
|
@ -283,11 +283,10 @@ static bool output_commit_buffer(struct wlr_x11_output *output,
|
|||
|
||||
xcb_xfixes_region_t region = XCB_NONE;
|
||||
if (state->committed & WLR_OUTPUT_STATE_DAMAGE) {
|
||||
pixman_region32_union(&output->exposed, &output->exposed,
|
||||
(pixman_region32_t *) &state->damage);
|
||||
pixman_region32_union(&output->exposed, &output->exposed, &state->damage);
|
||||
|
||||
int rects_len = 0;
|
||||
pixman_box32_t *rects = pixman_region32_rectangles(&output->exposed, &rects_len);
|
||||
const pixman_box32_t *rects = pixman_region32_rectangles(&output->exposed, &rects_len);
|
||||
|
||||
xcb_rectangle_t *xcb_rects = calloc(rects_len, sizeof(xcb_rectangle_t));
|
||||
if (!xcb_rects) {
|
||||
|
@ -295,7 +294,7 @@ static bool output_commit_buffer(struct wlr_x11_output *output,
|
|||
}
|
||||
|
||||
for (int i = 0; i < rects_len; i++) {
|
||||
pixman_box32_t *box = &rects[i];
|
||||
const pixman_box32_t *box = &rects[i];
|
||||
xcb_rects[i] = (struct xcb_rectangle_t){
|
||||
.x = box->x1,
|
||||
.y = box->y1,
|
||||
|
|
Loading…
Reference in a new issue