[clutter] actor: Add queue_redraw_with_clip()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] actor: Add queue_redraw_with_clip()
- Date: Mon, 12 Dec 2011 17:33:59 +0000 (UTC)
commit f0a246cdc6f3ca35d409b82297d2a99c5e8c7b32
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Mon Oct 31 11:53:45 2011 +0000
actor: Add queue_redraw_with_clip()
Add a public version of the clipped queue redraw, using a 2D clip. This
allows implementing actors with trackable 2D clipped regions, like the
ClutterX11TexturePixmap, outside of Clutter itself.
https://bugzilla.gnome.org/show_bug.cgi?id=660997
clutter/clutter-actor.c | 47 +++++++++++++++++++++++++++++++++++++++++++++--
clutter/clutter-actor.h | 2 ++
clutter/clutter-types.h | 2 ++
3 files changed, 49 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 3c20406..1f7a259 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -5696,8 +5696,8 @@ clutter_actor_queue_redraw (ClutterActor *self)
NULL /* effect */);
}
-/*
- * clutter_actor_queue_redraw_with_clip:
+/*< private >
+ * _clutter_actor_queue_redraw_with_clip:
* @self: A #ClutterActor
* @flags: A mask of #ClutterRedrawFlags controlling the behaviour of
* this queue redraw.
@@ -5771,6 +5771,49 @@ _clutter_actor_queue_only_relayout (ClutterActor *self)
}
/**
+ * clutter_actor_queue_redraw_with_clip:
+ * @self: a #ClutterActor
+ * @clip: (allow-none): a rectangular clip region, or %NULL
+ *
+ * Queues a redraw on @self limited to a specific, actor-relative
+ * rectangular area.
+ *
+ * If @clip is %NULL this function is equivalent to
+ * clutter_actor_queue_redraw().
+ *
+ * Since: 1.10
+ */
+void
+clutter_actor_queue_redraw_with_clip (ClutterActor *self,
+ const cairo_rectangle_int_t *clip)
+{
+ ClutterPaintVolume volume;
+ ClutterVertex origin;
+
+ g_return_if_fail (CLUTTER_IS_ACTOR (self));
+
+ if (clip == NULL)
+ {
+ clutter_actor_queue_redraw (self);
+ return;
+ }
+
+ _clutter_paint_volume_init_static (&volume, self);
+
+ origin.x = clip->x;
+ origin.y = clip->y;
+ origin.z = 0.0f;
+
+ clutter_paint_volume_set_origin (&volume, &origin);
+ clutter_paint_volume_set_width (&volume, clip->width);
+ clutter_paint_volume_set_height (&volume, clip->height);
+
+ _clutter_actor_queue_redraw_full (self, 0, &volume, NULL);
+
+ clutter_paint_volume_free (&volume);
+}
+
+/**
* clutter_actor_queue_relayout:
* @self: A #ClutterActor
*
diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h
index 7adabf4..7bd2f0d 100644
--- a/clutter/clutter-actor.h
+++ b/clutter/clutter-actor.h
@@ -280,6 +280,8 @@ void clutter_actor_unmap (ClutterActor
void clutter_actor_paint (ClutterActor *self);
void clutter_actor_continue_paint (ClutterActor *self);
void clutter_actor_queue_redraw (ClutterActor *self);
+void clutter_actor_queue_redraw_with_clip (ClutterActor *self,
+ const cairo_rectangle_int_t *clip);
void clutter_actor_queue_relayout (ClutterActor *self);
void clutter_actor_destroy (ClutterActor *self);
diff --git a/clutter/clutter-types.h b/clutter/clutter-types.h
index 69665c0..7d5b513 100644
--- a/clutter/clutter-types.h
+++ b/clutter/clutter-types.h
@@ -28,6 +28,8 @@
#ifndef __CLUTTER_TYPES_H__
#define __CLUTTER_TYPES_H__
+#include <cairo.h>
+
#include <clutter/clutter-enums.h>
G_BEGIN_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]