clutter: Add color state pipeline capability enum

So far 'color-state' is added, intended to tag pipelines with color
state transformation capabilities. Color state transformation snippets
are tagged with it. Eventually handlers of pipelines will use this
information to on-demand decorate pipelines with color transformation
snippets.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
This commit is contained in:
Jonas Ådahl 2024-05-27 11:18:40 +02:00 committed by Sebastian Wick
parent f67ace517f
commit 15df584b7e
3 changed files with 14 additions and 0 deletions

View File

@ -835,6 +835,9 @@ clutter_color_state_get_transform_snippet (ClutterColorState *color_state,
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
globals_source->str,
snippet_source->str);
cogl_snippet_set_capability (snippet,
CLUTTER_PIPELINE_CAPABILITY,
CLUTTER_PIPELINE_CAPABILITY_COLOR_STATE);
g_hash_table_insert (snippet_cache,
g_memdup2 (&cache_key, sizeof (cache_key)),
g_object_ref (snippet));

View File

@ -53,6 +53,8 @@ typedef struct
GDestroyNotify notify;
} ClutterThreadsDispatch;
G_DEFINE_QUARK (clutter_pipeline_capability, clutter_pipeline_capability)
/* main context */
static ClutterContext *ClutterCntx = NULL;

View File

@ -90,6 +90,15 @@ typedef enum
*/
#define CLUTTER_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 50)
typedef enum _ClutterPipelineCapability
{
CLUTTER_PIPELINE_CAPABILITY_COLOR_STATE,
} ClutterPipelineCapability;
#define CLUTTER_PIPELINE_CAPABILITY (clutter_pipeline_capability_quark ())
CLUTTER_EXPORT
GQuark clutter_pipeline_capability_quark (void);
CLUTTER_EXPORT
void clutter_stage_handle_event (ClutterStage *stage,
ClutterEvent *event);