mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-14 05:33:59 -04:00
shm: add damage tracking to buffer
This commit is contained in:
parent
c8b342ae51
commit
434c9c3a34
2 changed files with 9 additions and 0 deletions
5
shm.c
5
shm.c
|
|
@ -102,6 +102,9 @@ buffer_destroy(struct buffer *buf)
|
||||||
buf->real_mmapped = MAP_FAILED;
|
buf->real_mmapped = MAP_FAILED;
|
||||||
buf->pool = NULL;
|
buf->pool = NULL;
|
||||||
buf->fd = -1;
|
buf->fd = -1;
|
||||||
|
|
||||||
|
tll_free(buf->scroll_damage);
|
||||||
|
pixman_region32_fini(&buf->dirty);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -399,6 +402,8 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie,
|
||||||
if (!instantiate_offset(shm, ret, initial_offset))
|
if (!instantiate_offset(shm, ret, initial_offset))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
pixman_region32_init(&ret->dirty);
|
||||||
|
|
||||||
#if defined(MEASURE_SHM_ALLOCS) && MEASURE_SHM_ALLOCS
|
#if defined(MEASURE_SHM_ALLOCS) && MEASURE_SHM_ALLOCS
|
||||||
{
|
{
|
||||||
size_t currently_alloced = 0;
|
size_t currently_alloced = 0;
|
||||||
|
|
|
||||||
4
shm.h
4
shm.h
|
|
@ -7,6 +7,8 @@
|
||||||
#include <pixman.h>
|
#include <pixman.h>
|
||||||
#include <wayland-client.h>
|
#include <wayland-client.h>
|
||||||
|
|
||||||
|
#include "terminal.h"
|
||||||
|
|
||||||
struct buffer {
|
struct buffer {
|
||||||
unsigned long cookie;
|
unsigned long cookie;
|
||||||
|
|
||||||
|
|
@ -34,6 +36,8 @@ struct buffer {
|
||||||
bool purge; /* True if this buffer should be destroyed */
|
bool purge; /* True if this buffer should be destroyed */
|
||||||
|
|
||||||
int age;
|
int age;
|
||||||
|
tll (struct damage) scroll_damage;
|
||||||
|
pixman_region32_t dirty;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct buffer *shm_get_buffer(
|
struct buffer *shm_get_buffer(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue