[mutter/gbsneto/explicit-framebuffer-preparations: 2/10] shadow-factory: Receive CoglFramebuffer
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/explicit-framebuffer-preparations: 2/10] shadow-factory: Receive CoglFramebuffer
- Date: Thu, 8 Nov 2018 23:33:06 +0000 (UTC)
commit d877e3fb606a73cbf35ba316a1c9e781e9d863c1
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Nov 8 19:32:13 2018 -0200
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.
src/compositor/meta-shadow-factory.c | 18 +++++++++---------
src/compositor/meta-window-actor.c | 2 ++
src/meta/meta-shadow-factory.h | 2 ++
3 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/compositor/meta-shadow-factory.c b/src/compositor/meta-shadow-factory.c
index 40f69faf6..ab358dd6d 100644
--- a/src/compositor/meta-shadow-factory.c
+++ b/src/compositor/meta-shadow-factory.c
@@ -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;
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 219226b19..4456e1892 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -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,
diff --git a/src/meta/meta-shadow-factory.h b/src/meta/meta-shadow-factory.h
index 0b380ee02..4aa1fc386 100644
--- a/src/meta/meta-shadow-factory.h
+++ b/src/meta/meta-shadow-factory.h
@@ -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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]