summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2014-02-06 21:17:32 +0100
committerVojtech Bocek <vbocek@gmail.com>2014-02-06 21:18:08 +0100
commite5ffcd1af2acb864d92560e740a66f4385c052db (patch)
treef63abadf725521f7157deebe83c365030b36ae27 /gui
parentMerge "Load RTC offset on Qualcomm Krait chips, fixes the broken time & date" into android-4.4 (diff)
downloadandroid_bootable_recovery-e5ffcd1af2acb864d92560e740a66f4385c052db.tar
android_bootable_recovery-e5ffcd1af2acb864d92560e740a66f4385c052db.tar.gz
android_bootable_recovery-e5ffcd1af2acb864d92560e740a66f4385c052db.tar.bz2
android_bootable_recovery-e5ffcd1af2acb864d92560e740a66f4385c052db.tar.lz
android_bootable_recovery-e5ffcd1af2acb864d92560e740a66f4385c052db.tar.xz
android_bootable_recovery-e5ffcd1af2acb864d92560e740a66f4385c052db.tar.zst
android_bootable_recovery-e5ffcd1af2acb864d92560e740a66f4385c052db.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/gui.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/gui/gui.cpp b/gui/gui.cpp
index e9efc1db9..adc8a412b 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -57,6 +57,9 @@ extern "C"
#include "blanktimer.hpp"
#endif
+// Enable to print render time of each frame to the log file
+//#define PRINT_RENDER_TIME 1
+
const static int CURTAIN_FADE = 32;
using namespace rapidxml;
@@ -423,6 +426,11 @@ static int runPages(void)
DataManager::SetValue("tw_loaded", 1);
+#ifdef PRINT_RENDER_TIME
+ timespec start, end;
+ int32_t render_t, flip_t;
+#endif
+
for (;;)
{
loopTimer();
@@ -432,11 +440,30 @@ static int runPages(void)
int ret;
ret = PageManager::Update();
+
+#ifndef PRINT_RENDER_TIME
if (ret > 1)
PageManager::Render();
if (ret > 0)
flip();
+#else
+ if (ret > 1)
+ {
+ clock_gettime(CLOCK_MONOTONIC, &start);
+ PageManager::Render();
+ clock_gettime(CLOCK_MONOTONIC, &end);
+ render_t = TWFunc::timespec_diff_ms(start, end);
+
+ flip();
+ clock_gettime(CLOCK_MONOTONIC, &start);
+ flip_t = TWFunc::timespec_diff_ms(end, start);
+
+ LOGINFO("Render(): %u ms, flip(): %u ms, total: %u ms\n", render_t, flip_t, render_t+flip_t);
+ }
+ else if(ret == 1)
+ flip();
+#endif
}
else
{