clutter: Add some preliminary tracing to clutter

https://gitlab.gnome.org/GNOME/mutter/merge_requests/197
This commit is contained in:
Jonas Ådahl 2018-05-15 16:34:36 +01:00 committed by Georges Basile Stavracas Neto
parent e5e58f8075
commit 04fb6f7659
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385
2 changed files with 17 additions and 0 deletions

View File

@ -75,6 +75,7 @@
#include "clutter-private.h" #include "clutter-private.h"
#include "cogl/cogl.h" #include "cogl/cogl.h"
#include "cogl/cogl-trace.h"
/* <private> /* <private>
* ClutterStageHint: * ClutterStageHint:
@ -632,6 +633,8 @@ clutter_stage_do_paint_view (ClutterStage *stage,
float viewport[4]; float viewport[4];
cairo_rectangle_int_t geom; cairo_rectangle_int_t geom;
COGL_TRACE_BEGIN_SCOPED (ClutterStageDoPaintView);
_clutter_stage_window_get_geometry (priv->impl, &geom); _clutter_stage_window_get_geometry (priv->impl, &geom);
viewport[0] = priv->viewport[0]; viewport[0] = priv->viewport[0];
@ -685,10 +688,14 @@ _clutter_stage_paint_view (ClutterStage *stage,
{ {
ClutterStagePrivate *priv = stage->priv; ClutterStagePrivate *priv = stage->priv;
COGL_TRACE_BEGIN_SCOPED (ClutterStagePaintView);
if (!priv->impl) if (!priv->impl)
return; return;
clutter_stage_do_paint_view (stage, view, clip); clutter_stage_do_paint_view (stage, view, clip);
COGL_TRACE_BEGIN_SCOPED (ClutterStagePaintViewAfterPaint);
g_signal_emit (stage, stage_signals[AFTER_PAINT], 0); g_signal_emit (stage, stage_signals[AFTER_PAINT], 0);
} }
@ -702,6 +709,8 @@ clutter_stage_paint (ClutterActor *self)
ClutterActorIter iter; ClutterActorIter iter;
ClutterActor *child; ClutterActor *child;
COGL_TRACE_BEGIN_SCOPED (ClutterStagePaint);
clutter_actor_iter_init (&iter, self); clutter_actor_iter_init (&iter, self);
while (clutter_actor_iter_next (&iter, &child)) while (clutter_actor_iter_next (&iter, &child))
clutter_actor_paint (child); clutter_actor_paint (child);
@ -2945,6 +2954,8 @@ clutter_stage_read_pixels (ClutterStage *stage,
float pixel_height; float pixel_height;
uint8_t *pixels; uint8_t *pixels;
COGL_TRACE_BEGIN_SCOPED (ClutterStageReadPixels);
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL); g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
priv = stage->priv; priv = stage->priv;

View File

@ -46,6 +46,8 @@
#include "clutter-private.h" #include "clutter-private.h"
#include "clutter-stage-private.h" #include "clutter-stage-private.h"
#include "cogl/cogl-trace.h"
typedef struct _ClutterStageViewCoglPrivate typedef struct _ClutterStageViewCoglPrivate
{ {
/* /*
@ -958,6 +960,8 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
gboolean swap_event = FALSE; gboolean swap_event = FALSE;
GList *l; GList *l;
COGL_TRACE_BEGIN (ClutterStageCoglRedraw);
for (l = _clutter_stage_window_get_views (stage_window); l; l = l->next) for (l = _clutter_stage_window_get_views (stage_window); l; l = l->next)
{ {
ClutterStageView *view = l->data; ClutterStageView *view = l->data;
@ -981,6 +985,8 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
stage_cogl->initialized_redraw_clip = FALSE; stage_cogl->initialized_redraw_clip = FALSE;
stage_cogl->frame_count++; stage_cogl->frame_count++;
COGL_TRACE_END (ClutterStageCoglRedraw);
} }
static void static void