From 20f19fe06ca5821949b5e47464241d31c2e6dffc Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 19 Feb 2011 09:15:34 +0000 Subject: [PATCH] offscreen-effect: Add private API for getting the target size Since the FBO target might have a different size than the mere paint box of the actor, we need API to get it out of the ClutterOffscreenEffect private data structure and on to sub-classes. Since we cannot add new API in a stable cycle, we need a private function; we'll leave it there even when opening 1.7, since it's useful for internal purposes. --- clutter/Makefile.am | 1 + clutter/clutter-offscreen-effect-private.h | 14 ++++++++++++++ clutter/clutter-offscreen-effect.c | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 clutter/clutter-offscreen-effect-private.h diff --git a/clutter/Makefile.am b/clutter/Makefile.am index 0a05f280d..8c89acdc4 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -239,6 +239,7 @@ source_h_priv = \ $(srcdir)/clutter-keysyms-table.h \ $(srcdir)/clutter-master-clock.h \ $(srcdir)/clutter-model-private.h \ + $(srcdir)/clutter-offscreen-effect-private.h \ $(srcdir)/clutter-paint-volume-private.h \ $(srcdir)/clutter-private.h \ $(srcdir)/clutter-profile.h \ diff --git a/clutter/clutter-offscreen-effect-private.h b/clutter/clutter-offscreen-effect-private.h new file mode 100644 index 000000000..6a9137bff --- /dev/null +++ b/clutter/clutter-offscreen-effect-private.h @@ -0,0 +1,14 @@ +#ifndef __CLUTTER_OFFSCREEN_EFFECT_PRIVATE_H__ +#define __CLUTTER_OFFSCREEN_EFFECT_PRIVATE_H__ + +#include + +G_BEGIN_DECLS + +gboolean _clutter_offscreen_effect_get_target_size (ClutterOffscreenEffect *effect, + gfloat *width, + gfloat *height); + +G_END_DECLS + +#endif /* __CLUTTER_OFFSCREEN_EFFECT_PRIVATE_H__ */ diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c index 1fbb17e95..269640847 100644 --- a/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter-offscreen-effect.c @@ -475,3 +475,22 @@ clutter_offscreen_effect_create_texture (ClutterOffscreenEffect *effect, width, height); } + +gboolean +_clutter_offscreen_effect_get_target_size (ClutterOffscreenEffect *effect, + gfloat *width, + gfloat *height) +{ + ClutterOffscreenEffectPrivate *priv = effect->priv; + + if (priv->target == NULL) + return FALSE; + + if (width) + *width = priv->target_width; + + if (height) + *height = priv->target_height; + + return TRUE; +}