X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fdebug.h;h=8e5985980d76f4be3abb73340972cc86d2d74926;hb=8439ffd8417eed1c54c82b7f0eefed5eb2ed3382;hp=8b17e384c67f50585e28ea4f17aba0083acb277d;hpb=7e14935f42dc79f6b8239b0301078d004d3ebaba;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/integration-api/debug.h b/dali/integration-api/debug.h index 8b17e38..8e59859 100644 --- a/dali/integration-api/debug.h +++ b/dali/integration-api/debug.h @@ -22,6 +22,9 @@ #include #include #include +#include +#include +#include // INTERNAL INCLUDES #include @@ -40,6 +43,26 @@ class Matrix3; class Matrix; class Quaternion; +#if defined(DEBUG_ENABLED) + +// Less opaque types for debugger +typedef std::vector DebugPropertyValueArray; +typedef std::pair< Property::Index, Property::Value > DebugIndexValuePair; +typedef std::vector DebugStringValueContainer; +typedef std::vector< DebugIndexValuePair > DebugIndexValueContainer; + +struct DebugPropertyValueMap +{ + DebugStringValueContainer stringValues; + DebugIndexValueContainer intValues; +}; + +// Fake globals for gdb typedefs +extern Dali::DebugPropertyValueArray gValueArray; +extern Dali::DebugPropertyValueMap gValueMap; + +#endif + namespace Integration { namespace Log @@ -90,6 +113,8 @@ DALI_IMPORT_API void UninstallLogFunction(); #define DALI_LOG_ERROR_NOFN(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, format, ## args) +#define DALI_LOG_WARNING_NOFN(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, format, ## args) + /** * Provides unfiltered logging for fps monitor */ @@ -105,6 +130,11 @@ DALI_IMPORT_API void UninstallLogFunction(); */ #define DALI_LOG_RENDER_INFO(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## args) +/** + * Provides unfiltered logging for release + */ +#define DALI_LOG_RELEASE_INFO(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## args) + #ifdef DEBUG_ENABLED /** @@ -483,7 +513,33 @@ DALI_IMPORT_API std::string MatrixToString(const Matrix& m, size_t precision=3, #endif -}}} // Dali/Integration/Debug namespaces +/******************************************************************************** + * Time instrumentation * + ********************************************************************************/ + +#if defined(DEBUG_ENABLED) + +void GetNanoseconds( uint64_t& timeInNanoseconds ); + +#define DALI_LOG_TIMER_START( timeVariable ) \ + uint64_t timeVariable##1; \ + Debug::GetNanoseconds( timeVariable##1 ); + +#define DALI_LOG_TIMER_END( timeVariable, filter, level, preString) \ + uint64_t timeVariable##2; \ + Debug::GetNanoseconds( timeVariable##2 ); \ + DALI_LOG_INFO( filter, level, preString " %ld uSec\n", ((timeVariable##2-timeVariable##1)/1000)); + +#else // DEBUG_ENABLED + +#define DALI_LOG_TIMER_START( timeVariable ) +#define DALI_LOG_TIMER_END( timeVariable, filter, level, preString) + +#endif + +} // Debug +} // Integration +} // Dali #endif // __DALI_INTEGRATION_DEBUG_H__