diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2021-02-17 12:12:45 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2021-02-17 12:12:45 -0800 |
commit | 68c56c156fcfe4909c65e2eea6ed5d8518c91792 (patch) | |
tree | 71ffb705a9ac11367a1b198657a288f8ebffa9dc | |
parent | 500468aa3aa5a572be59d8b022ed86803086e1f6 (diff) |
gtk_fb: add note about xshm surfaces
After some discussion with chergert on how this could be quicker
on X, it seemed worth noting at least something to this effect.
The details of doing this seemed annoying, because cairo apparently
doesn't just give you an xshm if appropriate via
gdk_window_create_similar_image_surface()
If that was all that were needed, this commit would just change the
cairo_image_surface_create() over to that. But chergert claimed it
doesn't do the right thing here, so a comment it is until someone
cares enough to to investigate further.
-rw-r--r-- | src/gtk_fb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gtk_fb.c b/src/gtk_fb.c index 1d8719b..0d70c0b 100644 --- a/src/gtk_fb.c +++ b/src/gtk_fb.c @@ -141,6 +141,14 @@ static void * gtk_fb_page_alloc(fb_t *fb, void *context, fb_page_t *res_page) if (!p) return NULL; + /* XXX: note this is a plain in-memory surface that will always work everywhere, + * but that generality prevents potential optimizations. + * With some extra effort, on backends like X, an xshm surface could be + * created instead, for a potential performance boost by having the + * surface contents accessible server-side where accelerated copies may + * be used, while also accessible client-side where rototiller draws into. + * TODO if better X performance is desired. + */ p->surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, c->width, c->height); res_page->fragment.buf = (uint32_t *)cairo_image_surface_get_data(p->surface); |