libweston: add color ops cap and bool renderer shadow buffer

This adds the libweston capability bit for "color operations" which
refers to a renderer's support for operations needed for color
management. GL-renderer will grow the support while Pixman-renderer will
not, which is why the cap is needed.

To make an example use of the cap, this also adds new API:
weston_output_set_renderer_shadow_buffer(). This is a temporary API to
enable future experimental features. The first such feature will be the
renderer internal shadow buffer, the boolean variable for it taken from
Harish Krupo's "weston.ini: introduce use-shadow-fbo in output config".

Obviously this patch does not implement the renderer shadow buffer. No
renderer sets WESTON_CAP_COLOR_OPS yet so trying to enable it will fail.

The documentation here is deliberately vague, because the bits needed
for color management will come in trickling for a long time until we can
call it color management in any sense. Until then, the temporary API
shall remain, perhaps poorly named.

Cc: Harish Krupo <harishkrupo@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen
2020-12-02 11:57:58 +02:00
parent 71078b4044
commit b5265af620
3 changed files with 42 additions and 0 deletions
+8
View File
@@ -359,6 +359,8 @@ struct weston_output {
bool enabled; /**< is in the output_list, not pending list */
int scale;
bool use_renderer_shadow_buffer;
int (*enable)(struct weston_output *output);
int (*disable)(struct weston_output *output);
@@ -970,6 +972,9 @@ enum weston_capability {
/* renderer supports explicit synchronization */
WESTON_CAP_EXPLICIT_SYNC = 0x0020,
/* renderer supports color management operations */
WESTON_CAP_COLOR_OPS = 0x0040,
};
/* Configuration struct for a backend.
@@ -2053,6 +2058,9 @@ void
weston_output_set_transform(struct weston_output *output,
uint32_t transform);
bool
weston_output_set_renderer_shadow_buffer(struct weston_output *output);
void
weston_output_init(struct weston_output *output,
struct weston_compositor *compositor,