summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/DrawFrameTask.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-04-13 10:24:06 -0700
committerJohn Reck <jreck@google.com>2016-04-14 10:39:03 -0700
commit8afcc76920499d0a384dba1470c5a377f80ed768 (patch)
treed6c10ca146b7b28daaf18544ed3d338b9ed08946 /libs/hwui/renderthread/DrawFrameTask.cpp
parent5352dda479452c248f87521d6c69c9dd8399ebb7 (diff)
Revert "Revert "Make stopped state a first-class thing""
This reverts commit eab3f2658aa41d37c3b05d49a2ce4e3f4ed85399. Fixes first-frame issue, mReportNextDraw needs to override mStopped Fixes: 28118961 Fixes: 27286867 Change-Id: I5c811759637d08ba9f3b342016d1b3006986d5a2
Diffstat (limited to 'libs/hwui/renderthread/DrawFrameTask.cpp')
-rw-r--r--libs/hwui/renderthread/DrawFrameTask.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp
index 651aaa23e341..ed472ac4bd02 100644
--- a/libs/hwui/renderthread/DrawFrameTask.cpp
+++ b/libs/hwui/renderthread/DrawFrameTask.cpp
@@ -115,7 +115,7 @@ bool DrawFrameTask::syncFrameState(TreeInfo& info) {
ATRACE_CALL();
int64_t vsync = mFrameInfo[static_cast<int>(FrameInfoIndex::Vsync)];
mRenderThread->timeLord().vsyncReceived(vsync);
- mContext->makeCurrent();
+ bool canDraw = mContext->makeCurrent();
Caches::getInstance().textureCache.resetMarkInUse(mContext);
for (size_t i = 0; i < mLayers.size(); i++) {
@@ -126,8 +126,9 @@ bool DrawFrameTask::syncFrameState(TreeInfo& info) {
// This is after the prepareTree so that any pending operations
// (RenderNode tree state, prefetched layers, etc...) will be flushed.
- if (CC_UNLIKELY(!mContext->hasSurface())) {
+ if (CC_UNLIKELY(!mContext->hasSurface() || !canDraw)) {
mSyncResult |= kSync_LostSurfaceRewardIfFound;
+ info.out.canDrawThisFrame = false;
}
if (info.out.hasAnimations) {