Mark GrContext dirty after onContextDestroyed

Bug: 120997728
Test: hwui_unit_test passes
Change-Id: I8b60c45ebf7904b7026b480541dac78b70a59e0d
This commit is contained in:
Bo Liu
2019-01-03 16:36:24 -08:00
parent 25edac0f17
commit 1b0278c19e
2 changed files with 6 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
#include <private/hwui/WebViewFunctor.h>
#include "Properties.h"
#include "renderthread/RenderThread.h"
#include <log/log.h>
#include <utils/Trace.h>
@@ -90,6 +91,10 @@ void WebViewFunctor::destroyContext() {
mHasContext = false;
ATRACE_NAME("WebViewFunctor::onContextDestroyed");
mCallbacks.onContextDestroyed(mFunctor, mData);
// grContext may be null in unit tests.
auto* grContext = renderthread::RenderThread::getInstance().getGrContext();
if (grContext) grContext->resetContext();
}
}