From 35bc05f94b555275746b17836b642b86fbd7805a Mon Sep 17 00:00:00 2001 From: Nick Holland Date: Mon, 27 Oct 2014 12:06:28 +0000 Subject: [PATCH] Removed unnecessary use of osstream and ofstream saves 1KB from dali-adaptor library on ARM Change-Id: I07677bbaee9c7a7075818c5297074bfdffb06770 --- adaptors/base/update-thread.cpp | 50 ++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 20 deletions(-) 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()); } } -- 2.7.4