summaryrefslogtreecommitdiffstats
path: root/libs/rs
diff options
context:
space:
mode:
authorWeiming Zhao <weimingz@codeaurora.org>2012-02-24 12:58:47 -0800
committerGiulio Cervera <giulio.cervera@gmail.com>2012-03-23 22:25:41 +0100
commita335541cde59e452441956f8ebb19e03727d5640 (patch)
tree969e11d4fd26fc679f6e1881e86a2bb045d39c3a /libs/rs
parent481e26b2e85adb97b10f6a907f19363c4bdb5e2f (diff)
downloadframeworks_base-a335541cde59e452441956f8ebb19e03727d5640.zip
frameworks_base-a335541cde59e452441956f8ebb19e03727d5640.tar.gz
frameworks_base-a335541cde59e452441956f8ebb19e03727d5640.tar.bz2
libRS: Correct the screen freezing issue
This fixes a timing issue where it could calculate a delay of 0 (indicating wait forever) when it has no pending commands to actually execute. In such cases, it should just break out of the playback loop. This also fixes a small issue with returning whether or not to redraw. (Provided by Stephen Hines <srhines@google.com>) CRs-Fixed: 330352 Change-Id: If3c880e1546105279d286ae76cc41e8b8f193ec1
Diffstat (limited to 'libs/rs')
-rw-r--r--libs/rs/rsThreadIO.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/rs/rsThreadIO.cpp b/libs/rs/rsThreadIO.cpp
index b1a579a..ab3efca 100644
--- a/libs/rs/rsThreadIO.cpp
+++ b/libs/rs/rsThreadIO.cpp
@@ -124,7 +124,6 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand, uint64_t time
while (!mToCore.isEmpty() || waitForCommand) {
uint32_t cmdID = 0;
uint32_t cmdSize = 0;
- ret = true;
if (con->props.mLogTimes) {
con->timerSet(Context::RS_TIMER_IDLE);
}
@@ -136,11 +135,17 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand, uint64_t time
delay = 0;
}
}
+
+ if (delay == 0 && timeToWait != 0 && mToCore.isEmpty()) {
+ break;
+ }
+
const void * data = mToCore.get(&cmdID, &cmdSize, delay);
if (!cmdSize) {
// exception or timeout occurred.
- return false;
+ break;
}
+ ret = true;
if (con->props.mLogTimes) {
con->timerSet(Context::RS_TIMER_INTERNAL);
}