1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2025-10-30 23:46:46 -04:00

api/backend: bump backend version to 2.0 for v14 release

API changes & anticipated API change:

- Generalize the `dim` parameter of blit to `tint`. Allowing a multiplicative
  factor for each of the color channels.
- New backend interface: `new_image_from_pixels`. Creating an initialized image
  from pixel data. The current create X pixmap -> bind_pixmap code path is
  cumbersome for some backends. Most notably it requires an X VisualID for the
  pixmap. But some pictfmts (e.g. single channel A8) don't have corresponding
  visuals.

Changelog: Internal: Breaking change to backend API, to allow better image
creation, and applying tints to windows.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2025-08-17 03:16:58 +01:00
parent e9cb842a83
commit 0c0b97ad0d
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4
2 changed files with 18 additions and 3 deletions

View file

@ -9,7 +9,7 @@
#include "types.h"
#define PICOM_BACKEND_MAJOR (1UL)
#define PICOM_BACKEND_MAJOR (2UL)
#define PICOM_BACKEND_MINOR (0UL)
#define PICOM_BACKEND_MAKE_VERSION(major, minor) ((major) * 1000 + (minor))
@ -332,12 +332,26 @@ struct backend_operations {
/// Create a new, uninitialized image with the given format and size.
///
/// @param backend_data backend data
/// @param format the format of the image
/// @param size the size of the image
/// @param format format of the image
/// @param size size of the image
image_handle (*new_image)(struct backend_base *backend_data,
enum backend_image_format format, ivec2 size)
__attribute__((nonnull(1)));
/// Create a new image with the given format and size, and initialize it with
/// data. Optional, only used if backend has quirk: BACKEND_QUIRK_SLOW_BLUR.
///
/// @param backend_data backend data
/// @param format format of the image
/// @param size size of the image
/// @param pixels data. for BACKEND_IMAGE_FORMAT_MASK, each byte is a pixel;
/// for BACKEND_IMAGE_FORMAT_PIXMAP, it's 4 bytes/pixel, each
/// pixel is given in the RGBA order.
image_handle (*new_image_from_pixels)(struct backend_base *backend_data,
enum backend_image_format format, ivec2 size,
int stride, const uint8_t *pixels)
__attribute__((nonnull(1)));
/// Bind a X pixmap to the backend's internal image data structure.
///
/// @param backend_data backend data

View file

@ -80,6 +80,7 @@ changelog_categories = {
'BuildChange': 'Build changes',
'NewFeature': 'New features',
'Deprecation': 'Deprecations',
'Internal': 'Internal changes',
'Uncategorized': 'Other changes',
}