From 8ca3eecc2b7fe507d3482745efc4cd2567ad15a1 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 10 Apr 2014 10:28:45 -0700 Subject: Remove sync flush Bug: 13952590 It was attempting to flush state changes after the canvas was destroyed, which caused layer updates to crash. Due to the removal of SetDisplayListData, the sync mode isn't able to do anything ever, so remove it. Change-Id: I1e18ce288d81fd47cc6e612afda9476f75ecef2e --- libs/hwui/renderthread/DrawFrameTask.cpp | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'libs/hwui/renderthread/DrawFrameTask.cpp') diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp index 372d0d0..cf6c8db 100644 --- a/libs/hwui/renderthread/DrawFrameTask.cpp +++ b/libs/hwui/renderthread/DrawFrameTask.cpp @@ -30,7 +30,7 @@ namespace android { namespace uirenderer { namespace renderthread { -DrawFrameTask::DrawFrameTask() : mContext(0), mTaskMode(MODE_INVALID), mRenderNode(0) { +DrawFrameTask::DrawFrameTask() : mContext(0), mRenderNode(0) { } DrawFrameTask::~DrawFrameTask() { @@ -69,23 +69,14 @@ void DrawFrameTask::drawFrame(RenderThread* renderThread) { LOG_ALWAYS_FATAL_IF(!mRenderNode.get(), "Cannot drawFrame with no render node!"); LOG_ALWAYS_FATAL_IF(!mContext, "Cannot drawFrame with no CanvasContext!"); - postAndWait(renderThread, MODE_FULL); + postAndWait(renderThread); // Reset the single-frame data mDirty.setEmpty(); mRenderNode = 0; } -void DrawFrameTask::flushStateChanges(RenderThread* renderThread) { - LOG_ALWAYS_FATAL_IF(!mContext, "Cannot drawFrame with no CanvasContext!"); - - postAndWait(renderThread, MODE_STATE_ONLY); -} - -void DrawFrameTask::postAndWait(RenderThread* renderThread, TaskMode mode) { - LOG_ALWAYS_FATAL_IF(mode == MODE_INVALID, "That's not a real mode, silly!"); - - mTaskMode = mode; +void DrawFrameTask::postAndWait(RenderThread* renderThread) { AutoMutex _lock(mLock); renderThread->queue(this); mSignal.wait(mLock); @@ -97,11 +88,6 @@ void DrawFrameTask::run() { // canUnblockUiThread is temporary until WebView has a solution for syncing frame state bool canUnblockUiThread = syncFrameState(); - if (mTaskMode == MODE_STATE_ONLY) { - unblockUiThread(); - return; - } - // Grab a copy of everything we need Rect dirtyCopy(mDirty); sp renderNode = mRenderNode; @@ -125,12 +111,9 @@ bool DrawFrameTask::syncFrameState() { bool hasFunctors = false; mContext->processLayerUpdates(&mLayers, &hasFunctors); - // If we don't have an mRenderNode this is a state flush only - if (mRenderNode.get()) { - TreeInfo info = {0}; - mRenderNode->prepareTree(info); - hasFunctors |= info.hasFunctors; - } + TreeInfo info = {0}; + mRenderNode->prepareTree(info); + hasFunctors |= info.hasFunctors; return !hasFunctors; } -- cgit v1.1