[mutter/gbsneto/graphene-matrix: 3/20] clutter/offscreen-effect: Use graphene APIs
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/graphene-matrix: 3/20] clutter/offscreen-effect: Use graphene APIs
- Date: Tue, 15 Sep 2020 19:00:01 +0000 (UTC)
commit 3705348a17ff4b015e034cdc34bdeb92d65b4a11
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Sep 11 16:34:59 2020 -0300
clutter/offscreen-effect: Use graphene APIs
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
clutter/clutter/clutter-offscreen-effect.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
index e4a9a45e5a..08b419878f 100644
--- a/clutter/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter/clutter-offscreen-effect.c
@@ -428,6 +428,7 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect,
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
graphene_matrix_t modelview;
+ graphene_matrix_t translate;
float resource_scale;
cogl_framebuffer_push_matrix (framebuffer);
@@ -441,14 +442,19 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect,
if (resource_scale != 1.0f)
{
+ graphene_matrix_t scale;
float paint_scale = 1.0f / resource_scale;
- cogl_matrix_scale (&modelview, paint_scale, paint_scale, 1);
+
+ graphene_matrix_init_scale (&scale, paint_scale, paint_scale, 1.f);
+ graphene_matrix_multiply (&scale, &modelview, &modelview);
}
- cogl_matrix_translate (&modelview,
- priv->fbo_offset_x,
- priv->fbo_offset_y,
- 0.0f);
+ graphene_matrix_init_translate (&translate,
+ &GRAPHENE_POINT3D_INIT (priv->fbo_offset_x,
+ priv->fbo_offset_y,
+ 0.0f));
+ graphene_matrix_multiply (&translate, &modelview, &modelview);
+
cogl_framebuffer_set_modelview_matrix (framebuffer, &modelview);
/* paint the target material; this is virtualized for
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]