diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2019-03-11 20:05:09 -0300 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2019-03-20 15:17:15 +0000 |
commit | c356a2da83f9f6b10edab0b8e5a612fc18e31231 (patch) | |
tree | 5e949b8dbe34406a7ac97a5de4efafe906dcd5dc | |
parent | 52890262572a704f98d601b3b712399fd35b1c70 (diff) | |
download | mutter-c356a2da83f9f6b10edab0b8e5a612fc18e31231.tar.gz |
clutter/offscreen-effect: Remove implicit API
-rw-r--r-- | clutter/clutter/clutter-offscreen-effect.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c index f432e4b8a..c74fc5a45 100644 --- a/clutter/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter/clutter-offscreen-effect.c @@ -325,7 +325,7 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect) * contents on screen... */ clutter_actor_get_transform (priv->stage, &modelview); - cogl_set_modelview_matrix (&modelview); + cogl_framebuffer_set_modelview_matrix (priv->offscreen, &modelview); /* Save the original viewport for calculating priv->position */ _clutter_stage_get_viewport (CLUTTER_STAGE (priv->stage), @@ -337,10 +337,11 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect) /* Set up the viewport so that it has the same size as the stage (avoid * distortion), but translated to account for the FBO offset... */ - cogl_set_viewport (-priv->fbo_offset_x, - -priv->fbo_offset_y, - stage_width, - stage_height); + cogl_framebuffer_set_viewport (priv->offscreen, + -priv->fbo_offset_x, + -priv->fbo_offset_y, + stage_width, + stage_height); /* Copy the stage's projection matrix across to the framebuffer */ _clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage), @@ -357,14 +358,15 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect) &priv->position, 1); - cogl_set_projection_matrix (&projection); + cogl_framebuffer_set_projection_matrix (priv->offscreen, &projection); cogl_color_init_from_4ub (&transparent, 0, 0, 0, 0); - cogl_clear (&transparent, - COGL_BUFFER_BIT_COLOR | - COGL_BUFFER_BIT_DEPTH); + cogl_framebuffer_clear (priv->offscreen, + COGL_BUFFER_BIT_COLOR | + COGL_BUFFER_BIT_DEPTH, + &transparent); - cogl_push_matrix (); + cogl_framebuffer_push_matrix (priv->offscreen); /* Override the actor's opacity to fully opaque - we paint the offscreen * texture with the actor's paint opacity, so we need to do this to avoid @@ -410,15 +412,16 @@ static void clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect) { ClutterOffscreenEffectPrivate *priv = effect->priv; + CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer (); CoglMatrix modelview; float resource_scale; - cogl_push_matrix (); + cogl_framebuffer_push_matrix (framebuffer); /* The current modelview matrix is *almost* perfect already. It's only * missing a correction for the expanded FBO and offset rendering within... */ - cogl_get_modelview_matrix (&modelview); + cogl_framebuffer_get_modelview_matrix (framebuffer, &modelview); if (clutter_actor_get_resource_scale (priv->actor, &resource_scale) && resource_scale != 1.0f) @@ -431,14 +434,15 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect) priv->fbo_offset_x, priv->fbo_offset_y, 0.0f); - cogl_set_modelview_matrix (&modelview); + + cogl_framebuffer_set_modelview_matrix (framebuffer, &modelview); /* paint the target material; this is virtualized for * sub-classes that require special hand-holding */ clutter_offscreen_effect_paint_target (effect); - cogl_pop_matrix (); + cogl_framebuffer_pop_matrix (framebuffer); } static void @@ -455,7 +459,7 @@ clutter_offscreen_effect_post_paint (ClutterEffect *effect) /* Restore the previous opacity override */ clutter_actor_set_opacity_override (priv->actor, priv->old_opacity_override); - cogl_pop_matrix (); + cogl_framebuffer_pop_matrix (priv->offscreen); cogl_pop_framebuffer (); clutter_offscreen_effect_paint_texture (self); |