From c5dc0f4a2eaf5214406eb647b80898c6eba7c719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 7 Mar 2017 18:02:52 +0800 Subject: [PATCH] clutter/stage-view: Add getter for getting the offscreen blit transform This will be used to invert the transform in the nested mode, making it possible to test offscreen texture based transform using the nested backend. https://bugzilla.gnome.org/show_bug.cgi?id=779745 --- clutter/clutter/clutter-stage-view.c | 12 ++++++++++-- clutter/clutter/clutter-stage-view.h | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c index 2b89bb273..e39927884 100644 --- a/clutter/clutter/clutter-stage-view.c +++ b/clutter/clutter/clutter-stage-view.c @@ -179,16 +179,24 @@ clutter_stage_view_set_dirty_projection (ClutterStageView *view, priv->dirty_projection = dirty; } +void +clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view, + CoglMatrix *matrix) +{ + ClutterStageViewClass *view_class = CLUTTER_STAGE_VIEW_GET_CLASS (view); + + view_class->get_offscreen_transformation_matrix (view, matrix); +} + void clutter_stage_view_transform_to_onscreen (ClutterStageView *view, gfloat *x, gfloat *y) { - ClutterStageViewClass *view_class = CLUTTER_STAGE_VIEW_GET_CLASS (view); gfloat z = 0, w = 1; CoglMatrix matrix; - view_class->get_offscreen_transformation_matrix (view, &matrix); + clutter_stage_view_get_offscreen_transformation_matrix (view, &matrix); cogl_matrix_get_inverse (&matrix, &matrix); cogl_matrix_transform_point (&matrix, x, y, &z, &w); } diff --git a/clutter/clutter/clutter-stage-view.h b/clutter/clutter/clutter-stage-view.h index e820e9646..3eb8da452 100644 --- a/clutter/clutter/clutter-stage-view.h +++ b/clutter/clutter/clutter-stage-view.h @@ -70,4 +70,8 @@ gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view); void clutter_stage_view_set_dirty_projection (ClutterStageView *view, gboolean dirty); +CLUTTER_AVAILABLE_IN_MUTTER +void clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view, + CoglMatrix *matrix); + #endif /* __CLUTTER_STAGE_VIEW_H__ */