offscreen-effect: Traslate the modelview with the offsets
Instead of using the stage offsets when painting we can simply traslate the current modelview. This allows sub-classes to fully override the paint_target() virtual function without chaining up.
This commit is contained in:
parent
8d22fea31c
commit
fa381cc361
@ -316,12 +316,12 @@ clutter_offscreen_effect_real_paint_target (ClutterOffscreenEffect *effect)
|
||||
|
||||
/* paint the texture at the same position as the actor would be,
|
||||
* in Stage coordinates, since we set up the modelview matrix to
|
||||
* be exactly as the stage sets it up
|
||||
* be exactly as the stage sets it up, plus the eventual offsets
|
||||
* due to offscreen effects stacking
|
||||
*/
|
||||
cogl_rectangle_with_texture_coords (priv->x_offset,
|
||||
priv->y_offset,
|
||||
priv->x_offset + priv->target_width,
|
||||
priv->y_offset + priv->target_height,
|
||||
cogl_rectangle_with_texture_coords (0, 0,
|
||||
priv->target_width,
|
||||
priv->target_height,
|
||||
0.0, 0.0,
|
||||
1.0, 1.0);
|
||||
}
|
||||
@ -364,6 +364,8 @@ clutter_offscreen_effect_post_paint (ClutterEffect *effect)
|
||||
|
||||
cogl_push_matrix ();
|
||||
|
||||
cogl_translate (priv->x_offset, priv->y_offset, 0.0f);
|
||||
|
||||
/* paint the target material; this is virtualized for
|
||||
* sub-classes that require special hand-holding
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user