summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/DrawFrameTask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/DrawFrameTask.cpp')
-rw-r--r--libs/hwui/renderthread/DrawFrameTask.cpp20
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() {