backend: invert color and dim doesn't need reg_op
We only ever invert color of or dim the entire image, so just remove the ability to do region based inversion and dimming. Making implementing image_op easier. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
@ -203,14 +203,12 @@ void paint_all_new(session_t *ps, win *const t, bool ignore_damage) {
|
||||
®_bound_local);
|
||||
|
||||
// A region covers the entire window
|
||||
region_t reg_win;
|
||||
pixman_region32_init_rect(®_win, 0, 0, w->g.width, w->g.height);
|
||||
auto new_img = ps->backend_data->ops->copy(
|
||||
ps->backend_data, w->win_image, ®_visible_local);
|
||||
if (w->invert_color) {
|
||||
ps->backend_data->ops->image_op(
|
||||
ps->backend_data, IMAGE_OP_INVERT_COLOR, new_img,
|
||||
®_win, ®_visible_local, NULL);
|
||||
ps->backend_data, IMAGE_OP_INVERT_COLOR_ALL, new_img,
|
||||
NULL, ®_visible_local, NULL);
|
||||
}
|
||||
if (w->dim) {
|
||||
double dim_opacity = ps->o.inactive_dim;
|
||||
@ -218,7 +216,7 @@ void paint_all_new(session_t *ps, win *const t, bool ignore_damage) {
|
||||
dim_opacity *= w->opacity;
|
||||
}
|
||||
ps->backend_data->ops->image_op(
|
||||
ps->backend_data, IMAGE_OP_DIM, new_img, ®_win,
|
||||
ps->backend_data, IMAGE_OP_DIM_ALL, new_img, NULL,
|
||||
®_visible_local, (double[]){dim_opacity});
|
||||
}
|
||||
if (w->frame_opacity != 1) {
|
||||
@ -236,7 +234,6 @@ void paint_all_new(session_t *ps, win *const t, bool ignore_damage) {
|
||||
ps->backend_data->ops->compose(ps->backend_data, new_img, w->g.x,
|
||||
w->g.y, ®_paint, ®_visible);
|
||||
ps->backend_data->ops->release_image(ps->backend_data, new_img);
|
||||
pixman_region32_fini(®_win);
|
||||
pixman_region32_fini(®_visible_local);
|
||||
pixman_region32_fini(®_bound_local);
|
||||
}
|
||||
|
Reference in New Issue
Block a user