Re: virtual surfaces and composition
LRN <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
On 09.12.2015 18:47, Henry (Yu) Song wrote: > Enrico Weigelt, metux IT consult wrote: >> I'm currently designing a new widget toolkit (focused on embedded / >> full screen targets) and exploring whether cairo is suitable for that. >> >> One important thing I didnt find out yet is how to create virtual >> surfaces / canvas'es which later can be composited onto the screen. >> >> The idea goes like this: >> >> For each widget, there will be an virtual surface / canvas, where the >> the widget renders itself on. In most cases, it will only be temporarily >> accessible - when the engine calls the individual widget's paint handler >> (unless the widget explicitly asks for a permanent surface). Optimally >> widgets will only be repainted, when it actually changes (eg. not on >> moving / scrolling, etc) - it's entirely up to the engine, whether >> to buffer pixmaps or paint operations, etc. > > Does cairo recording surface work for you? Unfortunately cairo > recording surface does not have "TRUE" playback though. But as long as > all of your operators are CAIRO_OPERATOR_OVER, you should be fine. CMIIW, but IME the recording surface draws roughly as fast as your own code does. I.e. you will get no speedup by caching drawing of a widget on a recording surface. Image surfaces should work fine and you can create image surfaces that are similar to the actual output surface of the display system you are using, so they can be composited efficiently (AFAIU). You might want to ask GTK+ developers about their experience in using cairo as a backend for a widget toolkit, because that is exactly what they are doing (and if your licensing situation allows, you can even borrow somre of their code; it's LGPLv2+). -- O< ascii ribbon - stop html email! - www.asciiribbon.org -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo
signature.asc
(application/pgp-signature, 473 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWaHB+AAoJEOs4Jb6SI2Cw1u8H/ji2Lv5MiGH6pBxw1m/PxHln ZVuTUNxLHzXi5zk0IO9CZAx3y2fFhIzLDQtRuQ4yiUd0s86aePHACVO6UhNjDdhe l7Cpw0egundWYD188vTnvWtUN4Rk8kRrtF79hIcQ2QEY77MaFkYjZH8VlJR95RiP Ts/Q+MR2B0zLhGMGOJATAdvtdYqaTD5eQuzQU9uXJeKQ7DLA7s+xlri2xrmsr5G2 E6hRpw+moq8g4wlw1lpnHKpO9T9a/zTwRpW4KSMLI/2KklhfEmbcUDAJ+1Ur2iPK v4ew5NFMkfGrf7+MtdVboQkcqN4pB3I6yHTmHBEBD7Ol/HyxWaQoLMCIo2C5/j0= =2C+s -----END PGP SIGNATURE-----