mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
clutter/offscreen-effect: Remove implicit API
This commit is contained in:
parent
5289026257
commit
c356a2da83
@ -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,7 +337,8 @@ 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,
|
||||
cogl_framebuffer_set_viewport (priv->offscreen,
|
||||
-priv->fbo_offset_x,
|
||||
-priv->fbo_offset_y,
|
||||
stage_width,
|
||||
stage_height);
|
||||
@ -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_framebuffer_clear (priv->offscreen,
|
||||
COGL_BUFFER_BIT_COLOR |
|
||||
COGL_BUFFER_BIT_DEPTH);
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user