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
+33
View File
@@ -6224,6 +6224,39 @@ weston_output_set_transform(struct weston_output *output,
}
}
/** Make the output use renderer shadow buffer.
*
* \param output The weston_output object to modify.
* \return True on success, false if unsupported.
*
* This can only be set on a disabled output object.
*
* This is a temporary API to demonstrate WESTON_CAP_COLOR_OPS and allow
* testing related features. This will be superseded with color management
* API.
*
* By default, a renderer is not using a shadow buffer of its own. Enabling
* a shadow buffer may enable other color related features.
*
* Support depends on the chosen renderer and the graphics driver stack in use.
*
* \ingroup output
*/
WL_EXPORT bool
weston_output_set_renderer_shadow_buffer(struct weston_output *output)
{
struct weston_compositor *compositor = output->compositor;
assert(!output->enabled);
if (compositor->capabilities & WESTON_CAP_COLOR_OPS) {
output->use_renderer_shadow_buffer = true;
return true;
}
return false;
}
/** Initializes a weston_output object with enough data so
** an output can be configured.
*