fix eina logging in software_ddraw

SVN revision: 42829
This commit is contained in:
Vincent Torri 2009-10-01 07:44:39 +00:00
parent e30651d7ca
commit 0a775ef90d
3 changed files with 52 additions and 10 deletions

View File

@ -19,6 +19,10 @@ struct _Render_Engine
};
/* log domain variable */
int _evas_log_dom_module = -1;
static void *
_output_setup(int width,
int height,
@ -92,6 +96,15 @@ eng_info(Evas *e)
info = calloc(1, sizeof(Evas_Engine_Info_Software_DDraw));
if (!info) return NULL;
info->magic.magic = rand();
_evas_log_dom_module = eina_log_domain_register("Software_DDraw", EVAS_DEFAULT_LOG_COLOR);
if(_evas_log_dom_module < 0)
{
EINA_LOG_ERR("Can not create a module log domain.");
free(info);
return NULL;
}
return info;
e = NULL;
}
@ -101,6 +114,9 @@ eng_info_free(Evas *e, void *info)
{
Evas_Engine_Info_Software_DDraw *in;
eina_log_domain_unregister(_evas_log_dom_module);
_evas_log_dom_module = -1;
in = (Evas_Engine_Info_Software_DDraw *)info;
free(in);
}

View File

@ -85,6 +85,32 @@ struct _DD_Output_Buffer
int psize;
};
extern int _evas_log_dom_module;
#ifdef EVAS_DEFAULT_LOG_COLOR
# undef EVAS_DEFAULT_LOG_COLOR
#endif
#define EVAS_DEFAULT_LOG_COLOR "\033[36m"
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_evas_log_dom_module, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_evas_log_dom_module, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_evas_log_dom_module, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_evas_log_dom_module, __VA_ARGS__)
#ifdef CRT
# undef CRT
#endif
#define CRT(...) EINA_LOG_DOM_CRIT(_evas_log_dom_module, __VA_ARGS__)
/* evas_outbuf.c */

View File

@ -160,16 +160,16 @@ evas_software_ddraw_outbuf_setup(int width,
if (!conv_func)
{
ERROR("DDraw engine Error"
" {"
" At depth %i:"
" RGB format mask: %08x, %08x, %08x"
" Not supported by and compiled in converters!"
" }",
buf->priv.dd.depth,
buf->priv.mask.r,
buf->priv.mask.g,
buf->priv.mask.b);
ERR("DDraw engine Error"
" {"
" At depth %i:"
" RGB format mask: %08x, %08x, %08x"
" Not supported by and compiled in converters!"
" }",
buf->priv.dd.depth,
buf->priv.mask.r,
buf->priv.mask.g,
buf->priv.mask.b);
}
}
}