From 860d155f866cc15a725e7ce03763280987f24901 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 11 Apr 2014 19:15:05 -0700 Subject: Fix issue with bitmap uploading Bug: 13912749 Change-Id: Ic23fa1d280118dc93dc2716a4a24cc0bbbdca595 --- libs/hwui/renderthread/DrawFrameTask.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'libs/hwui/renderthread/DrawFrameTask.cpp') diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp index cf6c8db..f542d43 100644 --- a/libs/hwui/renderthread/DrawFrameTask.cpp +++ b/libs/hwui/renderthread/DrawFrameTask.cpp @@ -85,7 +85,6 @@ void DrawFrameTask::postAndWait(RenderThread* renderThread) { void DrawFrameTask::run() { ATRACE_NAME("DrawFrame"); - // canUnblockUiThread is temporary until WebView has a solution for syncing frame state bool canUnblockUiThread = syncFrameState(); // Grab a copy of everything we need @@ -105,17 +104,20 @@ void DrawFrameTask::run() { } } +static void prepareTreeInfo(TreeInfo& info) { + info.prepareTextures = true; +} + bool DrawFrameTask::syncFrameState() { ATRACE_CALL(); - - bool hasFunctors = false; - mContext->processLayerUpdates(&mLayers, &hasFunctors); - - TreeInfo info = {0}; + mContext->makeCurrent(); + Caches::getInstance().textureCache.resetMarkInUse(); + TreeInfo info; + prepareTreeInfo(info); + mContext->processLayerUpdates(&mLayers, info); mRenderNode->prepareTree(info); - hasFunctors |= info.hasFunctors; - - return !hasFunctors; + // If prepareTextures is false, we ran out of texture cache space + return !info.hasFunctors && info.prepareTextures; } void DrawFrameTask::unblockUiThread() { -- cgit v1.1