Blame SOURCES/0001-clutter-stage-don-t-use-deprecated-api.patch

e3f29c
From e69a6ac0e44e8d5fd72d7bc60f118044b0407e8f Mon Sep 17 00:00:00 2001
e3f29c
From: rpm-build <rpm-build>
e3f29c
Date: Thu, 9 Nov 2017 16:18:02 -0500
e3f29c
Subject: [PATCH] 0001-clutter-stage-don-t-use-deprecated-api.patch
e3f29c
e3f29c
---
e3f29c
 clutter/clutter/clutter-stage.c | 21 ++++++++++++---------
e3f29c
 1 file changed, 12 insertions(+), 9 deletions(-)
e3f29c
e3f29c
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
e3f29c
index 02ab07b..e4f9342 100644
e3f29c
--- a/clutter/clutter/clutter-stage.c
e3f29c
+++ b/clutter/clutter/clutter-stage.c
e3f29c
@@ -1459,64 +1459,65 @@ _clutter_stage_do_pick_on_view (ClutterStage     *stage,
e3f29c
   fb_height = view_layout.height * fb_scale;
e3f29c
   cogl_push_framebuffer (fb);
e3f29c
 
e3f29c
   /* needed for when a context switch happens */
e3f29c
   _clutter_stage_maybe_setup_viewport (stage, view);
e3f29c
 
e3f29c
   /* FIXME: For some reason leaving the cogl clip stack empty causes the
e3f29c
    * picking to not work at all, so setting it the whole framebuffer content
e3f29c
    * for now. */
e3f29c
   cogl_framebuffer_push_scissor_clip (fb, 0, 0,
e3f29c
                                       view_layout.width * fb_scale,
e3f29c
                                       view_layout.height * fb_scale);
e3f29c
 
e3f29c
   _clutter_stage_window_get_dirty_pixel (priv->impl, view, &dirty_x, &dirty_y);
e3f29c
 
e3f29c
   if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS)))
e3f29c
     {
e3f29c
       CLUTTER_NOTE (PICK, "Pushing pick scissor clip x: %d, y: %d, 1x1",
e3f29c
                     (int) dirty_x * fb_scale,
e3f29c
                     (int) dirty_y * fb_scale);
e3f29c
       cogl_framebuffer_push_scissor_clip (fb, dirty_x * fb_scale, dirty_y * fb_scale, 1, 1);
e3f29c
     }
e3f29c
 
e3f29c
   viewport_offset_x = x * fb_scale - dirty_x * fb_scale;
e3f29c
   viewport_offset_y = y * fb_scale - dirty_y * fb_scale;
e3f29c
   CLUTTER_NOTE (PICK, "Setting viewport to %f, %f, %f, %f",
e3f29c
                 priv->viewport[0] * fb_scale - viewport_offset_x,
e3f29c
                 priv->viewport[1] * fb_scale - viewport_offset_y,
e3f29c
                 priv->viewport[2] * fb_scale,
e3f29c
                 priv->viewport[3] * fb_scale);
e3f29c
-  cogl_set_viewport (priv->viewport[0] * fb_scale - viewport_offset_x,
e3f29c
-                     priv->viewport[1] * fb_scale - viewport_offset_y,
e3f29c
-                     priv->viewport[2] * fb_scale,
e3f29c
-                     priv->viewport[3] * fb_scale);
e3f29c
+  cogl_framebuffer_set_viewport (fb,
e3f29c
+                                 priv->viewport[0] * fb_scale - viewport_offset_x,
e3f29c
+                                 priv->viewport[1] * fb_scale - viewport_offset_y,
e3f29c
+                                 priv->viewport[2] * fb_scale,
e3f29c
+                                 priv->viewport[3] * fb_scale);
e3f29c
 
e3f29c
   read_x = dirty_x * fb_scale;
e3f29c
   read_y = dirty_y * fb_scale;
e3f29c
 
e3f29c
   CLUTTER_NOTE (PICK, "Performing pick at %i,%i on view %dx%d+%d+%d s: %d",
e3f29c
                 x, y,
e3f29c
                 view_layout.width, view_layout.height,
e3f29c
                 view_layout.x, view_layout.y, fb_scale);
e3f29c
 
e3f29c
   cogl_color_init_from_4ub (&stage_pick_id, 255, 255, 255, 255);
e3f29c
   cogl_clear (&stage_pick_id, COGL_BUFFER_BIT_COLOR | COGL_BUFFER_BIT_DEPTH);
e3f29c
 
e3f29c
   /* Disable dithering (if any) when doing the painting in pick mode */
e3f29c
   dither_enabled_save = cogl_framebuffer_get_dither_enabled (fb);
e3f29c
   cogl_framebuffer_set_dither_enabled (fb, FALSE);
e3f29c
 
e3f29c
   /* Render the entire scence in pick mode - just single colored silhouette's
e3f29c
    * are drawn offscreen (as we never swap buffers)
e3f29c
   */
e3f29c
   context->pick_mode = mode;
e3f29c
   _clutter_stage_paint_view (stage, view, NULL);
e3f29c
   context->pick_mode = CLUTTER_PICK_NONE;
e3f29c
 
e3f29c
   /* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used
e3f29c
      even though we don't care about the alpha component because under
e3f29c
      GLES this is the only format that is guaranteed to work so Cogl
e3f29c
      will end up having to do a conversion if any other format is
e3f29c
      used. The format is requested as pre-multiplied because Cogl
e3f29c
      assumes that all pixels in the framebuffer are premultiplied so
e3f29c
      it avoids a conversion. */
e3f29c
@@ -3590,123 +3591,125 @@ calculate_z_translation (float z_near)
e3f29c
    *  z_2d = --------------------------- + z_near
e3f29c
    *                 sin (0.5°)
e3f29c
    */
e3f29c
 
e3f29c
    /* We expect the compiler should boil this down to z_near * CONSTANT
e3f29c
     * already, but just in case we use precomputed constants
e3f29c
     */
e3f29c
 #if 0
e3f29c
 # define A      tanf (_DEG_TO_RAD (30.f))
e3f29c
 # define B      sinf (_DEG_TO_RAD (120.f))
e3f29c
 # define C      cosf (_DEG_TO_RAD (30.5f))
e3f29c
 # define D      sinf (_DEG_TO_RAD (.5f))
e3f29c
 #else
e3f29c
 # define A      0.57735025882720947265625f
e3f29c
 # define B      0.866025388240814208984375f
e3f29c
 # define C      0.86162912845611572265625f
e3f29c
 # define D      0.00872653536498546600341796875f
e3f29c
 #endif
e3f29c
 
e3f29c
   return z_near
e3f29c
        * A * B * C
e3f29c
        / D
e3f29c
        + z_near;
e3f29c
 }
e3f29c
 
e3f29c
 void
e3f29c
 _clutter_stage_maybe_setup_viewport (ClutterStage     *stage,
e3f29c
                                      ClutterStageView *view)
e3f29c
 {
e3f29c
   ClutterStagePrivate *priv = stage->priv;
e3f29c
+  CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (view);
e3f29c
 
e3f29c
   if (clutter_stage_view_is_dirty_viewport (view))
e3f29c
     {
e3f29c
       cairo_rectangle_int_t view_layout;
e3f29c
       ClutterPerspective perspective;
e3f29c
       float fb_scale;
e3f29c
       float viewport_offset_x;
e3f29c
       float viewport_offset_y;
e3f29c
       float z_2d;
e3f29c
 
e3f29c
       CLUTTER_NOTE (PAINT,
e3f29c
                     "Setting up the viewport { w:%f, h:%f }",
e3f29c
                     priv->viewport[2],
e3f29c
                     priv->viewport[3]);
e3f29c
 
e3f29c
       fb_scale = clutter_stage_view_get_scale (view);
e3f29c
       clutter_stage_view_get_layout (view, &view_layout);
e3f29c
 
e3f29c
       viewport_offset_x = view_layout.x * fb_scale;
e3f29c
       viewport_offset_y = view_layout.y * fb_scale;
e3f29c
-      cogl_set_viewport (priv->viewport[0] * fb_scale - viewport_offset_x,
e3f29c
-                         priv->viewport[1] * fb_scale - viewport_offset_y,
e3f29c
-                         priv->viewport[2] * fb_scale,
e3f29c
-                         priv->viewport[3] * fb_scale);
e3f29c
+      cogl_framebuffer_set_viewport (fb,
e3f29c
+                                     priv->viewport[0] * fb_scale - viewport_offset_x,
e3f29c
+                                     priv->viewport[1] * fb_scale - viewport_offset_y,
e3f29c
+                                     priv->viewport[2] * fb_scale,
e3f29c
+                                     priv->viewport[3] * fb_scale);
e3f29c
 
e3f29c
       perspective = priv->perspective;
e3f29c
 
e3f29c
       /* Ideally we want to regenerate the perspective matrix whenever
e3f29c
        * the size changes but if the user has provided a custom matrix
e3f29c
        * then we don't want to override it */
e3f29c
       if (!priv->has_custom_perspective)
e3f29c
         {
e3f29c
           perspective.aspect = priv->viewport[2] / priv->viewport[3];
e3f29c
           z_2d = calculate_z_translation (perspective.z_near);
e3f29c
 
e3f29c
           /* NB: z_2d is only enough room for 85% of the stage_height between
e3f29c
            * the stage and the z_near plane. For behind the stage plane we
e3f29c
            * want a more consistent gap of 10 times the stage_height before
e3f29c
            * hitting the far plane so we calculate that relative to the final
e3f29c
            * height of the stage plane at the z_2d_distance we got... */
e3f29c
           perspective.z_far = z_2d +
e3f29c
             tanf (_DEG_TO_RAD (perspective.fovy / 2.0f)) * z_2d * 20.0f;
e3f29c
 
e3f29c
           clutter_stage_set_perspective_internal (stage, &perspective);
e3f29c
         }
e3f29c
       else
e3f29c
         z_2d = calculate_z_translation (perspective.z_near);
e3f29c
 
e3f29c
       cogl_matrix_init_identity (&priv->view);
e3f29c
       cogl_matrix_view_2d_in_perspective (&priv->view,
e3f29c
                                           perspective.fovy,
e3f29c
                                           perspective.aspect,
e3f29c
                                           perspective.z_near,
e3f29c
                                           z_2d,
e3f29c
                                           priv->viewport[2],
e3f29c
                                           priv->viewport[3]);
e3f29c
 
e3f29c
       clutter_stage_view_set_dirty_viewport (view, FALSE);
e3f29c
     }
e3f29c
 
e3f29c
   if (clutter_stage_view_is_dirty_projection (view))
e3f29c
     {
e3f29c
-      cogl_set_projection_matrix (&priv->projection);
e3f29c
+      cogl_framebuffer_set_projection_matrix (fb, &priv->projection);
e3f29c
 
e3f29c
       clutter_stage_view_set_dirty_projection (view, FALSE);
e3f29c
     }
e3f29c
 }
e3f29c
 
e3f29c
 #undef _DEG_TO_RAD
e3f29c
 
e3f29c
 /**
e3f29c
  * clutter_stage_ensure_redraw:
e3f29c
  * @stage: a #ClutterStage
e3f29c
  *
e3f29c
  * Ensures that @stage is redrawn
e3f29c
  *
e3f29c
  * This function should not be called by applications: it is
e3f29c
  * used when embedding a #ClutterStage into a toolkit with
e3f29c
  * another windowing system, like GTK+.
e3f29c
  *
e3f29c
  * Since: 1.0
e3f29c
  */
e3f29c
 void
e3f29c
 clutter_stage_ensure_redraw (ClutterStage *stage)
e3f29c
 {
e3f29c
   ClutterMasterClock *master_clock;
e3f29c
   ClutterStagePrivate *priv;
e3f29c
 
e3f29c
   g_return_if_fail (CLUTTER_IS_STAGE (stage));
e3f29c
 
e3f29c
   priv = stage->priv;
e3f29c
 
e3f29c
   if (!priv->relayout_pending && !priv->redraw_pending)
e3f29c
-- 
e3f29c
2.14.3
e3f29c