mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
st/private: Add _st_snapshot_shadow_with_opacity
It's unused for now, but next commits will use it.
This commit is contained in:
parent
0cdddaa4a7
commit
6ba166660f
2 changed files with 34 additions and 0 deletions
|
|
@ -799,3 +799,31 @@ _st_paint_shadow_with_opacity (StShadow *shadow_spec,
|
|||
shadow_box.x1, shadow_box.y1,
|
||||
shadow_box.x2, shadow_box.y2);
|
||||
}
|
||||
|
||||
void
|
||||
_st_snapshot_shadow_with_opacity (StShadow *shadow_spec,
|
||||
ClutterSnapshot *snapshot,
|
||||
CoglPipeline *shadow_pipeline,
|
||||
ClutterActorBox *box,
|
||||
guint8 paint_opacity)
|
||||
{
|
||||
ClutterActorBox shadow_box;
|
||||
CoglColor color;
|
||||
|
||||
g_return_if_fail (shadow_spec != NULL);
|
||||
g_return_if_fail (shadow_pipeline != NULL);
|
||||
|
||||
st_shadow_get_box (shadow_spec, box, &shadow_box);
|
||||
|
||||
cogl_color_init_from_4f (&color,
|
||||
shadow_spec->color.red / 255.0 * paint_opacity / 255.0,
|
||||
shadow_spec->color.green / 255.0 * paint_opacity / 255.0,
|
||||
shadow_spec->color.blue / 255.0 * paint_opacity / 255.0,
|
||||
shadow_spec->color.alpha / 255.0 * paint_opacity / 255.0);
|
||||
cogl_color_premultiply (&color);
|
||||
cogl_pipeline_set_layer_combine_constant (shadow_pipeline, 0, &color);
|
||||
|
||||
clutter_snapshot_push_pipeline (snapshot, shadow_pipeline);
|
||||
clutter_snapshot_add_rectangle (snapshot, &shadow_box);
|
||||
clutter_snapshot_pop (snapshot);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,4 +72,10 @@ void _st_paint_shadow_with_opacity (StShadow *shadow_spec,
|
|||
ClutterActorBox *box,
|
||||
guint8 paint_opacity);
|
||||
|
||||
void _st_snapshot_shadow_with_opacity (StShadow *shadow_spec,
|
||||
ClutterSnapshot *snapshot,
|
||||
CoglPipeline *shadow_pipeline,
|
||||
ClutterActorBox *box,
|
||||
guint8 paint_opacity);
|
||||
|
||||
#endif /* __ST_PRIVATE_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue