From: Nick Holland Date: Mon, 27 Oct 2014 12:06:28 +0000 (+0000) Subject: Removed unnecessary use of osstream and ofstream X-Git-Tag: dali_1.0.16~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F29419%2F3;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Removed unnecessary use of osstream and ofstream saves 1KB from dali-adaptor library on ARM Change-Id: I07677bbaee9c7a7075818c5297074bfdffb06770 --- diff --git a/adaptors/base/update-thread.cpp b/adaptors/base/update-thread.cpp index 725f64e..40c8eaf 100644 --- a/adaptors/base/update-thread.cpp +++ b/adaptors/base/update-thread.cpp @@ -19,9 +19,6 @@ #include "update-thread.h" // EXTERNAL INCLUDES -#include -#include -#include #include // INTERNAL INCLUDES @@ -41,6 +38,7 @@ namespace Adaptor namespace { +const char* DALI_TEMP_UPDATE_FPS_FILE( "/tmp/dalifps.txt" ); const unsigned int MICROSECONDS_PER_MILLISECOND( 1000 ); #if defined(DEBUG_ENABLED) @@ -218,78 +216,90 @@ void UpdateThread::OutputFPSRecord() { DALI_LOG_FPS("fps( %d ):%f\n",i ,mFpsRecord[i]); } - std::ofstream outFile("/tmp/dalifps.txt"); - if(outFile.is_open()) + + // Dumps out the DALI_FPS_TRACKING worth of frame rates. + // E.g. if we run: DALI_FPS_TRACKING=30 dali-demo + // it will dump out the first 30 seconds of FPS information to a temp file + FILE* outfile = fopen( DALI_TEMP_UPDATE_FPS_FILE, "w"); + if( outfile ) { for(unsigned int i = 0; i < mElapsedSeconds; i++) { - outFile << mFpsRecord[i]< "; + oss += " "; } if ( keepUpdatingStatus & Integration::KeepUpdating::INCOMING_MESSAGES ) { - oss << " "; + oss += " "; } if ( keepUpdatingStatus & Integration::KeepUpdating::ANIMATIONS_RUNNING ) { - oss << " "; + oss += " "; } if ( keepUpdatingStatus & Integration::KeepUpdating::DYNAMICS_CHANGED ) { - oss << " "; + oss += " "; } if ( keepUpdatingStatus & Integration::KeepUpdating::LOADING_RESOURCES ) { - oss << " "; + oss += " "; } if ( keepUpdatingStatus & Integration::KeepUpdating::NOTIFICATIONS_PENDING ) { - oss << " "; + oss += " "; } if ( keepUpdatingStatus & Integration::KeepUpdating::MONITORING_PERFORMANCE ) { - oss << " "; + oss += " "; } if ( keepUpdatingStatus & Integration::KeepUpdating::RENDER_TASK_SYNC ) { - oss << " "; + oss += " "; } if ( renderNeedsUpdate ) { - oss << " "; + oss += " "; } - DALI_LOG_UPDATE_STATUS( "%s\n", oss.str().c_str() ); + DALI_LOG_UPDATE_STATUS( "%s\n", oss.c_str()); } }