jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=93797e3b0d30b02004da33f5fa350a4d64568e9b

commit 93797e3b0d30b02004da33f5fa350a4d64568e9b
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Wed Jun 3 19:59:11 2015 +0900

    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 :)
---
 src/lib/evas/canvas/evas_main.c            |  7 +++++++
 src/lib/evas/filters/evas_filter.c         | 25 +++++++++++++++++++++++--
 src/lib/evas/filters/evas_filter_blur.c    |  6 +++---
 src/lib/evas/filters/evas_filter_bump.c    |  5 ++---
 src/lib/evas/filters/evas_filter_parser.c  |  3 ++-
 src/lib/evas/filters/evas_filter_private.h | 25 +++++++++++++++++++++++++
 src/lib/evas/include/evas_private.h        |  4 ++++
 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)
    }
 #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();
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 @@
  */
 
 #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;
+}
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 @@
-#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)
 {
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 @@
 /* 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
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 @@
-#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
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 @@
 #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
 
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);
 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);

-- 


Reply via email to