backend: remove unused parameter 'ignore_damage'

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2022-12-12 10:41:54 +00:00
parent 3aed5599c3
commit 62fcfe5d1a
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
5 changed files with 8 additions and 14 deletions

View File

@ -81,7 +81,7 @@ void handle_device_reset(session_t *ps) {
} }
/// paint all windows /// paint all windows
void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) { void paint_all_new(session_t *ps, struct managed_win *t) {
if (ps->backend_data->ops->device_status && if (ps->backend_data->ops->device_status &&
ps->backend_data->ops->device_status(ps->backend_data) != DEVICE_STATUS_NORMAL) { ps->backend_data->ops->device_status(ps->backend_data) != DEVICE_STATUS_NORMAL) {
return handle_device_reset(ps); return handle_device_reset(ps);
@ -100,12 +100,7 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) {
// the paints bleed out of the damage region, it will destroy // the paints bleed out of the damage region, it will destroy
// part of the image we want to reuse // part of the image we want to reuse
region_t reg_damage; region_t reg_damage;
if (!ignore_damage) { reg_damage = get_damage(ps, ps->o.monitor_repaint || !ps->o.use_damage);
reg_damage = get_damage(ps, ps->o.monitor_repaint || !ps->o.use_damage);
} else {
pixman_region32_init(&reg_damage);
pixman_region32_copy(&reg_damage, &ps->screen_reg);
}
if (!pixman_region32_not_empty(&reg_damage)) { if (!pixman_region32_not_empty(&reg_damage)) {
pixman_region32_fini(&reg_damage); pixman_region32_fini(&reg_damage);

View File

@ -363,5 +363,4 @@ struct backend_operations {
extern struct backend_operations *backend_list[]; extern struct backend_operations *backend_list[];
void paint_all_new(session_t *ps, struct managed_win *const t, bool ignore_damage) void paint_all_new(session_t *ps, struct managed_win *const t) attr_nonnull(1);
attr_nonnull(1);

View File

@ -1524,9 +1524,9 @@ static void draw_callback_impl(EV_P_ session_t *ps, int revents attr_unused) {
log_trace("Render start, frame %d", paint); log_trace("Render start, frame %d", paint);
if (!ps->o.legacy_backends) { if (!ps->o.legacy_backends) {
paint_all_new(ps, bottom, false); paint_all_new(ps, bottom);
} else { } else {
paint_all(ps, bottom, false); paint_all(ps, bottom);
} }
log_trace("Render end"); log_trace("Render end");

View File

@ -969,7 +969,7 @@ win_blur_background(session_t *ps, struct managed_win *w, xcb_render_picture_t t
/// paint all windows /// paint all windows
/// region = ?? /// region = ??
/// region_real = the damage region /// region_real = the damage region
void paint_all(session_t *ps, struct managed_win *t, bool ignore_damage) { void paint_all(session_t *ps, struct managed_win *t) {
if (ps->o.xrender_sync_fence || (ps->drivers & DRIVER_NVIDIA)) { if (ps->o.xrender_sync_fence || (ps->drivers & DRIVER_NVIDIA)) {
if (ps->xsync_exists && !x_fence_sync(ps->c, ps->sync_fence)) { if (ps->xsync_exists && !x_fence_sync(ps->c, ps->sync_fence)) {
log_error("x_fence_sync failed, xrender-sync-fence will be " log_error("x_fence_sync failed, xrender-sync-fence will be "
@ -984,7 +984,7 @@ void paint_all(session_t *ps, struct managed_win *t, bool ignore_damage) {
region_t region; region_t region;
pixman_region32_init(&region); pixman_region32_init(&region);
int buffer_age = get_buffer_age(ps); int buffer_age = get_buffer_age(ps);
if (buffer_age == -1 || buffer_age > ps->ndamage || ignore_damage) { if (buffer_age == -1 || buffer_age > ps->ndamage) {
pixman_region32_copy(&region, &ps->screen_reg); pixman_region32_copy(&region, &ps->screen_reg);
} else { } else {
for (int i = 0; i < get_buffer_age(ps); i++) { for (int i = 0; i < get_buffer_age(ps); i++) {

View File

@ -37,7 +37,7 @@ void render(session_t *ps, int x, int y, int dx, int dy, int w, int h, int fullw
const glx_prog_main_t *pprogram, clip_t *clip); const glx_prog_main_t *pprogram, clip_t *clip);
void paint_one(session_t *ps, struct managed_win *w, const region_t *reg_paint); void paint_one(session_t *ps, struct managed_win *w, const region_t *reg_paint);
void paint_all(session_t *ps, struct managed_win *const t, bool ignore_damage); void paint_all(session_t *ps, struct managed_win *const t);
void free_picture(xcb_connection_t *c, xcb_render_picture_t *p); void free_picture(xcb_connection_t *c, xcb_render_picture_t *p);