st-private: Receive a CoglFramebuffer

Same case of the previous patch; _st_paint_shadow_with_opacity()
uses cogl_get_draw_framebuffer(), and this patch makes it receive
a CoglFramebuffer as a parameter instead.

The cautious reader might notice that this commit apparently goes
against the long-term goal, for it introduces more instances of
cogl_get_draw_framebuffer(). This is not wrong, but these introduced
ones will be removed later on, when ClutterActor.paint() receives
a CoglFramebuffer as a parameter instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/283
This commit is contained in:
Georges Basile Stavracas Neto 2018-10-05 22:38:11 -03:00
parent a2f27a9409
commit 09addfc87c
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385
7 changed files with 10 additions and 2 deletions

View File

@ -869,6 +869,7 @@ st_entry_paint (ClutterActor *actor)
if (priv->text_shadow_material != NULL) if (priv->text_shadow_material != NULL)
_st_paint_shadow_with_opacity (shadow_spec, _st_paint_shadow_with_opacity (shadow_spec,
cogl_get_draw_framebuffer (),
priv->text_shadow_material, priv->text_shadow_material,
&allocation, &allocation,
clutter_actor_get_paint_opacity (priv->entry)); clutter_actor_get_paint_opacity (priv->entry));

View File

@ -176,6 +176,7 @@ st_icon_paint (ClutterActor *actor)
clutter_actor_get_allocation_box (priv->icon_texture, &allocation); clutter_actor_get_allocation_box (priv->icon_texture, &allocation);
_st_paint_shadow_with_opacity (priv->shadow_spec, _st_paint_shadow_with_opacity (priv->shadow_spec,
cogl_get_draw_framebuffer (),
priv->shadow_pipeline, priv->shadow_pipeline,
&allocation, &allocation,
clutter_actor_get_paint_opacity (priv->icon_texture)); clutter_actor_get_paint_opacity (priv->icon_texture));

View File

@ -216,6 +216,7 @@ st_label_paint (ClutterActor *actor)
if (priv->text_shadow_pipeline != NULL) if (priv->text_shadow_pipeline != NULL)
_st_paint_shadow_with_opacity (shadow_spec, _st_paint_shadow_with_opacity (shadow_spec,
cogl_get_draw_framebuffer (),
priv->text_shadow_pipeline, priv->text_shadow_pipeline,
&allocation, &allocation,
clutter_actor_get_paint_opacity (priv->label)); clutter_actor_get_paint_opacity (priv->label));

View File

@ -658,11 +658,11 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
void void
_st_paint_shadow_with_opacity (StShadow *shadow_spec, _st_paint_shadow_with_opacity (StShadow *shadow_spec,
CoglFramebuffer *framebuffer,
CoglPipeline *shadow_pipeline, CoglPipeline *shadow_pipeline,
ClutterActorBox *box, ClutterActorBox *box,
guint8 paint_opacity) guint8 paint_opacity)
{ {
CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
ClutterActorBox shadow_box; ClutterActorBox shadow_box;
CoglColor color; CoglColor color;
@ -678,7 +678,8 @@ _st_paint_shadow_with_opacity (StShadow *shadow_spec,
shadow_spec->color.alpha * paint_opacity / 255); shadow_spec->color.alpha * paint_opacity / 255);
cogl_color_premultiply (&color); cogl_color_premultiply (&color);
cogl_pipeline_set_layer_combine_constant (shadow_pipeline, 0, &color); cogl_pipeline_set_layer_combine_constant (shadow_pipeline, 0, &color);
cogl_framebuffer_draw_rectangle (fb, shadow_pipeline, cogl_framebuffer_draw_rectangle (framebuffer,
shadow_pipeline,
shadow_box.x1, shadow_box.y1, shadow_box.x1, shadow_box.y1,
shadow_box.x2, shadow_box.y2); shadow_box.x2, shadow_box.y2);
} }

View File

@ -70,6 +70,7 @@ cairo_pattern_t *_st_create_shadow_cairo_pattern (StShadow *shadow_spec,
cairo_pattern_t *src_pattern); cairo_pattern_t *src_pattern);
void _st_paint_shadow_with_opacity (StShadow *shadow_spec, void _st_paint_shadow_with_opacity (StShadow *shadow_spec,
CoglFramebuffer *framebuffer,
CoglPipeline *shadow_pipeline, CoglPipeline *shadow_pipeline,
ClutterActorBox *box, ClutterActorBox *box,
guint8 paint_opacity); guint8 paint_opacity);

View File

@ -288,6 +288,7 @@ st_shadow_helper_paint (StShadowHelper *helper,
guint8 paint_opacity) guint8 paint_opacity)
{ {
_st_paint_shadow_with_opacity (helper->shadow, _st_paint_shadow_with_opacity (helper->shadow,
cogl_get_draw_framebuffer (),
helper->pipeline, helper->pipeline,
actor_box, actor_box,
paint_opacity); paint_opacity);

View File

@ -2564,6 +2564,7 @@ st_theme_node_paint (StThemeNode *node,
if (state->alloc_width < node->box_shadow_min_width || if (state->alloc_width < node->box_shadow_min_width ||
state->alloc_height < node->box_shadow_min_height) state->alloc_height < node->box_shadow_min_height)
_st_paint_shadow_with_opacity (node->box_shadow, _st_paint_shadow_with_opacity (node->box_shadow,
framebuffer,
state->box_shadow_pipeline, state->box_shadow_pipeline,
&allocation, &allocation,
paint_opacity); paint_opacity);
@ -2637,6 +2638,7 @@ st_theme_node_paint (StThemeNode *node,
*/ */
if (node->background_shadow_pipeline != NULL) if (node->background_shadow_pipeline != NULL)
_st_paint_shadow_with_opacity (node->background_image_shadow, _st_paint_shadow_with_opacity (node->background_image_shadow,
framebuffer,
node->background_shadow_pipeline, node->background_shadow_pipeline,
&background_box, &background_box,
paint_opacity); paint_opacity);