Code using non-rect clipping path in 1.14 no longer works in 1.16



Hi,
We have a ClutterContent subclass that optionally uses a rounded rectangle clipping path.  The code was developed and tested under Clutter 1.14.2, displaying the clipped content properly.  Under Clutter 1.16.0 (with cogl 1.16) the content is not drawn or is completely clipped out.  If the cogl_path_round_rectangle() call is changed to a cogl_path_rectangle() the code works.

Original code that worked under Clutter 1.14.2

static void xxx_fill_paint_content (ClutterContent   *content,
                             ClutterActor     *actor,
                             ClutterPaintNode *root)
{
...
  if (needClip)
 {
       gfloat width, height;
ClutterActorBox allocation = { 0, };
clipNode = clutter_clip_node_new();
clutter_paint_node_set_name(clipNode, "Clip");

clutter_actor_get_allocation_box (actor, &allocation);
clutter_actor_box_get_size (&allocation, &width, &height);

CoglPath* path = NULL;
cogl_path_new();
cogl_path_round_rectangle (0, 0, 
width,
height,
radius,
arcStep);
path = cogl_get_path();
clutter_paint_node_add_path(clipNode, path);
clutter_paint_node_add_child (root, clipNode);
clutter_paint_node_unref(clipNode);
  }
 
 ClutterPaintNode* contentNode = clutter_color_node_new (NULL);
  
  // draw content...

  // if clipped, hang content node on clipping node

  clutter_paint_node_add_child (hasRoundedCorners ? clipNode : root, contentNode);
  clutter_paint_node_unref (contentNode);
}

Any solution on this?  We wanted to upgrade because of the fix for 
clutter-offscreen-effect: Allocate the cogl texture directly
https://git.gnome.org/browse/clutter/commit/?id=b416224d

In the meantime we'll try upgrading just to 1.15.2 which is when the above fix was released.

Reza.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]