mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
backends: Rename ClutterStage[View]Cogl API and types
Rename to MetaStageImpl and MetaStageView, so they are in line with the rest of the backend code. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1862>
This commit is contained in:
parent
8f839b2f9c
commit
d5c3c80dfe
@ -51,7 +51,7 @@ static GParamSpec *obj_props[PROP_LAST];
|
|||||||
|
|
||||||
struct _MetaRendererView
|
struct _MetaRendererView
|
||||||
{
|
{
|
||||||
ClutterStageViewCogl parent;
|
MetaStageView parent;
|
||||||
|
|
||||||
MetaMonitorTransform transform;
|
MetaMonitorTransform transform;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ struct _MetaRendererView
|
|||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (MetaRendererView, meta_renderer_view,
|
G_DEFINE_TYPE (MetaRendererView, meta_renderer_view,
|
||||||
CLUTTER_TYPE_STAGE_VIEW_COGL)
|
META_TYPE_STAGE_VIEW)
|
||||||
|
|
||||||
MetaMonitorTransform
|
MetaMonitorTransform
|
||||||
meta_renderer_view_get_transform (MetaRendererView *view)
|
meta_renderer_view_get_transform (MetaRendererView *view)
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#define META_TYPE_RENDERER_VIEW (meta_renderer_view_get_type ())
|
#define META_TYPE_RENDERER_VIEW (meta_renderer_view_get_type ())
|
||||||
G_DECLARE_FINAL_TYPE (MetaRendererView, meta_renderer_view,
|
G_DECLARE_FINAL_TYPE (MetaRendererView, meta_renderer_view,
|
||||||
META, RENDERER_VIEW,
|
META, RENDERER_VIEW,
|
||||||
ClutterStageViewCogl)
|
MetaStageView)
|
||||||
|
|
||||||
MetaMonitorTransform meta_renderer_view_get_transform (MetaRendererView *view);
|
MetaMonitorTransform meta_renderer_view_get_transform (MetaRendererView *view);
|
||||||
|
|
||||||
|
@ -32,30 +32,30 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_STAGE_COGL (_clutter_stage_cogl_get_type ())
|
#define META_TYPE_STAGE_IMPL (meta_stage_impl_get_type ())
|
||||||
#define CLUTTER_STAGE_COGL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_COGL, ClutterStageCogl))
|
#define META_STAGE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_STAGE_IMPL, MetaStageImpl))
|
||||||
#define CLUTTER_IS_STAGE_COGL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_COGL))
|
#define META_IS_STAGE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_STAGE_IMPL))
|
||||||
#define CLUTTER_STAGE_COGL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_STAGE_COGL, ClutterStageCoglClass))
|
#define META_STAGE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_STAGE_IMPL, MetaStageImplClass))
|
||||||
#define CLUTTER_IS_STAGE_COGL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_STAGE_COGL))
|
#define META_IS_STAGE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_STAGE_IMPL))
|
||||||
#define CLUTTER_STAGE_COGL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_STAGE_COGL, ClutterStageCoglClass))
|
#define META_STAGE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_STAGE_IMPL, MetaStageImplClass))
|
||||||
|
|
||||||
typedef struct _ClutterStageCogl ClutterStageCogl;
|
typedef struct _MetaStageImpl MetaStageImpl;
|
||||||
typedef struct _ClutterStageCoglClass ClutterStageCoglClass;
|
typedef struct _MetaStageImplClass MetaStageImplClass;
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterStageCogl, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MetaStageImpl, g_object_unref)
|
||||||
|
|
||||||
#define CLUTTER_TYPE_STAGE_VIEW_COGL (clutter_stage_view_cogl_get_type ())
|
#define META_TYPE_STAGE_VIEW (meta_stage_view_get_type ())
|
||||||
CLUTTER_EXPORT
|
|
||||||
G_DECLARE_DERIVABLE_TYPE (ClutterStageViewCogl, clutter_stage_view_cogl,
|
G_DECLARE_DERIVABLE_TYPE (MetaStageView, meta_stage_view,
|
||||||
CLUTTER, STAGE_VIEW_COGL,
|
META, STAGE_VIEW,
|
||||||
ClutterStageView)
|
ClutterStageView)
|
||||||
|
|
||||||
struct _ClutterStageViewCoglClass
|
struct _MetaStageViewClass
|
||||||
{
|
{
|
||||||
ClutterStageViewClass parent_class;
|
ClutterStageViewClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterStageCogl
|
struct _MetaStageImpl
|
||||||
{
|
{
|
||||||
GObject parent_instance;
|
GObject parent_instance;
|
||||||
|
|
||||||
@ -66,22 +66,19 @@ struct _ClutterStageCogl
|
|||||||
ClutterBackend *backend;
|
ClutterBackend *backend;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterStageCoglClass
|
struct _MetaStageImplClass
|
||||||
{
|
{
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
GType meta_stage_impl_get_type (void) G_GNUC_CONST;
|
||||||
GType _clutter_stage_cogl_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
void meta_stage_impl_presented (MetaStageImpl *stage_impl,
|
||||||
void _clutter_stage_cogl_presented (ClutterStageCogl *stage_cogl,
|
CoglFrameEvent frame_event,
|
||||||
CoglFrameEvent frame_event,
|
ClutterFrameInfo *frame_info);
|
||||||
ClutterFrameInfo *frame_info);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
void meta_stage_impl_add_onscreen_frame_info (MetaStageImpl *stage_impl,
|
||||||
void clutter_stage_cogl_add_onscreen_frame_info (ClutterStageCogl *stage_cogl,
|
ClutterStageView *view);
|
||||||
ClutterStageView *view);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#define MAX_STACK_RECTS 256
|
#define MAX_STACK_RECTS 256
|
||||||
|
|
||||||
typedef struct _ClutterStageViewCoglPrivate
|
typedef struct _MetaStageViewPrivate
|
||||||
{
|
{
|
||||||
/* Damage history, in stage view render target framebuffer coordinate space.
|
/* Damage history, in stage view render target framebuffer coordinate space.
|
||||||
*/
|
*/
|
||||||
@ -47,23 +47,23 @@ typedef struct _ClutterStageViewCoglPrivate
|
|||||||
guint notify_presented_handle_id;
|
guint notify_presented_handle_id;
|
||||||
|
|
||||||
CoglFrameClosure *frame_cb_closure;
|
CoglFrameClosure *frame_cb_closure;
|
||||||
} ClutterStageViewCoglPrivate;
|
} MetaStageViewPrivate;
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (ClutterStageViewCogl, clutter_stage_view_cogl,
|
G_DEFINE_TYPE_WITH_PRIVATE (MetaStageView, meta_stage_view,
|
||||||
CLUTTER_TYPE_STAGE_VIEW)
|
CLUTTER_TYPE_STAGE_VIEW)
|
||||||
|
|
||||||
typedef struct _ClutterStageCoglPrivate
|
typedef struct _MetaStageImplPrivate
|
||||||
{
|
{
|
||||||
int64_t global_frame_counter;
|
int64_t global_frame_counter;
|
||||||
} ClutterStageCoglPrivate;
|
} MetaStageImplPrivate;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
|
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterStageCogl,
|
G_DEFINE_TYPE_WITH_CODE (MetaStageImpl,
|
||||||
_clutter_stage_cogl,
|
meta_stage_impl,
|
||||||
G_TYPE_OBJECT,
|
G_TYPE_OBJECT,
|
||||||
G_ADD_PRIVATE (ClutterStageCogl)
|
G_ADD_PRIVATE (MetaStageImpl)
|
||||||
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
|
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
|
||||||
clutter_stage_window_iface_init));
|
clutter_stage_window_iface_init));
|
||||||
|
|
||||||
@ -76,13 +76,13 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_cogl_unrealize (ClutterStageWindow *stage_window)
|
meta_stage_impl_unrealize (ClutterStageWindow *stage_window)
|
||||||
{
|
{
|
||||||
g_debug ("Unrealizing Cogl stage [%p]", stage_window);
|
g_debug ("Unrealizing Cogl stage [%p]", stage_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_stage_cogl_realize (ClutterStageWindow *stage_window)
|
meta_stage_impl_realize (ClutterStageWindow *stage_window)
|
||||||
{
|
{
|
||||||
ClutterBackend *backend;
|
ClutterBackend *backend;
|
||||||
|
|
||||||
@ -102,42 +102,42 @@ clutter_stage_cogl_realize (ClutterStageWindow *stage_window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int64_t
|
static int64_t
|
||||||
clutter_stage_cogl_get_frame_counter (ClutterStageWindow *stage_window)
|
meta_stage_impl_get_frame_counter (ClutterStageWindow *stage_window)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window);
|
||||||
ClutterStageCoglPrivate *priv =
|
MetaStageImplPrivate *priv =
|
||||||
_clutter_stage_cogl_get_instance_private (stage_cogl);
|
meta_stage_impl_get_instance_private (stage_impl);
|
||||||
|
|
||||||
return priv->global_frame_counter;
|
return priv->global_frame_counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ClutterActor *
|
static ClutterActor *
|
||||||
clutter_stage_cogl_get_wrapper (ClutterStageWindow *stage_window)
|
meta_stage_impl_get_wrapper (ClutterStageWindow *stage_window)
|
||||||
{
|
{
|
||||||
return CLUTTER_ACTOR (CLUTTER_STAGE_COGL (stage_window)->wrapper);
|
return CLUTTER_ACTOR (META_STAGE_IMPL (stage_window)->wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_cogl_show (ClutterStageWindow *stage_window,
|
meta_stage_impl_show (ClutterStageWindow *stage_window,
|
||||||
gboolean do_raise)
|
gboolean do_raise)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window);
|
||||||
|
|
||||||
clutter_actor_map (CLUTTER_ACTOR (stage_cogl->wrapper));
|
clutter_actor_map (CLUTTER_ACTOR (stage_impl->wrapper));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_cogl_hide (ClutterStageWindow *stage_window)
|
meta_stage_impl_hide (ClutterStageWindow *stage_window)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window);
|
||||||
|
|
||||||
clutter_actor_unmap (CLUTTER_ACTOR (stage_cogl->wrapper));
|
clutter_actor_unmap (CLUTTER_ACTOR (stage_impl->wrapper));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_cogl_resize (ClutterStageWindow *stage_window,
|
meta_stage_impl_resize (ClutterStageWindow *stage_window,
|
||||||
gint width,
|
gint width,
|
||||||
gint height)
|
gint height)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,8 +150,8 @@ paint_damage_region (ClutterStageWindow *stage_window,
|
|||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
||||||
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
||||||
static CoglPipeline *overlay_blue = NULL;
|
static CoglPipeline *overlay_blue = NULL;
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window);
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
|
ClutterActor *actor = CLUTTER_ACTOR (stage_impl->wrapper);
|
||||||
graphene_matrix_t transform;
|
graphene_matrix_t transform;
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
|
|
||||||
@ -221,9 +221,9 @@ static gboolean
|
|||||||
notify_presented_idle (gpointer user_data)
|
notify_presented_idle (gpointer user_data)
|
||||||
{
|
{
|
||||||
NotifyPresentedClosure *closure = user_data;
|
NotifyPresentedClosure *closure = user_data;
|
||||||
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (closure->view);
|
MetaStageView *view = META_STAGE_VIEW (closure->view);
|
||||||
ClutterStageViewCoglPrivate *view_priv =
|
MetaStageViewPrivate *view_priv =
|
||||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
meta_stage_view_get_instance_private (view);
|
||||||
|
|
||||||
view_priv->notify_presented_handle_id = 0;
|
view_priv->notify_presented_handle_id = 0;
|
||||||
clutter_stage_view_notify_presented (closure->view, &closure->frame_info);
|
clutter_stage_view_notify_presented (closure->view, &closure->frame_info);
|
||||||
@ -233,18 +233,18 @@ notify_presented_idle (gpointer user_data)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
swap_framebuffer (ClutterStageWindow *stage_window,
|
swap_framebuffer (ClutterStageWindow *stage_window,
|
||||||
ClutterStageView *view,
|
ClutterStageView *stage_view,
|
||||||
cairo_region_t *swap_region,
|
cairo_region_t *swap_region,
|
||||||
gboolean swap_with_damage,
|
gboolean swap_with_damage,
|
||||||
ClutterFrame *frame)
|
ClutterFrame *frame)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window);
|
||||||
ClutterStageCoglPrivate *priv =
|
MetaStageImplPrivate *priv =
|
||||||
_clutter_stage_cogl_get_instance_private (stage_cogl);
|
meta_stage_impl_get_instance_private (stage_impl);
|
||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (stage_view);
|
||||||
CoglContext *cogl_context = cogl_framebuffer_get_context (framebuffer);
|
CoglContext *cogl_context = cogl_framebuffer_get_context (framebuffer);
|
||||||
|
|
||||||
clutter_stage_view_before_swap_buffer (view, swap_region);
|
clutter_stage_view_before_swap_buffer (stage_view, swap_region);
|
||||||
|
|
||||||
if (COGL_IS_ONSCREEN (framebuffer))
|
if (COGL_IS_ONSCREEN (framebuffer))
|
||||||
{
|
{
|
||||||
@ -291,18 +291,18 @@ swap_framebuffer (ClutterStageWindow *stage_window,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (view);
|
MetaStageView *view = META_STAGE_VIEW (stage_view);
|
||||||
ClutterStageViewCoglPrivate *view_priv =
|
MetaStageViewPrivate *view_priv =
|
||||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
meta_stage_view_get_instance_private (view);
|
||||||
NotifyPresentedClosure *closure;
|
NotifyPresentedClosure *closure;
|
||||||
|
|
||||||
g_debug ("fake offscreen swap (framebuffer: %p)", framebuffer);
|
g_debug ("fake offscreen swap (framebuffer: %p)", framebuffer);
|
||||||
|
|
||||||
closure = g_new0 (NotifyPresentedClosure, 1);
|
closure = g_new0 (NotifyPresentedClosure, 1);
|
||||||
closure->view = view;
|
closure->view = stage_view;
|
||||||
closure->frame_info = (ClutterFrameInfo) {
|
closure->frame_info = (ClutterFrameInfo) {
|
||||||
.frame_counter = priv->global_frame_counter,
|
.frame_counter = priv->global_frame_counter,
|
||||||
.refresh_rate = clutter_stage_view_get_refresh_rate (view),
|
.refresh_rate = clutter_stage_view_get_refresh_rate (stage_view),
|
||||||
.presentation_time = g_get_monotonic_time (),
|
.presentation_time = g_get_monotonic_time (),
|
||||||
.flags = CLUTTER_FRAME_INFO_FLAG_NONE,
|
.flags = CLUTTER_FRAME_INFO_FLAG_NONE,
|
||||||
.sequence = 0,
|
.sequence = 0,
|
||||||
@ -390,23 +390,23 @@ scale_offset_and_clamp_region (const cairo_region_t *region,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
paint_stage (ClutterStageCogl *stage_cogl,
|
paint_stage (MetaStageImpl *stage_impl,
|
||||||
ClutterStageView *view,
|
ClutterStageView *stage_view,
|
||||||
cairo_region_t *redraw_clip)
|
cairo_region_t *redraw_clip)
|
||||||
{
|
{
|
||||||
ClutterStage *stage = stage_cogl->wrapper;
|
ClutterStage *stage = stage_impl->wrapper;
|
||||||
|
|
||||||
_clutter_stage_maybe_setup_viewport (stage, view);
|
_clutter_stage_maybe_setup_viewport (stage, stage_view);
|
||||||
clutter_stage_paint_view (stage, view, redraw_clip);
|
clutter_stage_paint_view (stage, stage_view, redraw_clip);
|
||||||
|
|
||||||
clutter_stage_view_after_paint (view, redraw_clip);
|
clutter_stage_view_after_paint (stage_view, redraw_clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
static cairo_region_t *
|
static cairo_region_t *
|
||||||
transform_swap_region_to_onscreen (ClutterStageView *view,
|
transform_swap_region_to_onscreen (ClutterStageView *stage_view,
|
||||||
cairo_region_t *swap_region)
|
cairo_region_t *swap_region)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (view);
|
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (stage_view);
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
cairo_rectangle_int_t *rects;
|
cairo_rectangle_int_t *rects;
|
||||||
cairo_region_t *transformed_region;
|
cairo_region_t *transformed_region;
|
||||||
@ -420,7 +420,7 @@ transform_swap_region_to_onscreen (ClutterStageView *view,
|
|||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_region_get_rectangle (swap_region, i, &rects[i]);
|
cairo_region_get_rectangle (swap_region, i, &rects[i]);
|
||||||
clutter_stage_view_transform_rect_to_onscreen (view,
|
clutter_stage_view_transform_rect_to_onscreen (stage_view,
|
||||||
&rects[i],
|
&rects[i],
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
@ -432,16 +432,16 @@ transform_swap_region_to_onscreen (ClutterStageView *view,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
|
meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
|
||||||
ClutterStageView *view,
|
ClutterStageView *stage_view,
|
||||||
ClutterFrame *frame)
|
ClutterFrame *frame)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *stage_window = CLUTTER_STAGE_WINDOW (stage_cogl);
|
ClutterStageWindow *stage_window = CLUTTER_STAGE_WINDOW (stage_impl);
|
||||||
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (view);
|
MetaStageView *view = META_STAGE_VIEW (stage_view);
|
||||||
ClutterStageViewCoglPrivate *view_priv =
|
MetaStageViewPrivate *view_priv =
|
||||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
meta_stage_view_get_instance_private (view);
|
||||||
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (view);
|
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (stage_view);
|
||||||
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (view);
|
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (stage_view);
|
||||||
cairo_rectangle_int_t view_rect;
|
cairo_rectangle_int_t view_rect;
|
||||||
gboolean is_full_redraw;
|
gboolean is_full_redraw;
|
||||||
gboolean use_clipped_redraw = TRUE;
|
gboolean use_clipped_redraw = TRUE;
|
||||||
@ -457,8 +457,8 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
|
|||||||
int fb_width, fb_height;
|
int fb_width, fb_height;
|
||||||
int buffer_age = 0;
|
int buffer_age = 0;
|
||||||
|
|
||||||
clutter_stage_view_get_layout (view, &view_rect);
|
clutter_stage_view_get_layout (stage_view, &view_rect);
|
||||||
fb_scale = clutter_stage_view_get_scale (view);
|
fb_scale = clutter_stage_view_get_scale (stage_view);
|
||||||
fb_width = cogl_framebuffer_get_width (fb);
|
fb_width = cogl_framebuffer_get_width (fb);
|
||||||
fb_height = cogl_framebuffer_get_height (fb);
|
fb_height = cogl_framebuffer_get_height (fb);
|
||||||
|
|
||||||
@ -470,7 +470,7 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
|
|||||||
COGL_IS_ONSCREEN (onscreen) &&
|
COGL_IS_ONSCREEN (onscreen) &&
|
||||||
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
|
||||||
|
|
||||||
redraw_clip = clutter_stage_view_take_redraw_clip (view);
|
redraw_clip = clutter_stage_view_take_redraw_clip (stage_view);
|
||||||
|
|
||||||
/* NB: a NULL redraw clip == full stage redraw */
|
/* NB: a NULL redraw clip == full stage redraw */
|
||||||
if (!redraw_clip)
|
if (!redraw_clip)
|
||||||
@ -588,14 +588,14 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
|
|||||||
cairo_region_t *debug_redraw_clip;
|
cairo_region_t *debug_redraw_clip;
|
||||||
|
|
||||||
debug_redraw_clip = cairo_region_create_rectangle (&view_rect);
|
debug_redraw_clip = cairo_region_create_rectangle (&view_rect);
|
||||||
paint_stage (stage_cogl, view, debug_redraw_clip);
|
paint_stage (stage_impl, stage_view, debug_redraw_clip);
|
||||||
cairo_region_destroy (debug_redraw_clip);
|
cairo_region_destroy (debug_redraw_clip);
|
||||||
}
|
}
|
||||||
else if (use_clipped_redraw)
|
else if (use_clipped_redraw)
|
||||||
{
|
{
|
||||||
cogl_framebuffer_push_region_clip (fb, fb_clip_region);
|
cogl_framebuffer_push_region_clip (fb, fb_clip_region);
|
||||||
|
|
||||||
paint_stage (stage_cogl, view, redraw_clip);
|
paint_stage (stage_impl, stage_view, redraw_clip);
|
||||||
|
|
||||||
cogl_framebuffer_pop_clip (fb);
|
cogl_framebuffer_pop_clip (fb);
|
||||||
}
|
}
|
||||||
@ -603,7 +603,7 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
|
|||||||
{
|
{
|
||||||
g_debug ("Unclipped stage paint");
|
g_debug ("Unclipped stage paint");
|
||||||
|
|
||||||
paint_stage (stage_cogl, view, redraw_clip);
|
paint_stage (stage_impl, stage_view, redraw_clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: It seems there will be a race here in that the stage
|
/* XXX: It seems there will be a race here in that the stage
|
||||||
@ -622,16 +622,16 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
|
|||||||
g_clear_pointer (&redraw_clip, cairo_region_destroy);
|
g_clear_pointer (&redraw_clip, cairo_region_destroy);
|
||||||
g_clear_pointer (&fb_clip_region, cairo_region_destroy);
|
g_clear_pointer (&fb_clip_region, cairo_region_destroy);
|
||||||
|
|
||||||
COGL_TRACE_BEGIN_SCOPED (ClutterStageCoglRedrawViewSwapFramebuffer,
|
COGL_TRACE_BEGIN_SCOPED (MetaStageImplRedrawViewSwapFramebuffer,
|
||||||
"Paint (swap framebuffer)");
|
"Paint (swap framebuffer)");
|
||||||
|
|
||||||
if (clutter_stage_view_get_onscreen (view) !=
|
if (clutter_stage_view_get_onscreen (stage_view) !=
|
||||||
clutter_stage_view_get_framebuffer (view))
|
clutter_stage_view_get_framebuffer (stage_view))
|
||||||
{
|
{
|
||||||
cairo_region_t *transformed_swap_region;
|
cairo_region_t *transformed_swap_region;
|
||||||
|
|
||||||
transformed_swap_region =
|
transformed_swap_region =
|
||||||
transform_swap_region_to_onscreen (view, swap_region);
|
transform_swap_region_to_onscreen (stage_view, swap_region);
|
||||||
cairo_region_destroy (swap_region);
|
cairo_region_destroy (swap_region);
|
||||||
swap_region = transformed_swap_region;
|
swap_region = transformed_swap_region;
|
||||||
}
|
}
|
||||||
@ -648,7 +648,7 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
|
|||||||
|
|
||||||
cairo_region_subtract (swap_region_in_stage_space, queued_redraw_clip);
|
cairo_region_subtract (swap_region_in_stage_space, queued_redraw_clip);
|
||||||
|
|
||||||
paint_damage_region (stage_window, view,
|
paint_damage_region (stage_window, stage_view,
|
||||||
swap_region_in_stage_space, queued_redraw_clip);
|
swap_region_in_stage_space, queued_redraw_clip);
|
||||||
|
|
||||||
cairo_region_destroy (queued_redraw_clip);
|
cairo_region_destroy (queued_redraw_clip);
|
||||||
@ -656,7 +656,7 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
swap_framebuffer (stage_window,
|
swap_framebuffer (stage_window,
|
||||||
view,
|
stage_view,
|
||||||
swap_region,
|
swap_region,
|
||||||
swap_with_damage,
|
swap_with_damage,
|
||||||
frame);
|
frame);
|
||||||
@ -665,15 +665,16 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_stage_cogl_scanout_view (ClutterStageCogl *stage_cogl,
|
meta_stage_impl_scanout_view (MetaStageImpl *stage_impl,
|
||||||
ClutterStageView *view,
|
ClutterStageView *stage_view,
|
||||||
CoglScanout *scanout,
|
CoglScanout *scanout,
|
||||||
ClutterFrame *frame,
|
ClutterFrame *frame,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
ClutterStageCoglPrivate *priv =
|
MetaStageImplPrivate *priv =
|
||||||
_clutter_stage_cogl_get_instance_private (stage_cogl);
|
meta_stage_impl_get_instance_private (stage_impl);
|
||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
|
CoglFramebuffer *framebuffer =
|
||||||
|
clutter_stage_view_get_framebuffer (stage_view);
|
||||||
CoglContext *cogl_context = cogl_framebuffer_get_context (framebuffer);
|
CoglContext *cogl_context = cogl_framebuffer_get_context (framebuffer);
|
||||||
CoglOnscreen *onscreen;
|
CoglOnscreen *onscreen;
|
||||||
CoglFrameInfo *frame_info;
|
CoglFrameInfo *frame_info;
|
||||||
@ -700,23 +701,23 @@ clutter_stage_cogl_scanout_view (ClutterStageCogl *stage_cogl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
meta_stage_impl_redraw_view (ClutterStageWindow *stage_window,
|
||||||
ClutterStageView *view,
|
ClutterStageView *stage_view,
|
||||||
ClutterFrame *frame)
|
ClutterFrame *frame)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window);
|
||||||
g_autoptr (CoglScanout) scanout = NULL;
|
g_autoptr (CoglScanout) scanout = NULL;
|
||||||
|
|
||||||
scanout = clutter_stage_view_take_scanout (view);
|
scanout = clutter_stage_view_take_scanout (stage_view);
|
||||||
if (scanout)
|
if (scanout)
|
||||||
{
|
{
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
|
|
||||||
if (clutter_stage_cogl_scanout_view (stage_cogl,
|
if (meta_stage_impl_scanout_view (stage_impl,
|
||||||
view,
|
stage_view,
|
||||||
scanout,
|
scanout,
|
||||||
frame,
|
frame,
|
||||||
&error))
|
&error))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!g_error_matches (error,
|
if (!g_error_matches (error,
|
||||||
@ -725,16 +726,16 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
g_warning ("Failed to scan out client buffer: %s", error->message);
|
g_warning ("Failed to scan out client buffer: %s", error->message);
|
||||||
}
|
}
|
||||||
|
|
||||||
clutter_stage_cogl_redraw_view_primary (stage_cogl, view, frame);
|
meta_stage_impl_redraw_view_primary (stage_impl, stage_view, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_stage_cogl_add_onscreen_frame_info (ClutterStageCogl *stage_cogl,
|
meta_stage_impl_add_onscreen_frame_info (MetaStageImpl *stage_impl,
|
||||||
ClutterStageView *view)
|
ClutterStageView *stage_view)
|
||||||
{
|
{
|
||||||
ClutterStageCoglPrivate *priv =
|
MetaStageImplPrivate *priv =
|
||||||
_clutter_stage_cogl_get_instance_private (stage_cogl);
|
meta_stage_impl_get_instance_private (stage_impl);
|
||||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (stage_view);
|
||||||
CoglContext *cogl_context = cogl_framebuffer_get_context (framebuffer);
|
CoglContext *cogl_context = cogl_framebuffer_get_context (framebuffer);
|
||||||
CoglFrameInfo *frame_info;
|
CoglFrameInfo *frame_info;
|
||||||
|
|
||||||
@ -747,23 +748,23 @@ clutter_stage_cogl_add_onscreen_frame_info (ClutterStageCogl *stage_cogl,
|
|||||||
static void
|
static void
|
||||||
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
|
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
|
||||||
{
|
{
|
||||||
iface->realize = clutter_stage_cogl_realize;
|
iface->realize = meta_stage_impl_realize;
|
||||||
iface->unrealize = clutter_stage_cogl_unrealize;
|
iface->unrealize = meta_stage_impl_unrealize;
|
||||||
iface->get_wrapper = clutter_stage_cogl_get_wrapper;
|
iface->get_wrapper = meta_stage_impl_get_wrapper;
|
||||||
iface->resize = clutter_stage_cogl_resize;
|
iface->resize = meta_stage_impl_resize;
|
||||||
iface->show = clutter_stage_cogl_show;
|
iface->show = meta_stage_impl_show;
|
||||||
iface->hide = clutter_stage_cogl_hide;
|
iface->hide = meta_stage_impl_hide;
|
||||||
iface->get_frame_counter = clutter_stage_cogl_get_frame_counter;
|
iface->get_frame_counter = meta_stage_impl_get_frame_counter;
|
||||||
iface->redraw_view = clutter_stage_cogl_redraw_view;
|
iface->redraw_view = meta_stage_impl_redraw_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_cogl_set_property (GObject *gobject,
|
meta_stage_impl_set_property (GObject *gobject,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *self = CLUTTER_STAGE_COGL (gobject);
|
MetaStageImpl *self = META_STAGE_IMPL (gobject);
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
@ -782,18 +783,18 @@ clutter_stage_cogl_set_property (GObject *gobject,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_clutter_stage_cogl_class_init (ClutterStageCoglClass *klass)
|
meta_stage_impl_class_init (MetaStageImplClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
gobject_class->set_property = clutter_stage_cogl_set_property;
|
gobject_class->set_property = meta_stage_impl_set_property;
|
||||||
|
|
||||||
g_object_class_override_property (gobject_class, PROP_WRAPPER, "wrapper");
|
g_object_class_override_property (gobject_class, PROP_WRAPPER, "wrapper");
|
||||||
g_object_class_override_property (gobject_class, PROP_BACKEND, "backend");
|
g_object_class_override_property (gobject_class, PROP_BACKEND, "backend");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_clutter_stage_cogl_init (ClutterStageCogl *stage)
|
meta_stage_impl_init (MetaStageImpl *stage)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,14 +804,14 @@ frame_cb (CoglOnscreen *onscreen,
|
|||||||
CoglFrameInfo *frame_info,
|
CoglFrameInfo *frame_info,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
ClutterStageView *view = user_data;
|
ClutterStageView *stage_view = user_data;
|
||||||
|
|
||||||
if (frame_event == COGL_FRAME_EVENT_SYNC)
|
if (frame_event == COGL_FRAME_EVENT_SYNC)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (cogl_frame_info_get_is_symbolic (frame_info))
|
if (cogl_frame_info_get_is_symbolic (frame_info))
|
||||||
{
|
{
|
||||||
clutter_stage_view_notify_ready (view);
|
clutter_stage_view_notify_ready (stage_view);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -838,17 +839,17 @@ frame_cb (CoglOnscreen *onscreen,
|
|||||||
.cpu_time_before_buffer_swap_us =
|
.cpu_time_before_buffer_swap_us =
|
||||||
cogl_frame_info_get_time_before_buffer_swap_us (frame_info),
|
cogl_frame_info_get_time_before_buffer_swap_us (frame_info),
|
||||||
};
|
};
|
||||||
clutter_stage_view_notify_presented (view, &clutter_frame_info);
|
clutter_stage_view_notify_presented (stage_view, &clutter_frame_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_view_cogl_dispose (GObject *object)
|
meta_stage_view_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (object);
|
MetaStageView *view = META_STAGE_VIEW (object);
|
||||||
ClutterStageViewCoglPrivate *view_priv =
|
MetaStageViewPrivate *view_priv =
|
||||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
meta_stage_view_get_instance_private (view);
|
||||||
ClutterStageView *view = CLUTTER_STAGE_VIEW (view_cogl);
|
ClutterStageView *stage_view = CLUTTER_STAGE_VIEW (view);
|
||||||
|
|
||||||
g_clear_handle_id (&view_priv->notify_presented_handle_id, g_source_remove);
|
g_clear_handle_id (&view_priv->notify_presented_handle_id, g_source_remove);
|
||||||
g_clear_pointer (&view_priv->damage_history, clutter_damage_history_free);
|
g_clear_pointer (&view_priv->damage_history, clutter_damage_history_free);
|
||||||
@ -857,51 +858,51 @@ clutter_stage_view_cogl_dispose (GObject *object)
|
|||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
|
|
||||||
framebuffer = clutter_stage_view_get_onscreen (view);
|
framebuffer = clutter_stage_view_get_onscreen (stage_view);
|
||||||
cogl_onscreen_remove_frame_callback (COGL_ONSCREEN (framebuffer),
|
cogl_onscreen_remove_frame_callback (COGL_ONSCREEN (framebuffer),
|
||||||
view_priv->frame_cb_closure);
|
view_priv->frame_cb_closure);
|
||||||
view_priv->frame_cb_closure = NULL;
|
view_priv->frame_cb_closure = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
G_OBJECT_CLASS (clutter_stage_view_cogl_parent_class)->dispose (object);
|
G_OBJECT_CLASS (meta_stage_view_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_view_cogl_constructed (GObject *object)
|
meta_stage_view_constructed (GObject *object)
|
||||||
{
|
{
|
||||||
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (object);
|
MetaStageView *view = META_STAGE_VIEW (object);
|
||||||
ClutterStageViewCoglPrivate *view_priv =
|
MetaStageViewPrivate *view_priv =
|
||||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
meta_stage_view_get_instance_private (view);
|
||||||
ClutterStageView *view = CLUTTER_STAGE_VIEW (view_cogl);
|
ClutterStageView *stage_view = CLUTTER_STAGE_VIEW (view);
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
|
|
||||||
framebuffer = clutter_stage_view_get_onscreen (view);
|
framebuffer = clutter_stage_view_get_onscreen (stage_view);
|
||||||
if (framebuffer && COGL_IS_ONSCREEN (framebuffer))
|
if (framebuffer && COGL_IS_ONSCREEN (framebuffer))
|
||||||
{
|
{
|
||||||
view_priv->frame_cb_closure =
|
view_priv->frame_cb_closure =
|
||||||
cogl_onscreen_add_frame_callback (COGL_ONSCREEN (framebuffer),
|
cogl_onscreen_add_frame_callback (COGL_ONSCREEN (framebuffer),
|
||||||
frame_cb,
|
frame_cb,
|
||||||
view,
|
stage_view,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
G_OBJECT_CLASS (clutter_stage_view_cogl_parent_class)->constructed (object);
|
G_OBJECT_CLASS (meta_stage_view_parent_class)->constructed (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_view_cogl_init (ClutterStageViewCogl *view_cogl)
|
meta_stage_view_init (MetaStageView *view)
|
||||||
{
|
{
|
||||||
ClutterStageViewCoglPrivate *view_priv =
|
MetaStageViewPrivate *view_priv =
|
||||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
meta_stage_view_get_instance_private (view);
|
||||||
|
|
||||||
view_priv->damage_history = clutter_damage_history_new ();
|
view_priv->damage_history = clutter_damage_history_new ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_stage_view_cogl_class_init (ClutterStageViewCoglClass *klass)
|
meta_stage_view_class_init (MetaStageViewClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
object_class->constructed = clutter_stage_view_cogl_constructed;
|
object_class->constructed = meta_stage_view_constructed;
|
||||||
object_class->dispose = clutter_stage_view_cogl_dispose;
|
object_class->dispose = meta_stage_view_dispose;
|
||||||
}
|
}
|
||||||
|
@ -1342,8 +1342,8 @@ add_onscreen_frame_info (MetaCrtc *crtc)
|
|||||||
MetaRenderer *renderer = meta_backend_get_renderer (backend);
|
MetaRenderer *renderer = meta_backend_get_renderer (backend);
|
||||||
MetaRendererView *view = meta_renderer_get_view_for_crtc (renderer, crtc);
|
MetaRendererView *view = meta_renderer_get_view_for_crtc (renderer, crtc);
|
||||||
|
|
||||||
clutter_stage_cogl_add_onscreen_frame_info (CLUTTER_STAGE_COGL (stage_window),
|
meta_stage_impl_add_onscreen_frame_info (META_STAGE_IMPL (stage_window),
|
||||||
CLUTTER_STAGE_VIEW (view));
|
CLUTTER_STAGE_VIEW (view));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -38,7 +38,7 @@ static GQuark quark_view_frame_closure = 0;
|
|||||||
|
|
||||||
struct _MetaStageNative
|
struct _MetaStageNative
|
||||||
{
|
{
|
||||||
ClutterStageCogl parent;
|
MetaStageImpl parent;
|
||||||
|
|
||||||
CoglClosure *frame_closure;
|
CoglClosure *frame_closure;
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ static void
|
|||||||
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
|
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (MetaStageNative, meta_stage_native,
|
G_DEFINE_TYPE_WITH_CODE (MetaStageNative, meta_stage_native,
|
||||||
CLUTTER_TYPE_STAGE_COGL,
|
META_TYPE_STAGE_IMPL,
|
||||||
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
|
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
|
||||||
clutter_stage_window_iface_init))
|
clutter_stage_window_iface_init))
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#define META_TYPE_STAGE_NATIVE (meta_stage_native_get_type ())
|
#define META_TYPE_STAGE_NATIVE (meta_stage_native_get_type ())
|
||||||
G_DECLARE_FINAL_TYPE (MetaStageNative, meta_stage_native,
|
G_DECLARE_FINAL_TYPE (MetaStageNative, meta_stage_native,
|
||||||
META, STAGE_NATIVE, ClutterStageCogl)
|
META, STAGE_NATIVE, MetaStageImpl)
|
||||||
|
|
||||||
void meta_stage_native_rebuild_views (MetaStageNative *stage_native);
|
void meta_stage_native_rebuild_views (MetaStageNative *stage_native);
|
||||||
|
|
||||||
|
@ -1252,8 +1252,8 @@ translate_coords (MetaStageX11 *stage_x11,
|
|||||||
float *x_out,
|
float *x_out,
|
||||||
float *y_out)
|
float *y_out)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_x11);
|
||||||
ClutterActor *stage = CLUTTER_ACTOR (stage_cogl->wrapper);
|
ClutterActor *stage = CLUTTER_ACTOR (stage_impl->wrapper);
|
||||||
float stage_width;
|
float stage_width;
|
||||||
float stage_height;
|
float stage_height;
|
||||||
|
|
||||||
|
@ -49,13 +49,13 @@ static ClutterStageWindowInterface *clutter_stage_window_parent_iface = NULL;
|
|||||||
static void
|
static void
|
||||||
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
|
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
|
||||||
|
|
||||||
static ClutterStageCogl *meta_x11_get_stage_window_from_window (Window win);
|
static MetaStageImpl *meta_x11_get_stage_window_from_window (Window win);
|
||||||
|
|
||||||
static GHashTable *clutter_stages_by_xid = NULL;
|
static GHashTable *clutter_stages_by_xid = NULL;
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (MetaStageX11,
|
G_DEFINE_TYPE_WITH_CODE (MetaStageX11,
|
||||||
meta_stage_x11,
|
meta_stage_x11,
|
||||||
CLUTTER_TYPE_STAGE_COGL,
|
META_TYPE_STAGE_IMPL,
|
||||||
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
|
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
|
||||||
clutter_stage_window_iface_init));
|
clutter_stage_window_iface_init));
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ meta_stage_x11_fix_window_size (MetaStageX11 *stage_x11,
|
|||||||
int new_width,
|
int new_width,
|
||||||
int new_height)
|
int new_height)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_x11);
|
||||||
|
|
||||||
if (stage_x11->xwin != None)
|
if (stage_x11->xwin != None)
|
||||||
{
|
{
|
||||||
@ -91,7 +91,7 @@ meta_stage_x11_fix_window_size (MetaStageX11 *stage_x11,
|
|||||||
|
|
||||||
size_hints = XAllocSizeHints();
|
size_hints = XAllocSizeHints();
|
||||||
|
|
||||||
clutter_stage_get_minimum_size (stage_cogl->wrapper,
|
clutter_stage_get_minimum_size (stage_impl->wrapper,
|
||||||
&min_width,
|
&min_width,
|
||||||
&min_height);
|
&min_height);
|
||||||
|
|
||||||
@ -116,8 +116,8 @@ meta_stage_x11_fix_window_size (MetaStageX11 *stage_x11,
|
|||||||
static void
|
static void
|
||||||
meta_stage_x11_set_wm_protocols (MetaStageX11 *stage_x11)
|
meta_stage_x11_set_wm_protocols (MetaStageX11 *stage_x11)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_x11);
|
||||||
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
|
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_impl->backend);
|
||||||
Display *xdisplay = clutter_x11_get_default_display ();
|
Display *xdisplay = clutter_x11_get_default_display ();
|
||||||
Atom protocols[2];
|
Atom protocols[2];
|
||||||
int n = 0;
|
int n = 0;
|
||||||
@ -188,8 +188,8 @@ meta_stage_x11_resize (ClutterStageWindow *stage_window,
|
|||||||
static inline void
|
static inline void
|
||||||
set_wm_pid (MetaStageX11 *stage_x11)
|
set_wm_pid (MetaStageX11 *stage_x11)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_x11);
|
||||||
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
|
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_impl->backend);
|
||||||
Display *xdisplay = clutter_x11_get_default_display ();
|
Display *xdisplay = clutter_x11_get_default_display ();
|
||||||
long pid;
|
long pid;
|
||||||
|
|
||||||
@ -214,8 +214,8 @@ set_wm_pid (MetaStageX11 *stage_x11)
|
|||||||
static inline void
|
static inline void
|
||||||
set_wm_title (MetaStageX11 *stage_x11)
|
set_wm_title (MetaStageX11 *stage_x11)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_x11);
|
||||||
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
|
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_impl->backend);
|
||||||
Display *xdisplay = clutter_x11_get_default_display ();
|
Display *xdisplay = clutter_x11_get_default_display ();
|
||||||
|
|
||||||
if (stage_x11->xwin == None)
|
if (stage_x11->xwin == None)
|
||||||
@ -292,14 +292,14 @@ static gboolean
|
|||||||
meta_stage_x11_realize (ClutterStageWindow *stage_window)
|
meta_stage_x11_realize (ClutterStageWindow *stage_window)
|
||||||
{
|
{
|
||||||
MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
|
MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window);
|
||||||
ClutterBackend *backend = CLUTTER_BACKEND (stage_cogl->backend);
|
ClutterBackend *backend = CLUTTER_BACKEND (stage_impl->backend);
|
||||||
MetaSeatX11 *seat_x11 = META_SEAT_X11 (clutter_backend_get_default_seat (backend));
|
MetaSeatX11 *seat_x11 = META_SEAT_X11 (clutter_backend_get_default_seat (backend));
|
||||||
Display *xdisplay = clutter_x11_get_default_display ();
|
Display *xdisplay = clutter_x11_get_default_display ();
|
||||||
float width, height;
|
float width, height;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
clutter_actor_get_size (CLUTTER_ACTOR (stage_cogl->wrapper), &width, &height);
|
clutter_actor_get_size (CLUTTER_ACTOR (stage_impl->wrapper), &width, &height);
|
||||||
|
|
||||||
stage_x11->onscreen = create_onscreen (backend->cogl_context, width, height);
|
stage_x11->onscreen = create_onscreen (backend->cogl_context, width, height);
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ meta_stage_x11_realize (ClutterStageWindow *stage_window)
|
|||||||
*/
|
*/
|
||||||
XSelectInput (xdisplay, stage_x11->xwin, META_STAGE_X11_EVENT_MASK);
|
XSelectInput (xdisplay, stage_x11->xwin, META_STAGE_X11_EVENT_MASK);
|
||||||
|
|
||||||
meta_seat_x11_select_stage_events (seat_x11, stage_cogl->wrapper);
|
meta_seat_x11_select_stage_events (seat_x11, stage_impl->wrapper);
|
||||||
|
|
||||||
meta_stage_x11_fix_window_size (stage_x11,
|
meta_stage_x11_fix_window_size (stage_x11,
|
||||||
stage_x11->xwin_width,
|
stage_x11->xwin_width,
|
||||||
@ -423,7 +423,7 @@ meta_stage_x11_show (ClutterStageWindow *stage_window,
|
|||||||
gboolean do_raise)
|
gboolean do_raise)
|
||||||
{
|
{
|
||||||
MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
|
MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_x11);
|
||||||
|
|
||||||
if (stage_x11->xwin != None)
|
if (stage_x11->xwin != None)
|
||||||
{
|
{
|
||||||
@ -443,7 +443,7 @@ meta_stage_x11_show (ClutterStageWindow *stage_window,
|
|||||||
|
|
||||||
g_assert (STAGE_X11_IS_MAPPED (stage_x11));
|
g_assert (STAGE_X11_IS_MAPPED (stage_x11));
|
||||||
|
|
||||||
clutter_actor_map (CLUTTER_ACTOR (stage_cogl->wrapper));
|
clutter_actor_map (CLUTTER_ACTOR (stage_impl->wrapper));
|
||||||
|
|
||||||
XMapWindow (xdisplay, stage_x11->xwin);
|
XMapWindow (xdisplay, stage_x11->xwin);
|
||||||
}
|
}
|
||||||
@ -453,7 +453,7 @@ static void
|
|||||||
meta_stage_x11_hide (ClutterStageWindow *stage_window)
|
meta_stage_x11_hide (ClutterStageWindow *stage_window)
|
||||||
{
|
{
|
||||||
MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
|
MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_x11);
|
||||||
|
|
||||||
if (stage_x11->xwin != None)
|
if (stage_x11->xwin != None)
|
||||||
{
|
{
|
||||||
@ -464,7 +464,7 @@ meta_stage_x11_hide (ClutterStageWindow *stage_window)
|
|||||||
|
|
||||||
g_assert (!STAGE_X11_IS_MAPPED (stage_x11));
|
g_assert (!STAGE_X11_IS_MAPPED (stage_x11));
|
||||||
|
|
||||||
clutter_actor_unmap (CLUTTER_ACTOR (stage_cogl->wrapper));
|
clutter_actor_unmap (CLUTTER_ACTOR (stage_impl->wrapper));
|
||||||
|
|
||||||
XWithdrawWindow (xdisplay, stage_x11->xwin, 0);
|
XWithdrawWindow (xdisplay, stage_x11->xwin, 0);
|
||||||
}
|
}
|
||||||
@ -614,19 +614,19 @@ meta_stage_x11_translate_event (MetaStageX11 *stage_x11,
|
|||||||
XEvent *xevent,
|
XEvent *xevent,
|
||||||
ClutterEvent *event)
|
ClutterEvent *event)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl;
|
MetaStageImpl *stage_impl;
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
ClutterBackendX11 *clutter_backend_x11;
|
ClutterBackendX11 *clutter_backend_x11;
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
MetaBackend *backend;
|
MetaBackend *backend;
|
||||||
|
|
||||||
stage_cogl = meta_x11_get_stage_window_from_window (xevent->xany.window);
|
stage_impl = meta_x11_get_stage_window_from_window (xevent->xany.window);
|
||||||
if (stage_cogl == NULL)
|
if (stage_impl == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
stage = stage_cogl->wrapper;
|
stage = stage_impl->wrapper;
|
||||||
backend = stage_x11->backend;
|
backend = stage_x11->backend;
|
||||||
clutter_backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
|
clutter_backend_x11 = CLUTTER_BACKEND_X11 (stage_impl->backend);
|
||||||
|
|
||||||
switch (xevent->type)
|
switch (xevent->type)
|
||||||
{
|
{
|
||||||
@ -738,11 +738,11 @@ meta_stage_x11_translate_event (MetaStageX11 *stage_x11,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
meta_stage_set_active ((MetaStage *) stage_cogl->wrapper, TRUE);
|
meta_stage_set_active ((MetaStage *) stage_impl->wrapper, TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FocusOut:
|
case FocusOut:
|
||||||
meta_stage_set_active ((MetaStage *) stage_cogl->wrapper, FALSE);
|
meta_stage_set_active ((MetaStage *) stage_impl->wrapper, FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Expose:
|
case Expose:
|
||||||
@ -816,7 +816,7 @@ meta_x11_get_stage_window (ClutterStage *stage)
|
|||||||
return META_STAGE_X11 (impl)->xwin;
|
return META_STAGE_X11 (impl)->xwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ClutterStageCogl *
|
static MetaStageImpl *
|
||||||
meta_x11_get_stage_window_from_window (Window win)
|
meta_x11_get_stage_window_from_window (Window win)
|
||||||
{
|
{
|
||||||
if (clutter_stages_by_xid == NULL)
|
if (clutter_stages_by_xid == NULL)
|
||||||
@ -829,12 +829,12 @@ meta_x11_get_stage_window_from_window (Window win)
|
|||||||
ClutterStage *
|
ClutterStage *
|
||||||
meta_x11_get_stage_from_window (Window win)
|
meta_x11_get_stage_from_window (Window win)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl;
|
MetaStageImpl *stage_impl;
|
||||||
|
|
||||||
stage_cogl = meta_x11_get_stage_window_from_window (win);
|
stage_impl = meta_x11_get_stage_window_from_window (win);
|
||||||
|
|
||||||
if (stage_cogl != NULL)
|
if (stage_impl != NULL)
|
||||||
return stage_cogl->wrapper;
|
return stage_impl->wrapper;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -843,8 +843,8 @@ void
|
|||||||
meta_stage_x11_set_user_time (MetaStageX11 *stage_x11,
|
meta_stage_x11_set_user_time (MetaStageX11 *stage_x11,
|
||||||
uint32_t user_time)
|
uint32_t user_time)
|
||||||
{
|
{
|
||||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_x11);
|
||||||
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
|
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_impl->backend);
|
||||||
|
|
||||||
set_user_time (backend_x11, stage_x11, user_time);
|
set_user_time (backend_x11, stage_x11, user_time);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ typedef enum
|
|||||||
|
|
||||||
struct _MetaStageX11
|
struct _MetaStageX11
|
||||||
{
|
{
|
||||||
ClutterStageCogl parent_instance;
|
MetaStageImpl parent_instance;
|
||||||
|
|
||||||
MetaBackend *backend;
|
MetaBackend *backend;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ struct _MetaStageX11
|
|||||||
|
|
||||||
struct _MetaStageX11Class
|
struct _MetaStageX11Class
|
||||||
{
|
{
|
||||||
ClutterStageCoglClass parent_class;
|
MetaStageImplClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
@ -55,7 +55,7 @@ G_DEFINE_TYPE_WITH_CODE (MetaStageX11Nested, meta_stage_x11_nested,
|
|||||||
typedef struct _MetaStageX11View
|
typedef struct _MetaStageX11View
|
||||||
{
|
{
|
||||||
CoglTexture *texture;
|
CoglTexture *texture;
|
||||||
ClutterStageViewCogl *view;
|
MetaStageView *view;
|
||||||
} MetaStageX11NestedView;
|
} MetaStageX11NestedView;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user