From f672dead5755471b18f9ffb6e6913f45d8b42523 Mon Sep 17 00:00:00 2001 From: "sub.mohanty@samsung.com" Date: Fri, 29 Mar 2019 20:19:40 +0900 Subject: [PATCH] rlottie: enable conditional compilation of logging support. --- src/lottie/lottieanimation.cpp | 4 ++++ src/vector/config.h | 3 +++ src/vector/vdebug.cpp | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/lottie/lottieanimation.cpp b/src/lottie/lottieanimation.cpp index 55b8b51dc3..98dd3dd7ec 100644 --- a/src/lottie/lottieanimation.cpp +++ b/src/lottie/lottieanimation.cpp @@ -333,6 +333,9 @@ void Surface::setDrawRegion(size_t x, size_t y, size_t width, size_t height) mDrawArea.w = width; mDrawArea.h = height; } + + +#ifdef LOTTIE_LOGGING_SUPPORT void initLogging() { #if defined(__ARM_NEON__) @@ -344,3 +347,4 @@ void initLogging() } V_CONSTRUCTOR_FUNCTION(initLogging) +#endif diff --git a/src/vector/config.h b/src/vector/config.h index bcf557337f..c23cdb91fc 100644 --- a/src/vector/config.h +++ b/src/vector/config.h @@ -4,4 +4,7 @@ // enable threading #define LOTTIE_THREAD_SUPPORT +//enable logging +#define LOTTIE_LOGGING_SUPPORT + #endif // CONFIG_H diff --git a/src/vector/vdebug.cpp b/src/vector/vdebug.cpp index bd7a3210ba..7002bd0412 100644 --- a/src/vector/vdebug.cpp +++ b/src/vector/vdebug.cpp @@ -17,6 +17,7 @@ */ #include "vdebug.h" +#include "config.h" #include #include #include @@ -737,8 +738,19 @@ void set_log_level(LogLevel level) loglevel.store(static_cast(level), std::memory_order_release); } +#ifdef LOTTIE_LOGGING_SUPPORT + bool is_logged(LogLevel level) { return static_cast(level) >= loglevel.load(std::memory_order_relaxed); } + +#else + +bool is_logged(LogLevel) +{ + return false; +} + +#endif