clutter/stage: Set framebuffer state directly

clutter_set_viewport always operates on the draw fb, but
mutter sometimes has an offscreen fb it uses instead.

This commit uses the non-deprecated, clutter_framebuffer_set_viewport
function, which takes an explicit fb argument.

Closes: https://gitlab.gnome.org/GNOME/mutter/merge_requests/2
This commit is contained in:
Ray Strode 2017-11-08 10:08:22 -05:00 committed by Jonas Ådahl
parent dbd053020a
commit 58bb61e161

View File

@ -1486,7 +1486,8 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
priv->viewport[1] * fb_scale - viewport_offset_y,
priv->viewport[2] * fb_scale,
priv->viewport[3] * fb_scale);
cogl_set_viewport (priv->viewport[0] * fb_scale - viewport_offset_x,
cogl_framebuffer_set_viewport (fb,
priv->viewport[0] * fb_scale - viewport_offset_x,
priv->viewport[1] * fb_scale - viewport_offset_y,
priv->viewport[2] * fb_scale,
priv->viewport[3] * fb_scale);
@ -3617,6 +3618,7 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
ClutterStageView *view)
{
ClutterStagePrivate *priv = stage->priv;
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (view);
if (clutter_stage_view_is_dirty_viewport (view))
{
@ -3637,7 +3639,8 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
viewport_offset_x = view_layout.x * fb_scale;
viewport_offset_y = view_layout.y * fb_scale;
cogl_set_viewport (priv->viewport[0] * fb_scale - viewport_offset_x,
cogl_framebuffer_set_viewport (fb,
priv->viewport[0] * fb_scale - viewport_offset_x,
priv->viewport[1] * fb_scale - viewport_offset_y,
priv->viewport[2] * fb_scale,
priv->viewport[3] * fb_scale);
@ -3679,7 +3682,7 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
if (clutter_stage_view_is_dirty_projection (view))
{
cogl_set_projection_matrix (&priv->projection);
cogl_framebuffer_set_projection_matrix (fb, &priv->projection);
clutter_stage_view_set_dirty_projection (view, FALSE);
}