-
-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/next' into fix-mask-image
- Loading branch information
Showing
30 changed files
with
986 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// SPDX-License-Identifier: MPL-2.0 | ||
// Copyright (c) Yuxuan Shui <[email protected]> | ||
#include <inttypes.h> | ||
#include <xcb/sync.h> | ||
#include <xcb/xcb.h> | ||
|
||
|
@@ -81,7 +82,10 @@ void handle_device_reset(session_t *ps) { | |
} | ||
|
||
/// 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) { | ||
struct timespec now = get_time_timespec(); | ||
auto paint_all_start_us = | ||
(uint64_t)now.tv_sec * 1000000UL + (uint64_t)now.tv_nsec / 1000; | ||
if (ps->backend_data->ops->device_status && | ||
ps->backend_data->ops->device_status(ps->backend_data) != DEVICE_STATUS_NORMAL) { | ||
return handle_device_reset(ps); | ||
|
@@ -96,16 +100,17 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) { | |
ps->xsync_exists = false; | ||
} | ||
} | ||
|
||
now = get_time_timespec(); | ||
auto after_sync_fence_us = | ||
(uint64_t)now.tv_sec * 1000000UL + (uint64_t)now.tv_nsec / 1000; | ||
log_trace("Time spent on sync fence: %" PRIu64 " us", | ||
after_sync_fence_us - paint_all_start_us); | ||
// All painting will be limited to the damage, if _some_ of | ||
// the paints bleed out of the damage region, it will destroy | ||
// part of the image we want to reuse | ||
region_t reg_damage; | ||
if (!ignore_damage) { | ||
reg_damage = get_damage(ps, ps->o.monitor_repaint || !ps->o.use_damage); | ||
} else { | ||
pixman_region32_init(®_damage); | ||
pixman_region32_copy(®_damage, &ps->screen_reg); | ||
} | ||
reg_damage = get_damage(ps, ps->o.monitor_repaint || !ps->o.use_damage); | ||
|
||
if (!pixman_region32_not_empty(®_damage)) { | ||
pixman_region32_fini(®_damage); | ||
|
@@ -181,6 +186,21 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) { | |
region_t reg_shadow_clip; | ||
pixman_region32_init(®_shadow_clip); | ||
|
||
now = get_time_timespec(); | ||
auto after_damage_us = (uint64_t)now.tv_sec * 1000000UL + (uint64_t)now.tv_nsec / 1000; | ||
log_trace("Getting damage took %" PRIu64 " us", after_damage_us - after_sync_fence_us); | ||
if (ps->next_render > 0) { | ||
log_trace("Render schedule deviation: %ld us (%s) %" PRIu64 " %ld", | ||
labs((long)after_damage_us - (long)ps->next_render), | ||
after_damage_us < ps->next_render ? "early" : "late", | ||
after_damage_us, ps->next_render); | ||
ps->last_schedule_delay = 0; | ||
if (after_damage_us > ps->next_render) { | ||
ps->last_schedule_delay = after_damage_us - ps->next_render; | ||
} | ||
} | ||
ps->did_render = true; | ||
|
||
if (ps->backend_data->ops->prepare) { | ||
ps->backend_data->ops->prepare(ps->backend_data, ®_paint); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.