mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
fbad0a75b6
This adds gives Cogl a dedicated UProf context which will be linked together with Clutter's context during clutter_init_real(). Initial timers cover _cogl_journal_flush and _cogl_journal_log_quad You can explicitly ask for a report of Cogl statistics by exporting COGL_PROFILE_OUTPUT_REPORT=1 but since the context is linked with Clutter's the statisitcs will also be shown in the automatic Clutter reports.
31 lines
621 B
C
31 lines
621 B
C
|
|
#ifdef COGL_ENABLE_PROFILE
|
|
|
|
#include "cogl-profile.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
UProfContext *_cogl_uprof_context;
|
|
|
|
|
|
static void __attribute__ ((constructor))
|
|
cogl_uprof_constructor (void)
|
|
{
|
|
_cogl_uprof_context = uprof_context_new ("Cogl");
|
|
}
|
|
|
|
static void __attribute__ ((destructor))
|
|
cogl_uprof_destructor (void)
|
|
{
|
|
if (getenv ("COGL_PROFILE_OUTPUT_REPORT"))
|
|
{
|
|
UProfReport *report = uprof_report_new ("Cogl report");
|
|
uprof_report_add_context (report, _cogl_uprof_context);
|
|
uprof_report_print (report);
|
|
uprof_report_unref (report);
|
|
}
|
|
uprof_context_unref (_cogl_uprof_context);
|
|
}
|
|
|
|
#endif
|