clutter/color-state: Handle adding snippet to pipeline
While no functional changes right now, this allows us to add extra hooks like adding uniforms. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
This commit is contained in:
@ -690,10 +690,7 @@ get_color_space_mapping_matrix (ClutterColorState *color_state,
|
|||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
static CoglSnippet *
|
||||||
* clutter_color_state_get_transform_snippet: (skip)
|
|
||||||
*/
|
|
||||||
CoglSnippet *
|
|
||||||
clutter_color_state_get_transform_snippet (ClutterColorState *color_state,
|
clutter_color_state_get_transform_snippet (ClutterColorState *color_state,
|
||||||
ClutterColorState *target_color_state)
|
ClutterColorState *target_color_state)
|
||||||
{
|
{
|
||||||
@ -708,8 +705,6 @@ clutter_color_state_get_transform_snippet (ClutterColorState *color_state,
|
|||||||
g_autoptr (GString) globals_source = NULL;
|
g_autoptr (GString) globals_source = NULL;
|
||||||
g_autoptr (GString) snippet_source = NULL;
|
g_autoptr (GString) snippet_source = NULL;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (target_color_state), NULL);
|
|
||||||
|
|
||||||
priv = clutter_color_state_get_instance_private (color_state);
|
priv = clutter_color_state_get_instance_private (color_state);
|
||||||
color_manager = clutter_context_get_color_manager (priv->context);
|
color_manager = clutter_context_get_color_manager (priv->context);
|
||||||
|
|
||||||
@ -810,6 +805,21 @@ clutter_color_state_get_transform_snippet (ClutterColorState *color_state,
|
|||||||
return snippet;
|
return snippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
clutter_color_state_add_pipeline_transform (ClutterColorState *color_state,
|
||||||
|
ClutterColorState *target_color_state,
|
||||||
|
CoglPipeline *pipeline)
|
||||||
|
{
|
||||||
|
g_autoptr (CoglSnippet) snippet = NULL;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_COLOR_STATE (color_state));
|
||||||
|
g_return_if_fail (CLUTTER_IS_COLOR_STATE (target_color_state));
|
||||||
|
|
||||||
|
snippet = clutter_color_state_get_transform_snippet (color_state,
|
||||||
|
target_color_state);
|
||||||
|
cogl_pipeline_add_snippet (pipeline, snippet);
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
clutter_color_state_equals (ClutterColorState *color_state,
|
clutter_color_state_equals (ClutterColorState *color_state,
|
||||||
ClutterColorState *other_color_state)
|
ClutterColorState *other_color_state)
|
||||||
|
@ -50,8 +50,9 @@ CLUTTER_EXPORT
|
|||||||
ClutterTransferFunction clutter_color_state_get_transfer_function (ClutterColorState *color_state);
|
ClutterTransferFunction clutter_color_state_get_transfer_function (ClutterColorState *color_state);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
CoglSnippet * clutter_color_state_get_transform_snippet (ClutterColorState *color_state,
|
void clutter_color_state_add_pipeline_transform (ClutterColorState *color_state,
|
||||||
ClutterColorState *target_color_state);
|
ClutterColorState *target_color_state,
|
||||||
|
CoglPipeline *pipeline);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_color_state_equals (ClutterColorState *color_state,
|
gboolean clutter_color_state_equals (ClutterColorState *color_state,
|
||||||
|
@ -406,13 +406,10 @@ clutter_pipeline_node_draw (ClutterPaintNode *node,
|
|||||||
clutter_paint_context_get_color_state (paint_context);
|
clutter_paint_context_get_color_state (paint_context);
|
||||||
ClutterColorState *target_color_state =
|
ClutterColorState *target_color_state =
|
||||||
clutter_paint_context_get_target_color_state (paint_context);
|
clutter_paint_context_get_target_color_state (paint_context);
|
||||||
g_autoptr (CoglSnippet) color_snippet = NULL;
|
|
||||||
|
|
||||||
color_snippet =
|
clutter_color_state_add_pipeline_transform (color_state,
|
||||||
clutter_color_state_get_transform_snippet (color_state,
|
target_color_state,
|
||||||
target_color_state);
|
pnode->pipeline);
|
||||||
if (color_snippet)
|
|
||||||
cogl_pipeline_add_snippet (pnode->pipeline, color_snippet);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cogl_pipeline_get_name (pnode->pipeline))
|
if (!cogl_pipeline_get_name (pnode->pipeline))
|
||||||
@ -739,6 +736,27 @@ clutter_text_node_pre_draw (ClutterPaintNode *node,
|
|||||||
return tnode->layout != NULL;
|
return tnode->layout != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ClutterColorState *color_state;
|
||||||
|
ClutterColorState *target_color_state;
|
||||||
|
} PangoPipelineData;
|
||||||
|
|
||||||
|
static void
|
||||||
|
setup_pango_pipeline (CoglPipeline *pipeline,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
PangoPipelineData *pango_pipeline_data = user_data;
|
||||||
|
ClutterColorState *color_state =
|
||||||
|
pango_pipeline_data->color_state;
|
||||||
|
ClutterColorState *target_color_state =
|
||||||
|
pango_pipeline_data->target_color_state;
|
||||||
|
|
||||||
|
clutter_color_state_add_pipeline_transform (color_state,
|
||||||
|
target_color_state,
|
||||||
|
pipeline);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_text_node_draw (ClutterPaintNode *node,
|
clutter_text_node_draw (ClutterPaintNode *node,
|
||||||
ClutterPaintContext *paint_context)
|
ClutterPaintContext *paint_context)
|
||||||
@ -748,17 +766,18 @@ clutter_text_node_draw (ClutterPaintNode *node,
|
|||||||
clutter_paint_context_get_color_state (paint_context);
|
clutter_paint_context_get_color_state (paint_context);
|
||||||
ClutterColorState *target_color_state =
|
ClutterColorState *target_color_state =
|
||||||
clutter_paint_context_get_target_color_state (paint_context);
|
clutter_paint_context_get_target_color_state (paint_context);
|
||||||
g_autoptr (CoglSnippet) color_snippet = NULL;
|
|
||||||
PangoRectangle extents;
|
PangoRectangle extents;
|
||||||
CoglFramebuffer *fb;
|
CoglFramebuffer *fb;
|
||||||
guint i;
|
guint i;
|
||||||
|
PangoPipelineData pango_pipeline_data = {};
|
||||||
|
|
||||||
if (node->operations == NULL)
|
if (node->operations == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
color_snippet =
|
pango_pipeline_data = (PangoPipelineData) {
|
||||||
clutter_color_state_get_transform_snippet (color_state,
|
.color_state = color_state,
|
||||||
target_color_state);
|
.target_color_state = target_color_state,
|
||||||
|
};
|
||||||
|
|
||||||
fb = get_target_framebuffer (node, paint_context);
|
fb = get_target_framebuffer (node, paint_context);
|
||||||
|
|
||||||
@ -798,7 +817,8 @@ clutter_text_node_draw (ClutterPaintNode *node,
|
|||||||
op->op.texrect[0],
|
op->op.texrect[0],
|
||||||
op->op.texrect[1],
|
op->op.texrect[1],
|
||||||
&tnode->color,
|
&tnode->color,
|
||||||
color_snippet);
|
setup_pango_pipeline,
|
||||||
|
&pango_pipeline_data);
|
||||||
|
|
||||||
if (clipped)
|
if (clipped)
|
||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
@ -1228,17 +1248,14 @@ clutter_layer_node_post_draw (ClutterPaintNode *node,
|
|||||||
{
|
{
|
||||||
ClutterColorState *color_state;
|
ClutterColorState *color_state;
|
||||||
ClutterColorState *target_color_state;
|
ClutterColorState *target_color_state;
|
||||||
g_autoptr (CoglSnippet) color_snippet = NULL;
|
|
||||||
|
|
||||||
color_state =
|
color_state =
|
||||||
clutter_paint_context_get_color_state (paint_context);
|
clutter_paint_context_get_color_state (paint_context);
|
||||||
target_color_state =
|
target_color_state =
|
||||||
clutter_paint_context_get_target_color_state (paint_context);
|
clutter_paint_context_get_target_color_state (paint_context);
|
||||||
color_snippet =
|
clutter_color_state_add_pipeline_transform (color_state,
|
||||||
clutter_color_state_get_transform_snippet (color_state,
|
target_color_state,
|
||||||
target_color_state);
|
pipeline);
|
||||||
if (color_snippet)
|
|
||||||
cogl_pipeline_add_snippet (pipeline, color_snippet);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < node->operations->len; i++)
|
for (i = 0; i < node->operations->len; i++)
|
||||||
|
@ -190,7 +190,6 @@ clutter_stage_view_ensure_offscreen_blit_pipeline (ClutterStageView *view)
|
|||||||
clutter_stage_view_get_instance_private (view);
|
clutter_stage_view_get_instance_private (view);
|
||||||
ClutterStageViewClass *view_class =
|
ClutterStageViewClass *view_class =
|
||||||
CLUTTER_STAGE_VIEW_GET_CLASS (view);
|
CLUTTER_STAGE_VIEW_GET_CLASS (view);
|
||||||
g_autoptr (CoglSnippet) snippet = NULL;
|
|
||||||
|
|
||||||
g_assert (priv->offscreen != NULL);
|
g_assert (priv->offscreen != NULL);
|
||||||
|
|
||||||
@ -203,10 +202,9 @@ clutter_stage_view_ensure_offscreen_blit_pipeline (ClutterStageView *view)
|
|||||||
if (view_class->setup_offscreen_transform)
|
if (view_class->setup_offscreen_transform)
|
||||||
view_class->setup_offscreen_transform (view, priv->offscreen_pipeline);
|
view_class->setup_offscreen_transform (view, priv->offscreen_pipeline);
|
||||||
|
|
||||||
snippet = clutter_color_state_get_transform_snippet (priv->color_state,
|
clutter_color_state_add_pipeline_transform (priv->color_state,
|
||||||
priv->output_color_state);
|
priv->output_color_state,
|
||||||
if (snippet)
|
priv->offscreen_pipeline);
|
||||||
cogl_pipeline_add_snippet (priv->offscreen_pipeline, snippet);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1906,6 +1906,27 @@ clutter_text_foreach_selection_rectangle_prescaled (ClutterText *se
|
|||||||
clutter_text_foreach_selection_rectangle (self, 1.0f, func, paint_context, user_data);
|
clutter_text_foreach_selection_rectangle (self, 1.0f, func, paint_context, user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ClutterColorState *color_state;
|
||||||
|
ClutterColorState *target_color_state;
|
||||||
|
} PangoPipelineData;
|
||||||
|
|
||||||
|
static void
|
||||||
|
setup_pango_pipeline (CoglPipeline *pipeline,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
PangoPipelineData *pango_pipeline_data = user_data;
|
||||||
|
ClutterColorState *color_state =
|
||||||
|
pango_pipeline_data->color_state;
|
||||||
|
ClutterColorState *target_color_state =
|
||||||
|
pango_pipeline_data->target_color_state;
|
||||||
|
|
||||||
|
clutter_color_state_add_pipeline_transform (color_state,
|
||||||
|
target_color_state,
|
||||||
|
pipeline);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
paint_selection_rectangle (ClutterText *self,
|
paint_selection_rectangle (ClutterText *self,
|
||||||
const ClutterActorBox *box,
|
const ClutterActorBox *box,
|
||||||
@ -1924,7 +1945,7 @@ paint_selection_rectangle (ClutterText *self,
|
|||||||
clutter_paint_context_get_target_color_state (paint_context);
|
clutter_paint_context_get_target_color_state (paint_context);
|
||||||
CoglColor cogl_color = { 0, };
|
CoglColor cogl_color = { 0, };
|
||||||
const CoglColor *color;
|
const CoglColor *color;
|
||||||
g_autoptr (CoglSnippet) color_snippet = NULL;
|
PangoPipelineData pango_pipeline_data = {};
|
||||||
|
|
||||||
/* Paint selection background */
|
/* Paint selection background */
|
||||||
if (priv->selection_color_set)
|
if (priv->selection_color_set)
|
||||||
@ -1942,11 +1963,13 @@ paint_selection_rectangle (ClutterText *self,
|
|||||||
cogl_color_premultiply (&cogl_color);
|
cogl_color_premultiply (&cogl_color);
|
||||||
cogl_pipeline_set_color (color_pipeline, &cogl_color);
|
cogl_pipeline_set_color (color_pipeline, &cogl_color);
|
||||||
|
|
||||||
color_snippet =
|
pango_pipeline_data = (PangoPipelineData) {
|
||||||
clutter_color_state_get_transform_snippet (color_state,
|
.color_state = color_state,
|
||||||
target_color_state);
|
.target_color_state = target_color_state,
|
||||||
if (color_snippet)
|
};
|
||||||
cogl_pipeline_add_snippet (color_pipeline, color_snippet);
|
clutter_color_state_add_pipeline_transform (color_state,
|
||||||
|
target_color_state,
|
||||||
|
color_pipeline);
|
||||||
|
|
||||||
cogl_framebuffer_push_rectangle_clip (fb,
|
cogl_framebuffer_push_rectangle_clip (fb,
|
||||||
box->x1, box->y1,
|
box->x1, box->y1,
|
||||||
@ -1967,7 +1990,8 @@ paint_selection_rectangle (ClutterText *self,
|
|||||||
paint_opacity / 255.0f * color->alpha / 255.0f);
|
paint_opacity / 255.0f * color->alpha / 255.0f);
|
||||||
|
|
||||||
cogl_pango_show_layout (fb, layout, priv->text_x, 0, &cogl_color,
|
cogl_pango_show_layout (fb, layout, priv->text_x, 0, &cogl_color,
|
||||||
color_snippet);
|
setup_pango_pipeline,
|
||||||
|
&pango_pipeline_data);
|
||||||
|
|
||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
g_object_unref (color_pipeline);
|
g_object_unref (color_pipeline);
|
||||||
@ -1995,7 +2019,6 @@ selection_paint (ClutterText *self,
|
|||||||
clutter_paint_context_get_target_color_state (paint_context);
|
clutter_paint_context_get_target_color_state (paint_context);
|
||||||
CoglPipeline *color_pipeline = create_color_pipeline ();
|
CoglPipeline *color_pipeline = create_color_pipeline ();
|
||||||
CoglColor cogl_color;
|
CoglColor cogl_color;
|
||||||
g_autoptr (CoglSnippet) color_snippet = NULL;
|
|
||||||
|
|
||||||
/* No selection, just draw the cursor */
|
/* No selection, just draw the cursor */
|
||||||
if (priv->cursor_color_set)
|
if (priv->cursor_color_set)
|
||||||
@ -2012,11 +2035,9 @@ selection_paint (ClutterText *self,
|
|||||||
cogl_color_premultiply (&cogl_color);
|
cogl_color_premultiply (&cogl_color);
|
||||||
cogl_pipeline_set_color (color_pipeline, &cogl_color);
|
cogl_pipeline_set_color (color_pipeline, &cogl_color);
|
||||||
|
|
||||||
color_snippet =
|
clutter_color_state_add_pipeline_transform (color_state,
|
||||||
clutter_color_state_get_transform_snippet (color_state,
|
target_color_state,
|
||||||
target_color_state);
|
color_pipeline);
|
||||||
if (color_snippet)
|
|
||||||
cogl_pipeline_add_snippet (color_pipeline, color_snippet);
|
|
||||||
|
|
||||||
cogl_framebuffer_draw_rectangle (fb,
|
cogl_framebuffer_draw_rectangle (fb,
|
||||||
color_pipeline,
|
color_pipeline,
|
||||||
@ -2641,6 +2662,7 @@ clutter_text_paint (ClutterActor *self,
|
|||||||
float alloc_width;
|
float alloc_width;
|
||||||
float alloc_height;
|
float alloc_height;
|
||||||
float resource_scale;
|
float resource_scale;
|
||||||
|
PangoPipelineData pango_pipeline_data = {};
|
||||||
|
|
||||||
fb = clutter_paint_context_get_framebuffer (paint_context);
|
fb = clutter_paint_context_get_framebuffer (paint_context);
|
||||||
|
|
||||||
@ -2793,12 +2815,13 @@ clutter_text_paint (ClutterActor *self,
|
|||||||
priv->text_color.blue / 255.0f,
|
priv->text_color.blue / 255.0f,
|
||||||
real_opacity / 255.0f);
|
real_opacity / 255.0f);
|
||||||
|
|
||||||
color_snippet =
|
pango_pipeline_data = (PangoPipelineData) {
|
||||||
clutter_color_state_get_transform_snippet (color_state,
|
.color_state = color_state,
|
||||||
target_color_state);
|
.target_color_state = target_color_state,
|
||||||
|
};
|
||||||
cogl_pango_show_layout (fb, layout, priv->text_x, priv->text_y, &color,
|
cogl_pango_show_layout (fb, layout, priv->text_x, priv->text_y, &color,
|
||||||
color_snippet);
|
setup_pango_pipeline,
|
||||||
|
&pango_pipeline_data);
|
||||||
|
|
||||||
selection_paint (text, fb, paint_context);
|
selection_paint (text, fb, paint_context);
|
||||||
|
|
||||||
|
@ -393,7 +393,8 @@ _cogl_framebuffer_draw_display_list_texture (CoglFramebuffer *fb,
|
|||||||
void
|
void
|
||||||
cogl_pango_display_list_render (CoglFramebuffer *fb,
|
cogl_pango_display_list_render (CoglFramebuffer *fb,
|
||||||
CoglPangoDisplayList *dl,
|
CoglPangoDisplayList *dl,
|
||||||
CoglSnippet *extra_snippet,
|
CoglPangoPipelineSetup pipeline_setup,
|
||||||
|
gpointer pipeline_setup_user_data,
|
||||||
const CoglColor *color)
|
const CoglColor *color)
|
||||||
{
|
{
|
||||||
GSList *l;
|
GSList *l;
|
||||||
@ -433,8 +434,7 @@ cogl_pango_display_list_render (CoglFramebuffer *fb,
|
|||||||
|
|
||||||
cogl_pipeline_set_color (pipeline, &draw_color);
|
cogl_pipeline_set_color (pipeline, &draw_color);
|
||||||
|
|
||||||
if (extra_snippet)
|
pipeline_setup (pipeline, pipeline_setup_user_data);
|
||||||
cogl_pipeline_add_snippet (pipeline, extra_snippet);
|
|
||||||
|
|
||||||
switch (node->type)
|
switch (node->type)
|
||||||
{
|
{
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
#include "cogl-pango/cogl-pango-pipeline-cache.h"
|
#include "cogl-pango/cogl-pango-pipeline-cache.h"
|
||||||
|
|
||||||
|
#include "cogl-pango/cogl-pango.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef struct _CoglPangoDisplayList CoglPangoDisplayList;
|
typedef struct _CoglPangoDisplayList CoglPangoDisplayList;
|
||||||
@ -71,7 +73,8 @@ _cogl_pango_display_list_add_trapezoid (CoglPangoDisplayList *dl,
|
|||||||
void
|
void
|
||||||
cogl_pango_display_list_render (CoglFramebuffer *framebuffer,
|
cogl_pango_display_list_render (CoglFramebuffer *framebuffer,
|
||||||
CoglPangoDisplayList *dl,
|
CoglPangoDisplayList *dl,
|
||||||
CoglSnippet *extra_snippet,
|
CoglPangoPipelineSetup pipeline_setup,
|
||||||
|
gpointer pipeline_setup_user_data,
|
||||||
const CoglColor *color);
|
const CoglColor *color);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -362,7 +362,8 @@ cogl_pango_show_layout (CoglFramebuffer *fb,
|
|||||||
float x,
|
float x,
|
||||||
float y,
|
float y,
|
||||||
const CoglColor *color,
|
const CoglColor *color,
|
||||||
CoglSnippet *extra_snippet)
|
CoglPangoPipelineSetup pipeline_setup,
|
||||||
|
gpointer pipeline_setup_userdata)
|
||||||
{
|
{
|
||||||
PangoContext *context;
|
PangoContext *context;
|
||||||
CoglPangoRenderer *priv;
|
CoglPangoRenderer *priv;
|
||||||
@ -426,7 +427,7 @@ cogl_pango_show_layout (CoglFramebuffer *fb,
|
|||||||
|
|
||||||
cogl_pango_display_list_render (fb,
|
cogl_pango_display_list_render (fb,
|
||||||
qdata->display_list,
|
qdata->display_list,
|
||||||
extra_snippet,
|
pipeline_setup, pipeline_setup_userdata,
|
||||||
color);
|
color);
|
||||||
|
|
||||||
cogl_framebuffer_pop_matrix (fb);
|
cogl_framebuffer_pop_matrix (fb);
|
||||||
@ -451,7 +452,8 @@ cogl_pango_show_layout_line (CoglFramebuffer *fb,
|
|||||||
float x,
|
float x,
|
||||||
float y,
|
float y,
|
||||||
const CoglColor *color,
|
const CoglColor *color,
|
||||||
CoglSnippet *extra_snippet)
|
CoglPangoPipelineSetup pipeline_setup,
|
||||||
|
gpointer pipeline_setup_userdata)
|
||||||
{
|
{
|
||||||
PangoContext *context;
|
PangoContext *context;
|
||||||
CoglPangoRenderer *priv;
|
CoglPangoRenderer *priv;
|
||||||
@ -477,7 +479,8 @@ cogl_pango_show_layout_line (CoglFramebuffer *fb,
|
|||||||
|
|
||||||
cogl_pango_display_list_render (fb,
|
cogl_pango_display_list_render (fb,
|
||||||
priv->display_list,
|
priv->display_list,
|
||||||
extra_snippet,
|
pipeline_setup,
|
||||||
|
pipeline_setup_userdata,
|
||||||
color);
|
color);
|
||||||
|
|
||||||
_cogl_pango_display_list_free (priv->display_list);
|
_cogl_pango_display_list_free (priv->display_list);
|
||||||
|
@ -65,6 +65,9 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
typedef PangoCairoFontMap CoglPangoFontMap;
|
typedef PangoCairoFontMap CoglPangoFontMap;
|
||||||
|
|
||||||
|
typedef void (* CoglPangoPipelineSetup) (CoglPipeline *pipeline,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_pango_font_map_new:
|
* cogl_pango_font_map_new:
|
||||||
*
|
*
|
||||||
@ -156,7 +159,8 @@ cogl_pango_show_layout (CoglFramebuffer *framebuffer,
|
|||||||
float x,
|
float x,
|
||||||
float y,
|
float y,
|
||||||
const CoglColor *color,
|
const CoglColor *color,
|
||||||
CoglSnippet *extra_snippet);
|
CoglPangoPipelineSetup pipeline_setup,
|
||||||
|
gpointer pipeline_setup_userdata);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_pango_show_layout_line: (skip)
|
* cogl_pango_show_layout_line: (skip)
|
||||||
@ -175,7 +179,8 @@ cogl_pango_show_layout_line (CoglFramebuffer *framebuffer,
|
|||||||
float x,
|
float x,
|
||||||
float y,
|
float y,
|
||||||
const CoglColor *color,
|
const CoglColor *color,
|
||||||
CoglSnippet *extra_snippet);
|
CoglPangoPipelineSetup pipeline_setup,
|
||||||
|
gpointer pipeline_setup_userdata);
|
||||||
|
|
||||||
|
|
||||||
#define COGL_PANGO_TYPE_RENDERER (cogl_pango_renderer_get_type ())
|
#define COGL_PANGO_TYPE_RENDERER (cogl_pango_renderer_get_type ())
|
||||||
|
@ -786,7 +786,6 @@ scale_and_transform_cursor_sprite_cpu (MetaCursorRendererNative *cursor_renderer
|
|||||||
graphene_matrix_t matrix;
|
graphene_matrix_t matrix;
|
||||||
MetaMonitorTransform pipeline_transform;
|
MetaMonitorTransform pipeline_transform;
|
||||||
ClutterColorState *color_state;
|
ClutterColorState *color_state;
|
||||||
g_autoptr (CoglSnippet) color_snippet = NULL;
|
|
||||||
int dst_width;
|
int dst_width;
|
||||||
int dst_height;
|
int dst_height;
|
||||||
|
|
||||||
@ -819,11 +818,9 @@ scale_and_transform_cursor_sprite_cpu (MetaCursorRendererNative *cursor_renderer
|
|||||||
cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix);
|
cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix);
|
||||||
|
|
||||||
color_state = meta_cursor_sprite_get_color_state (cursor_sprite);
|
color_state = meta_cursor_sprite_get_color_state (cursor_sprite);
|
||||||
color_snippet =
|
clutter_color_state_add_pipeline_transform (color_state,
|
||||||
clutter_color_state_get_transform_snippet (color_state,
|
target_color_state,
|
||||||
target_color_state);
|
pipeline);
|
||||||
if (color_snippet)
|
|
||||||
cogl_pipeline_add_snippet (pipeline, color_snippet);
|
|
||||||
|
|
||||||
cogl_framebuffer_clear4f (COGL_FRAMEBUFFER (offscreen),
|
cogl_framebuffer_clear4f (COGL_FRAMEBUFFER (offscreen),
|
||||||
COGL_BUFFER_BIT_COLOR,
|
COGL_BUFFER_BIT_COLOR,
|
||||||
|
@ -467,12 +467,10 @@ attach_and_save_color_snippet (MetaShapedTexture *stex,
|
|||||||
{
|
{
|
||||||
ClutterPipelineCache *pipeline_cache =
|
ClutterPipelineCache *pipeline_cache =
|
||||||
clutter_context_get_pipeline_cache (stex->clutter_context);
|
clutter_context_get_pipeline_cache (stex->clutter_context);
|
||||||
g_autoptr (CoglSnippet) color_snippet = NULL;
|
|
||||||
|
|
||||||
color_snippet =
|
clutter_color_state_add_pipeline_transform (color_state,
|
||||||
clutter_color_state_get_transform_snippet (color_state, target_color_state);
|
target_color_state,
|
||||||
if (color_snippet)
|
pipeline);
|
||||||
cogl_pipeline_add_snippet (pipeline, color_snippet);
|
|
||||||
|
|
||||||
clutter_pipeline_cache_set_pipeline (pipeline_cache,
|
clutter_pipeline_cache_set_pipeline (pipeline_cache,
|
||||||
stex,
|
stex,
|
||||||
|
@ -5,14 +5,6 @@
|
|||||||
|
|
||||||
#include "tests/clutter-test-utils.h"
|
#include "tests/clutter-test-utils.h"
|
||||||
|
|
||||||
static void
|
|
||||||
take_snippet (CoglPipeline *pipeline,
|
|
||||||
CoglSnippet *snippet)
|
|
||||||
{
|
|
||||||
cogl_pipeline_add_snippet (pipeline, snippet);
|
|
||||||
g_object_unref (snippet);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pipeline_cache_group_pipelines (void)
|
pipeline_cache_group_pipelines (void)
|
||||||
{
|
{
|
||||||
@ -53,18 +45,18 @@ pipeline_cache_group_pipelines (void)
|
|||||||
bt2020_pq_to_bt2020_linear = cogl_pipeline_new (cogl_context);
|
bt2020_pq_to_bt2020_linear = cogl_pipeline_new (cogl_context);
|
||||||
srgb_linear_to_srgb_srgb = cogl_pipeline_new (cogl_context);
|
srgb_linear_to_srgb_srgb = cogl_pipeline_new (cogl_context);
|
||||||
|
|
||||||
take_snippet (srgb_srgb_to_bt2020_linear,
|
clutter_color_state_add_pipeline_transform (srgb_srgb,
|
||||||
clutter_color_state_get_transform_snippet (srgb_srgb,
|
bt2020_linear,
|
||||||
bt2020_linear));
|
srgb_srgb_to_bt2020_linear);
|
||||||
take_snippet (bt2020_linear_to_bt2020_pq,
|
clutter_color_state_add_pipeline_transform (bt2020_linear,
|
||||||
clutter_color_state_get_transform_snippet (bt2020_linear,
|
bt2020_pq,
|
||||||
bt2020_pq));
|
bt2020_linear_to_bt2020_pq);
|
||||||
take_snippet (bt2020_pq_to_bt2020_linear,
|
clutter_color_state_add_pipeline_transform (bt2020_pq,
|
||||||
clutter_color_state_get_transform_snippet (bt2020_pq,
|
bt2020_linear,
|
||||||
bt2020_linear));
|
bt2020_pq_to_bt2020_linear);
|
||||||
take_snippet (srgb_linear_to_srgb_srgb,
|
clutter_color_state_add_pipeline_transform (srgb_linear,
|
||||||
clutter_color_state_get_transform_snippet (srgb_linear,
|
srgb_srgb,
|
||||||
srgb_srgb));
|
srgb_linear_to_srgb_srgb);
|
||||||
|
|
||||||
/* Check that it's all empty. */
|
/* Check that it's all empty. */
|
||||||
g_assert_null (clutter_pipeline_cache_get_pipeline (pipeline_cache, group1, 0,
|
g_assert_null (clutter_pipeline_cache_get_pipeline (pipeline_cache, group1, 0,
|
||||||
@ -138,9 +130,9 @@ pipeline_cache_replace_pipeline (void)
|
|||||||
g_object_add_weak_pointer (G_OBJECT (srgb_srgb_to_bt2020_linear),
|
g_object_add_weak_pointer (G_OBJECT (srgb_srgb_to_bt2020_linear),
|
||||||
(gpointer *) &srgb_srgb_to_bt2020_linear);
|
(gpointer *) &srgb_srgb_to_bt2020_linear);
|
||||||
|
|
||||||
take_snippet (srgb_srgb_to_bt2020_linear,
|
clutter_color_state_add_pipeline_transform (srgb_srgb,
|
||||||
clutter_color_state_get_transform_snippet (srgb_srgb,
|
bt2020_linear,
|
||||||
bt2020_linear));
|
srgb_srgb_to_bt2020_linear);
|
||||||
|
|
||||||
clutter_pipeline_cache_set_pipeline (pipeline_cache, group, 0,
|
clutter_pipeline_cache_set_pipeline (pipeline_cache, group, 0,
|
||||||
srgb_srgb, bt2020_linear,
|
srgb_srgb, bt2020_linear,
|
||||||
@ -149,9 +141,9 @@ pipeline_cache_replace_pipeline (void)
|
|||||||
g_object_unref (srgb_srgb_to_bt2020_linear);
|
g_object_unref (srgb_srgb_to_bt2020_linear);
|
||||||
g_assert_nonnull (srgb_srgb_to_bt2020_linear);
|
g_assert_nonnull (srgb_srgb_to_bt2020_linear);
|
||||||
|
|
||||||
take_snippet (srgb_srgb_to_bt2020_linear_copy,
|
clutter_color_state_add_pipeline_transform (srgb_srgb,
|
||||||
clutter_color_state_get_transform_snippet (srgb_srgb,
|
bt2020_linear,
|
||||||
bt2020_linear));
|
srgb_srgb_to_bt2020_linear_copy);
|
||||||
clutter_pipeline_cache_set_pipeline (pipeline_cache, group, 0,
|
clutter_pipeline_cache_set_pipeline (pipeline_cache, group, 0,
|
||||||
srgb_srgb, bt2020_linear,
|
srgb_srgb, bt2020_linear,
|
||||||
srgb_srgb_to_bt2020_linear_copy);
|
srgb_srgb_to_bt2020_linear_copy);
|
||||||
|
Reference in New Issue
Block a user