mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
cogl: Use COGL_ENABLE_DEBUG instead of COGL_DEBUG_ENABLED
COGL_DEBUG_ENABLED is a macro to check if a debug flag is set. COGL_ENABLE_DEBUG is set by the build system if it's a debug build. The check `#ifdef COGL_DEBUG_ENABLED` always evaluates to true. Use the appropriate macro to guard some debugging code. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3446>
This commit is contained in:
parent
6749151ac9
commit
db492fe335
@ -56,10 +56,9 @@ struct _CoglMatrixEntry
|
||||
CoglMatrixOp op;
|
||||
unsigned int ref_count;
|
||||
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
/* used for performance tracing */
|
||||
/* Debugging, only used when defined(COGL_ENABLE_DEBUG)
|
||||
* Used for performance tracing */
|
||||
int composite_gets;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct _CoglMatrixEntryTranslate
|
||||
|
@ -56,7 +56,7 @@ _cogl_matrix_entry_new (CoglMatrixOp operation)
|
||||
entry->ref_count = 1;
|
||||
entry->op = operation;
|
||||
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
#ifdef COGL_ENABLE_DEBUG
|
||||
entry->composite_gets = 0;
|
||||
#endif
|
||||
|
||||
@ -154,7 +154,7 @@ _cogl_matrix_entry_identity_init (CoglMatrixEntry *entry)
|
||||
entry->ref_count = 1;
|
||||
entry->op = COGL_MATRIX_OP_LOAD_IDENTITY;
|
||||
entry->parent = NULL;
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
#ifdef COGL_ENABLE_DEBUG
|
||||
entry->composite_gets = 0;
|
||||
#endif
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ dump_pipeline_cb (CoglNode *node, void *user_data)
|
||||
pipeline_id,
|
||||
pipeline,
|
||||
G_OBJECT (pipeline)->ref_count,
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
#ifdef COGL_ENABLE_DEBUG
|
||||
pipeline->has_static_breadcrumb ?
|
||||
pipeline->static_breadcrumb : "NULL"
|
||||
#else
|
||||
|
@ -308,13 +308,6 @@ struct _CoglPipeline
|
||||
* be allocated dynamically when required... */
|
||||
CoglPipelineBigState *big_state;
|
||||
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
/* For debugging purposes it's possible to associate a static const
|
||||
* string with a pipeline which can be an aid when trying to trace
|
||||
* where the pipeline originates from */
|
||||
const char *static_breadcrumb;
|
||||
#endif
|
||||
|
||||
/* Cached state... */
|
||||
|
||||
/* A cached, complete list of the layers this pipeline depends
|
||||
@ -360,12 +353,17 @@ struct _CoglPipeline
|
||||
|
||||
unsigned int layers_cache_dirty:1;
|
||||
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
/* Debugging, only used when defined(COGL_ENABLE_DEBUG) */
|
||||
|
||||
/* For debugging purposes it's possible to associate a static const
|
||||
* string with a pipeline which can be an aid when trying to trace
|
||||
* where the pipeline originates from */
|
||||
unsigned int has_static_breadcrumb:1;
|
||||
#endif
|
||||
|
||||
/* For debugging purposes it's possible to associate a static const
|
||||
* string with a pipeline which can be an aid when trying to trace
|
||||
* where the pipeline originates from */
|
||||
const char *static_breadcrumb;
|
||||
};
|
||||
|
||||
struct _CoglPipelineClass
|
||||
@ -728,7 +726,7 @@ void
|
||||
_cogl_pipeline_apply_overrides (CoglPipeline *pipeline,
|
||||
CoglPipelineFlushOptions *options);
|
||||
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
#ifdef COGL_ENABLE_DEBUG
|
||||
void
|
||||
_cogl_pipeline_set_static_breadcrumb (CoglPipeline *pipeline,
|
||||
const char *breadcrumb);
|
||||
|
@ -373,7 +373,7 @@ cogl_pipeline_new (CoglContext *context)
|
||||
{
|
||||
CoglPipeline *new = cogl_pipeline_copy (context->default_pipeline);
|
||||
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
#ifdef COGL_ENABLE_DEBUG
|
||||
_cogl_pipeline_set_static_breadcrumb (new, "new");
|
||||
#endif
|
||||
return new;
|
||||
@ -1159,7 +1159,7 @@ _cogl_pipeline_pre_change_notify (CoglPipeline *pipeline,
|
||||
|
||||
new_authority =
|
||||
cogl_pipeline_copy (_cogl_pipeline_get_parent (pipeline));
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
#ifdef COGL_ENABLE_DEBUG
|
||||
_cogl_pipeline_set_static_breadcrumb (new_authority,
|
||||
"pre_change_notify:copy-on-write");
|
||||
#endif
|
||||
@ -2302,7 +2302,7 @@ _cogl_pipeline_journal_unref (CoglPipeline *pipeline)
|
||||
g_object_unref (pipeline);
|
||||
}
|
||||
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
#ifdef COGL_ENABLE_DEBUG
|
||||
void
|
||||
_cogl_pipeline_set_static_breadcrumb (CoglPipeline *pipeline,
|
||||
const char *breadcrumb)
|
||||
|
Loading…
Reference in New Issue
Block a user