shadow-factory: Receive CoglFramebuffer

Following up last commit, this commit adds a CoglFramebuffer
argument to meta_shadow_paint(), and stops using the draw
framebuffer internally.

The only consumer of this API, MetaWindowActor, still passes
the draw framebuffer though.
This commit is contained in:
Georges Basile Stavracas Neto 2018-11-08 19:32:13 -02:00
parent aecf588d8d
commit 605f35dd25
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385
3 changed files with 13 additions and 9 deletions

View File

@ -203,16 +203,16 @@ meta_shadow_unref (MetaShadow *shadow)
* size needs to be passed in here.)
*/
void
meta_shadow_paint (MetaShadow *shadow,
int window_x,
int window_y,
int window_width,
int window_height,
guint8 opacity,
cairo_region_t *clip,
gboolean clip_strictly)
meta_shadow_paint (MetaShadow *shadow,
CoglFramebuffer *framebuffer,
int window_x,
int window_y,
int window_width,
int window_height,
guint8 opacity,
cairo_region_t *clip,
gboolean clip_strictly)
{
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
float texture_width = cogl_texture_get_width (shadow->texture);
float texture_height = cogl_texture_get_height (shadow->texture);
int i, j;

View File

@ -713,6 +713,7 @@ meta_window_actor_paint (ClutterActor *actor)
MetaWindowActorPrivate *priv = self->priv;
gboolean appears_focused = meta_window_appears_focused (priv->window);
MetaShadow *shadow = appears_focused ? priv->focused_shadow : priv->unfocused_shadow;
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
/* This window got damage when obscured; we set up a timer
* to send frame completion events, but since we're drawing
@ -751,6 +752,7 @@ meta_window_actor_paint (ClutterActor *actor)
}
meta_shadow_paint (shadow,
framebuffer,
params.x_offset + shape_bounds.x,
params.y_offset + shape_bounds.y,
shape_bounds.width,

View File

@ -26,6 +26,7 @@
#include <cairo.h>
#include "clutter/clutter.h"
#include "cogl/cogl.h"
#include "meta/meta-window-shape.h"
GType meta_shadow_get_type (void) G_GNUC_CONST;
@ -97,6 +98,7 @@ typedef struct _MetaShadow MetaShadow;
MetaShadow *meta_shadow_ref (MetaShadow *shadow);
void meta_shadow_unref (MetaShadow *shadow);
void meta_shadow_paint (MetaShadow *shadow,
CoglFramebuffer *framebuffer,
int window_x,
int window_y,
int window_width,