Evas filters: Create specific log domain

This will improve the debug output of evas and specifically
allow setting "evas_filter" log level to a higher or lower
value depending on what you are debugging :)
This commit is contained in:
Jean-Philippe Andre 2015-06-03 19:59:11 +09:00
parent 225c0f937a
commit 93797e3b0d
7 changed files with 66 additions and 9 deletions

View File

@ -62,6 +62,7 @@ evas_init(void)
}
#endif
_evas_preload_thread_init();
evas_filter_init();
evas_thread_init();
@ -119,6 +120,12 @@ evas_shutdown(void)
evas_object_image_load_opts_cow = NULL;
evas_object_image_state_cow = NULL;
evas_filter_shutdown();
eina_cow_del(evas_object_filter_cow);
eina_cow_del(evas_object_mask_cow);
evas_object_filter_cow = NULL;
evas_object_mask_cow = NULL;
evas_thread_shutdown();
_evas_preload_thread_shutdown();
evas_async_events_shutdown();

View File

@ -15,13 +15,13 @@
*/
#include "evas_filter.h"
#include "evas_private.h"
#include "evas_filter_private.h"
#ifdef EVAS_CSERVE2
# include "evas_cs2_private.h"
#endif
#include "evas_filter_private.h"
#define _assert(a) if (!(a)) CRI("Failed on %s", #a);
static void _buffer_free(Evas_Filter_Buffer *fb);
@ -1984,3 +1984,24 @@ evas_filter_run(Evas_Filter_Context *ctx)
ctx->post_run.cb(ctx, ctx->post_run.data, ret);
return ret;
}
/* Logging */
static int init_cnt = 0;
int _evas_filter_log_dom = 0;
void
evas_filter_init()
{
if ((init_cnt++) > 0) return;
_evas_filter_log_dom = eina_log_domain_register("evas_filter", EVAS_FILTER_LOG_COLOR);
}
void
evas_filter_shutdown()
{
if ((--init_cnt) > 0) return;
eina_log_domain_unregister(_evas_filter_log_dom);
_evas_filter_log_dom = 0;
}

View File

@ -1,9 +1,9 @@
#include "evas_filter.h"
#include "evas_filter_private.h"
#include <math.h>
#include <time.h>
#include "evas_filter.h"
#include "evas_filter_private.h"
static int
_box_blur_auto_radius(int *radii, int r)
{

View File

@ -1,10 +1,9 @@
/* Simple bump map algorithms for the software engine */
#include "evas_filter_private.h"
#include "evas_blend_private.h"
#include <math.h>
#include "evas_filter_private.h"
#include "evas_blend_private.h"
#ifdef CLAMP
# undef CLAMP

View File

@ -1,10 +1,11 @@
#include "evas_filter_private.h"
#include <stdarg.h>
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#include "evas_filter_private.h"
#if LUA_VERSION_NUM == 502
# define LUA52 1
#endif

View File

@ -4,6 +4,31 @@
#include "evas_filter.h"
#include "evas_private.h"
/* logging variables */
extern int _evas_filter_log_dom;
#define EVAS_FILTER_LOG_COLOR EINA_COLOR_LIGHTBLUE
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_evas_filter_log_dom, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_evas_filter_log_dom, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_evas_filter_log_dom, __VA_ARGS__)
#ifdef CRI
# undef CRI
#endif
#define CRI(...) EINA_LOG_DOM_CRIT(_evas_filter_log_dom, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_evas_filter_log_dom, __VA_ARGS__)
// This is a potential optimization.
#define DIV_USING_BITSHIFT 1

View File

@ -1771,6 +1771,10 @@ void _evas_canvas3d_eet_file_init(void);
void _evas_canvas3d_eet_descriptor_shutdown(void);
void _evas_canvas3d_eet_file_free(void);
/* Filters */
void evas_filter_init(void);
void evas_filter_shutdown(void);
/* Temporary save/load functions */
void evas_common_load_model_from_file(Evas_Canvas3D_Mesh *model, const char *file);
void evas_common_load_model_from_eina_file(Evas_Canvas3D_Mesh *model, const Eina_File *file);