st-box-layout: Fix Cogl deprecations
This commit is contained in:
parent
4de20272e5
commit
8dab692f93
@ -387,19 +387,20 @@ st_box_layout_paint (ClutterActor *actor)
|
|||||||
ClutterActorBox allocation_box;
|
ClutterActorBox allocation_box;
|
||||||
ClutterActorBox content_box;
|
ClutterActorBox content_box;
|
||||||
ClutterActor *child;
|
ClutterActor *child;
|
||||||
|
CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
get_border_paint_offsets (self, &x, &y);
|
get_border_paint_offsets (self, &x, &y);
|
||||||
if (x != 0 || y != 0)
|
if (x != 0 || y != 0)
|
||||||
{
|
{
|
||||||
cogl_push_matrix ();
|
cogl_framebuffer_push_matrix (fb);
|
||||||
cogl_translate ((int)x, (int)y, 0);
|
cogl_framebuffer_translate (fb, (int)x, (int)y, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
st_widget_paint_background (ST_WIDGET (actor));
|
st_widget_paint_background (ST_WIDGET (actor));
|
||||||
|
|
||||||
if (x != 0 || y != 0)
|
if (x != 0 || y != 0)
|
||||||
{
|
{
|
||||||
cogl_pop_matrix ();
|
cogl_framebuffer_pop_matrix (fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clutter_actor_get_n_children (actor) == 0)
|
if (clutter_actor_get_n_children (actor) == 0)
|
||||||
@ -417,10 +418,11 @@ st_box_layout_paint (ClutterActor *actor)
|
|||||||
* the borders and background stay in place; after drawing the borders and
|
* the borders and background stay in place; after drawing the borders and
|
||||||
* background, we clip to the content area */
|
* background, we clip to the content area */
|
||||||
if (priv->hadjustment || priv->vadjustment)
|
if (priv->hadjustment || priv->vadjustment)
|
||||||
cogl_clip_push_rectangle ((int)content_box.x1,
|
cogl_framebuffer_push_rectangle_clip (fb,
|
||||||
(int)content_box.y1,
|
(int)content_box.x1,
|
||||||
(int)content_box.x2,
|
(int)content_box.y1,
|
||||||
(int)content_box.y2);
|
(int)content_box.x2,
|
||||||
|
(int)content_box.y2);
|
||||||
|
|
||||||
for (child = clutter_actor_get_first_child (actor);
|
for (child = clutter_actor_get_first_child (actor);
|
||||||
child != NULL;
|
child != NULL;
|
||||||
@ -428,7 +430,7 @@ st_box_layout_paint (ClutterActor *actor)
|
|||||||
clutter_actor_paint (child);
|
clutter_actor_paint (child);
|
||||||
|
|
||||||
if (priv->hadjustment || priv->vadjustment)
|
if (priv->hadjustment || priv->vadjustment)
|
||||||
cogl_clip_pop ();
|
cogl_framebuffer_pop_clip (fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -442,19 +444,20 @@ st_box_layout_pick (ClutterActor *actor,
|
|||||||
ClutterActorBox allocation_box;
|
ClutterActorBox allocation_box;
|
||||||
ClutterActorBox content_box;
|
ClutterActorBox content_box;
|
||||||
ClutterActor *child;
|
ClutterActor *child;
|
||||||
|
CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
get_border_paint_offsets (self, &x, &y);
|
get_border_paint_offsets (self, &x, &y);
|
||||||
if (x != 0 || y != 0)
|
if (x != 0 || y != 0)
|
||||||
{
|
{
|
||||||
cogl_push_matrix ();
|
cogl_framebuffer_push_matrix (fb);
|
||||||
cogl_translate ((int)x, (int)y, 0);
|
cogl_framebuffer_translate (fb, (int)x, (int)y, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CLUTTER_ACTOR_CLASS (st_box_layout_parent_class)->pick (actor, color);
|
CLUTTER_ACTOR_CLASS (st_box_layout_parent_class)->pick (actor, color);
|
||||||
|
|
||||||
if (x != 0 || y != 0)
|
if (x != 0 || y != 0)
|
||||||
{
|
{
|
||||||
cogl_pop_matrix ();
|
cogl_framebuffer_pop_matrix (fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clutter_actor_get_n_children (actor) == 0)
|
if (clutter_actor_get_n_children (actor) == 0)
|
||||||
@ -469,10 +472,11 @@ st_box_layout_pick (ClutterActor *actor,
|
|||||||
content_box.y2 += y;
|
content_box.y2 += y;
|
||||||
|
|
||||||
if (priv->hadjustment || priv->vadjustment)
|
if (priv->hadjustment || priv->vadjustment)
|
||||||
cogl_clip_push_rectangle ((int)content_box.x1,
|
cogl_framebuffer_push_rectangle_clip (fb,
|
||||||
(int)content_box.y1,
|
(int)content_box.x1,
|
||||||
(int)content_box.x2,
|
(int)content_box.y1,
|
||||||
(int)content_box.y2);
|
(int)content_box.x2,
|
||||||
|
(int)content_box.y2);
|
||||||
|
|
||||||
for (child = clutter_actor_get_first_child (actor);
|
for (child = clutter_actor_get_first_child (actor);
|
||||||
child != NULL;
|
child != NULL;
|
||||||
@ -480,7 +484,7 @@ st_box_layout_pick (ClutterActor *actor,
|
|||||||
clutter_actor_paint (child);
|
clutter_actor_paint (child);
|
||||||
|
|
||||||
if (priv->hadjustment || priv->vadjustment)
|
if (priv->hadjustment || priv->vadjustment)
|
||||||
cogl_clip_pop ();
|
cogl_framebuffer_pop_clip (fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user