diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 14:27:51 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 14:27:51 +0300 |
| commit | 9ed89c17dee752154c36d71cae93d20cccfc71ef (patch) | |
| tree | a32cd894643ff6f6ebce83dd745bd24b35eb6520 /src/common/backend.c | |
| parent | aedd863e6f66fd446227e9b107bc9c1970092634 (diff) | |
perf: optimize hot-path loops, data structures, and cache locality
Diffstat (limited to 'src/common/backend.c')
| -rw-r--r-- | src/common/backend.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/backend.c b/src/common/backend.c index 4c755bd..c8d2caf 100644 --- a/src/common/backend.c +++ b/src/common/backend.c @@ -217,9 +217,13 @@ bool yasl_surface_present(struct yasl_surface *s, const struct yasl_framebuffer fb->size.x <= 0 || fb->size.y <= 0 || damage->n < -1 || damage->n > YASL_DAMAGE_MAX) return false; - struct yasl_damage_list clipped = {.n = damage->n}; - if (damage->n >= 0) { + struct yasl_damage_list clipped; + clipped.n = damage->n; + if (damage->n < 0) { + clipped.bounds = damage->bounds; + } else { clipped.n = 0; + clipped.bounds = (struct yasl_rect2i){0}; for (int i = 0; i < damage->n; i++) { struct yasl_rect2i r = damage->rects[i]; if (r.width < 0 || r.height < 0) return false; |
