rlottie: enable conditional compilation of logging support.

This commit is contained in:
sub.mohanty@samsung.com 2019-03-29 20:19:40 +09:00 committed by Subhransu
parent 6dbb4afec9
commit f672dead57
3 changed files with 19 additions and 0 deletions

View File

@ -333,6 +333,9 @@ void Surface::setDrawRegion(size_t x, size_t y, size_t width, size_t height)
mDrawArea.w = width; mDrawArea.w = width;
mDrawArea.h = height; mDrawArea.h = height;
} }
#ifdef LOTTIE_LOGGING_SUPPORT
void initLogging() void initLogging()
{ {
#if defined(__ARM_NEON__) #if defined(__ARM_NEON__)
@ -344,3 +347,4 @@ void initLogging()
} }
V_CONSTRUCTOR_FUNCTION(initLogging) V_CONSTRUCTOR_FUNCTION(initLogging)
#endif

View File

@ -4,4 +4,7 @@
// enable threading // enable threading
#define LOTTIE_THREAD_SUPPORT #define LOTTIE_THREAD_SUPPORT
//enable logging
#define LOTTIE_LOGGING_SUPPORT
#endif // CONFIG_H #endif // CONFIG_H

View File

@ -17,6 +17,7 @@
*/ */
#include "vdebug.h" #include "vdebug.h"
#include "config.h"
#include <atomic> #include <atomic>
#include <chrono> #include <chrono>
#include <cstring> #include <cstring>
@ -737,8 +738,19 @@ void set_log_level(LogLevel level)
loglevel.store(static_cast<unsigned int>(level), std::memory_order_release); loglevel.store(static_cast<unsigned int>(level), std::memory_order_release);
} }
#ifdef LOTTIE_LOGGING_SUPPORT
bool is_logged(LogLevel level) bool is_logged(LogLevel level)
{ {
return static_cast<unsigned int>(level) >= return static_cast<unsigned int>(level) >=
loglevel.load(std::memory_order_relaxed); loglevel.load(std::memory_order_relaxed);
} }
#else
bool is_logged(LogLevel)
{
return false;
}
#endif