summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/DrawFrameTask.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-04-08 15:09:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-04-08 15:09:42 +0000
commitc724dcf23c5e2ebd22c042a8a6f2424b7e9d5029 (patch)
tree011af96ab684103081b8729bf436b4c8725aa28c /libs/hwui/renderthread/DrawFrameTask.cpp
parent4a735441e82207e18036be09d0d02c855930938f (diff)
parent945961f78a78eced823d5ba78505c781b079703d (diff)
Merge "Make stopped state a first-class thing" into nyc-dev
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) {