X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fdebug.cpp;h=84c9cdfc53d35eb1c34cc068151963037611509a;hb=a770afdd3196e242b4938dfb2cbec3b5666593b2;hp=11b5c35d4bc9367e62a5da6e34652e4a64369ca5;hpb=7e60452c921e21e7938ccfc1da857616ce2944c1;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/integration-api/debug.cpp b/dali/integration-api/debug.cpp index 11b5c35..84c9cdf 100644 --- a/dali/integration-api/debug.cpp +++ b/dali/integration-api/debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,39 +53,6 @@ namespace // unnamed namespace const uint64_t NANOSECONDS_PER_SECOND = 1e+9; -/** - * Generic function to print out any 2-Dimensional array - * @param[in] data pointer to the source data stored as float[rows][cols] - * @param[in] rows number of rows in 2D array - * @param[in] cols number of columns in 2D array - * @param[in] precision - the precision to write the float data. - * @param[in] indent - the indent level to use. - * @return string - the text representation of the 2D array - */ -std::string Array2DToString(const float *data, unsigned int rows, unsigned int cols, size_t precision, size_t indent) -{ - std::ostringstream oss; - - std::ios_base::fmtflags mask = oss.flags(); - mask &= ~std::ios_base::scientific; - mask |= std::ios_base::fixed; - - for(unsigned int rowIdx = 0; rowIdx < rows; rowIdx++) - { - oss << std::setw(indent) << std::setfill(' ') << ' ' << "[ "; - oss << std::setfill(' ') << std::setprecision(precision) << std::right << std::setiosflags(mask); - - for(unsigned int colIdx = 0; colIdx < cols; colIdx++) - { - oss << std::setw(precision + 6) << (*data++) << ' '; - } - - oss << ']' << std::endl; - } - - return oss.str(); -} - } namespace Integration @@ -94,7 +61,7 @@ namespace Integration namespace Log { -thread_local LogFunction gthreadLocalLogFunction = NULL; +thread_local LogFunction gthreadLocalLogFunction = nullptr; /* Forward declarations */ std::string FormatToString(const char *format, ...); @@ -125,7 +92,7 @@ void InstallLogFunction(const LogFunction& logFunction) void UninstallLogFunction() { - gthreadLocalLogFunction = NULL; + gthreadLocalLogFunction = nullptr; } #ifdef DEBUG_ENABLED @@ -134,11 +101,11 @@ void UninstallLogFunction() Filter* Filter::gRender = Filter::New(Debug::Concise, false, "LOG_RENDER"); Filter* Filter::gResource = Filter::New(Debug::Concise, false, "LOG_RESOURCE"); Filter* Filter::gGLResource = Filter::New(Debug::Concise, false, "LOG_GL_RESOURCE"); -Filter* Filter::gObject = NULL; +Filter* Filter::gObject = nullptr; Filter* Filter::gImage = Filter::New(Debug::Concise, false, "LOG_IMAGE"); Filter* Filter::gModel = Filter::New(Debug::Concise, false, "LOG_MODEL"); -Filter* Filter::gNode = NULL; -Filter* Filter::gElement = NULL; +Filter* Filter::gNode = nullptr; +Filter* Filter::gElement = nullptr; Filter* Filter::gActor = Filter::New(Debug::Concise, false, "LOG_ACTOR"); Filter* Filter::gShader = Filter::New(Debug::Concise, false, "LOG_SHADER"); @@ -212,7 +179,7 @@ void Filter::Log(LogLevel level, const char* format, ...) if( mTraceEnabled ) { - char *buffer = NULL; + char *buffer = nullptr; int numChars = asprintf( &buffer, " %-*c %s", mNesting, ':', format ); if( numChars >= 0 ) // No error { @@ -259,7 +226,6 @@ TraceObj::~TraceObj() #endif // DEBUG_ENABLED - std::string ArgListToString(const char *format, va_list args) { std::string str; // empty string @@ -285,58 +251,6 @@ std::string FormatToString(const char *format, ...) return s; } -std::string ColorToString(const Vector4& color) -{ - std::ostringstream oss; - oss << ""; - return oss.str(); -} - -std::string Vector4ToString(const Vector4& v, size_t precision, size_t indent) -{ - std::ostringstream oss; - oss << std::setw(indent+3) << std::setfill(' ') << std::setprecision(precision) << std::right; - oss << ""; - return oss.str(); -} - -std::string Vector3ToString(const Vector3& v, size_t precision, size_t indent) -{ - std::ostringstream oss; - oss << std::setw(indent+3) << std::setfill(' ') << std::setprecision(precision) << std::right << std::setiosflags(std::ios_base::fixed); - oss << ""; - return oss.str(); -} - -std::string QuaternionToString(const Quaternion& q, size_t precision, size_t indent) -{ - std::ostringstream oss; - - Vector3 axis; - Radian angle; - q.ToAxisAngle(axis, angle); - - oss << std::setw(indent+3) << std::setfill(' ') << std::setprecision(precision) << std::right; - oss << ""; - - return oss.str(); -} - -std::string Matrix3ToString(const Matrix3& m, size_t precision, size_t indent) -{ - return Array2DToString(m.AsFloat(), 3, 3, precision, indent); -} - -std::string MatrixToString(const Matrix& m, size_t precision, size_t indent) -{ - return Array2DToString(m.AsFloat(), 4, 4, precision, indent); -} - void GetNanoseconds( uint64_t& timeInNanoseconds ) { timespec timeSpec;