summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-06-03 19:59:11 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-25 14:36:08 +0900
commit93797e3b0d30b02004da33f5fa350a4d64568e9b (patch)
tree5207aab7d8e8e396dd0d7acc853712066212b245 /src
parent225c0f937a3a5c40aaf9cb39ba73bfa65dd32d64 (diff)
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 :)
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_main.c7
-rw-r--r--src/lib/evas/filters/evas_filter.c25
-rw-r--r--src/lib/evas/filters/evas_filter_blur.c6
-rw-r--r--src/lib/evas/filters/evas_filter_bump.c5
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c3
-rw-r--r--src/lib/evas/filters/evas_filter_private.h25
-rw-r--r--src/lib/evas/include/evas_private.h4
7 files changed, 66 insertions, 9 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 1935d40..cdbbde8 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -62,6 +62,7 @@ evas_init(void)
62 } 62 }
63#endif 63#endif
64 _evas_preload_thread_init(); 64 _evas_preload_thread_init();
65 evas_filter_init();
65 66
66 evas_thread_init(); 67 evas_thread_init();
67 68
@@ -119,6 +120,12 @@ evas_shutdown(void)
119 evas_object_image_load_opts_cow = NULL; 120 evas_object_image_load_opts_cow = NULL;
120 evas_object_image_state_cow = NULL; 121 evas_object_image_state_cow = NULL;
121 122
123 evas_filter_shutdown();
124 eina_cow_del(evas_object_filter_cow);
125 eina_cow_del(evas_object_mask_cow);
126 evas_object_filter_cow = NULL;
127 evas_object_mask_cow = NULL;
128
122 evas_thread_shutdown(); 129 evas_thread_shutdown();
123 _evas_preload_thread_shutdown(); 130 _evas_preload_thread_shutdown();
124 evas_async_events_shutdown(); 131 evas_async_events_shutdown();
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index dd9fdc5..1e369f0 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -15,13 +15,13 @@
15 */ 15 */
16 16
17#include "evas_filter.h" 17#include "evas_filter.h"
18#include "evas_private.h"
19#include "evas_filter_private.h"
20 18
21#ifdef EVAS_CSERVE2 19#ifdef EVAS_CSERVE2
22# include "evas_cs2_private.h" 20# include "evas_cs2_private.h"
23#endif 21#endif
24 22
23#include "evas_filter_private.h"
24
25#define _assert(a) if (!(a)) CRI("Failed on %s", #a); 25#define _assert(a) if (!(a)) CRI("Failed on %s", #a);
26 26
27static void _buffer_free(Evas_Filter_Buffer *fb); 27static void _buffer_free(Evas_Filter_Buffer *fb);
@@ -1984,3 +1984,24 @@ evas_filter_run(Evas_Filter_Context *ctx)
1984 ctx->post_run.cb(ctx, ctx->post_run.data, ret); 1984 ctx->post_run.cb(ctx, ctx->post_run.data, ret);
1985 return ret; 1985 return ret;
1986} 1986}
1987
1988
1989/* Logging */
1990
1991static int init_cnt = 0;
1992int _evas_filter_log_dom = 0;
1993
1994void
1995evas_filter_init()
1996{
1997 if ((init_cnt++) > 0) return;
1998 _evas_filter_log_dom = eina_log_domain_register("evas_filter", EVAS_FILTER_LOG_COLOR);
1999}
2000
2001void
2002evas_filter_shutdown()
2003{
2004 if ((--init_cnt) > 0) return;
2005 eina_log_domain_unregister(_evas_filter_log_dom);
2006 _evas_filter_log_dom = 0;
2007}
diff --git a/src/lib/evas/filters/evas_filter_blur.c b/src/lib/evas/filters/evas_filter_blur.c
index 7af357f..06fb31e 100644
--- a/src/lib/evas/filters/evas_filter_blur.c
+++ b/src/lib/evas/filters/evas_filter_blur.c
@@ -1,9 +1,9 @@
1#include "evas_filter.h"
2#include "evas_filter_private.h"
3
4#include <math.h> 1#include <math.h>
5#include <time.h> 2#include <time.h>
6 3
4#include "evas_filter.h"
5#include "evas_filter_private.h"
6
7static int 7static int
8_box_blur_auto_radius(int *radii, int r) 8_box_blur_auto_radius(int *radii, int r)
9{ 9{
diff --git a/src/lib/evas/filters/evas_filter_bump.c b/src/lib/evas/filters/evas_filter_bump.c
index 2d42e6e..60a9798 100644
--- a/src/lib/evas/filters/evas_filter_bump.c
+++ b/src/lib/evas/filters/evas_filter_bump.c
@@ -1,10 +1,9 @@
1/* Simple bump map algorithms for the software engine */ 1/* Simple bump map algorithms for the software engine */
2 2
3#include "evas_filter_private.h"
4#include "evas_blend_private.h"
5
6#include <math.h> 3#include <math.h>
7 4
5#include "evas_filter_private.h"
6#include "evas_blend_private.h"
8 7
9#ifdef CLAMP 8#ifdef CLAMP
10# undef CLAMP 9# undef CLAMP
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 294cd1e..c5f409d 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -1,10 +1,11 @@
1#include "evas_filter_private.h"
2#include <stdarg.h> 1#include <stdarg.h>
3 2
4#include <lua.h> 3#include <lua.h>
5#include <lualib.h> 4#include <lualib.h>
6#include <lauxlib.h> 5#include <lauxlib.h>
7 6
7#include "evas_filter_private.h"
8
8#if LUA_VERSION_NUM == 502 9#if LUA_VERSION_NUM == 502
9# define LUA52 1 10# define LUA52 1
10#endif 11#endif
diff --git a/src/lib/evas/filters/evas_filter_private.h b/src/lib/evas/filters/evas_filter_private.h
index 9e49aa2..002b2da 100644
--- a/src/lib/evas/filters/evas_filter_private.h
+++ b/src/lib/evas/filters/evas_filter_private.h
@@ -4,6 +4,31 @@
4#include "evas_filter.h" 4#include "evas_filter.h"
5#include "evas_private.h" 5#include "evas_private.h"
6 6
7/* logging variables */
8extern int _evas_filter_log_dom;
9#define EVAS_FILTER_LOG_COLOR EINA_COLOR_LIGHTBLUE
10
11#ifdef ERR
12# undef ERR
13#endif
14#define ERR(...) EINA_LOG_DOM_ERR(_evas_filter_log_dom, __VA_ARGS__)
15#ifdef INF
16# undef INF
17#endif
18#define INF(...) EINA_LOG_DOM_INFO(_evas_filter_log_dom, __VA_ARGS__)
19#ifdef WRN
20# undef WRN
21#endif
22#define WRN(...) EINA_LOG_DOM_WARN(_evas_filter_log_dom, __VA_ARGS__)
23#ifdef CRI
24# undef CRI
25#endif
26#define CRI(...) EINA_LOG_DOM_CRIT(_evas_filter_log_dom, __VA_ARGS__)
27#ifdef DBG
28# undef DBG
29#endif
30#define DBG(...) EINA_LOG_DOM_DBG(_evas_filter_log_dom, __VA_ARGS__)
31
7// This is a potential optimization. 32// This is a potential optimization.
8#define DIV_USING_BITSHIFT 1 33#define DIV_USING_BITSHIFT 1
9 34
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 474e3ca..163ed0e 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1771,6 +1771,10 @@ void _evas_canvas3d_eet_file_init(void);
1771void _evas_canvas3d_eet_descriptor_shutdown(void); 1771void _evas_canvas3d_eet_descriptor_shutdown(void);
1772void _evas_canvas3d_eet_file_free(void); 1772void _evas_canvas3d_eet_file_free(void);
1773 1773
1774/* Filters */
1775void evas_filter_init(void);
1776void evas_filter_shutdown(void);
1777
1774/* Temporary save/load functions */ 1778/* Temporary save/load functions */
1775void evas_common_load_model_from_file(Evas_Canvas3D_Mesh *model, const char *file); 1779void evas_common_load_model_from_file(Evas_Canvas3D_Mesh *model, const char *file);
1776void evas_common_load_model_from_eina_file(Evas_Canvas3D_Mesh *model, const Eina_File *file); 1780void evas_common_load_model_from_eina_file(Evas_Canvas3D_Mesh *model, const Eina_File *file);