diff options
author | John Reck <jreck@google.com> | 2014-04-11 19:15:05 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-04-14 13:17:25 -0700 |
commit | 860d155f866cc15a725e7ce03763280987f24901 (patch) | |
tree | 1ade6b4f5c2c0910c088469b95255eb66ce0cb53 /libs/hwui/renderthread/DrawFrameTask.cpp | |
parent | db8b130a19484cb6018667905e64d42ab793654f (diff) |
Fix issue with bitmap uploading
Bug: 13912749
Change-Id: Ic23fa1d280118dc93dc2716a4a24cc0bbbdca595
Diffstat (limited to 'libs/hwui/renderthread/DrawFrameTask.cpp')
-rw-r--r-- | libs/hwui/renderthread/DrawFrameTask.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp index cf6c8db9889a..f542d4396cfe 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() { |