labwc/src/common
John Lindgren d2b161bdf8 buffer: reduce unnecessary painting to new cairo surfaces
Add buffer_adopt_cairo_surface(), which allows wrapping an existing
cairo image surface in a struct lab_data_buffer. This is useful when
loading PNGs since most will be loaded as ARGB32 already.

Fix a memory leak in the non-ARGB32 PNG case, where we do still need to
paint to a new image surface -- we were leaking the original surface.

Eliminate an unnecessary temporary image surface in SVG loading and just
render the SVG to the image surface held by the lab_data_buffer.

I also cleaned up and clarified the buffer API a bit:

- Add a pointer to the held cairo_surface_t (so we can still access it
  if there is no cairo_t).
- Remove the free_on_destroy bool (it was always true).
- Rename unscaled_width/height to logical_width/height and add an
  explanatory comment. It was unclear what "unscaled" meant.
- Rename buffer_create_wrap() to buffer_create_from_data().

This is laying groundwork for some more icon fixes I am working on
(making sure icons are loaded and rendered at the correct scale).
2024-10-06 16:51:14 +01:00
..
box.c view: implement cascade placement policy 2024-07-20 08:59:46 +01:00
buf.c common/buf.c: use 0 directly in vsnprintf() 2024-08-23 20:20:50 +02:00
dir.c common/buf: rename buf->buf to buf->data 2024-04-18 07:00:23 +01:00
direction.c action: make "FocusOutput" behave like "MoveToOutput" 2024-08-24 14:59:42 -04:00
fd-util.c Replace _ with - in source file names 2024-05-22 07:10:51 +01:00
file-helpers.c common/file-helpers.c: share file_exists() to reduce duplication 2023-09-17 19:26:41 +01:00
font.c buffer: reduce unnecessary painting to new cairo surfaces 2024-10-06 16:51:14 +01:00
grab-file.c common: remove buf_init(), add BUF_INIT and buf_move() 2024-04-18 07:00:23 +01:00
graphic-helpers.c buffer: reduce unnecessary painting to new cairo surfaces 2024-10-06 16:51:14 +01:00
match.c common: use fnmatch() for pattern matching 2023-10-01 14:17:29 +01:00
mem.c common: Add additional memory utilities (xzalloc() etc.) 2022-09-17 10:57:30 -04:00
meson.build action: make "FocusOutput" behave like "MoveToOutput" 2024-08-24 14:59:42 -04:00
nodename.c Fixed some typos 2024-01-04 19:32:51 +00:00
parse-bool.c session: only update activation environment... 2024-03-04 01:57:32 +01:00
parse-double.c common: validate and properly parse floats 2024-04-02 10:37:50 -04:00
scaled-font-buffer.c buffer: reduce unnecessary painting to new cairo surfaces 2024-10-06 16:51:14 +01:00
scaled-scene-buffer.c buffer: reduce unnecessary painting to new cairo surfaces 2024-10-06 16:51:14 +01:00
scene-helpers.c scene-helpers: use pending_commit_damage, chases wlr!4253 2024-08-15 20:51:20 +01:00
spawn.c Replace _ with - in source file names 2024-05-22 07:10:51 +01:00
string-helpers.c session: process environment.d and allow empty variables 2024-03-11 20:01:14 +00:00
surface-helpers.c cursor: process layer subsurfaces in cursor_button_press() 2024-03-09 00:44:19 +01:00