Merge "Fix a crash when grContext was deleted"
This commit is contained in:
committed by
Android (Google) Code Review
commit
c9f8854482
@@ -356,14 +356,21 @@ void RenderProxy::disableVsync() {
|
||||
void RenderProxy::repackVectorDrawableAtlas() {
|
||||
RenderThread& thread = RenderThread::getInstance();
|
||||
thread.queue().post([&thread]() {
|
||||
thread.cacheManager().acquireVectorDrawableAtlas()->repackIfNeeded(thread.getGrContext());
|
||||
// The context may be null if trimMemory executed, but then the atlas was deleted too.
|
||||
if (thread.getGrContext() != nullptr) {
|
||||
thread.cacheManager().acquireVectorDrawableAtlas()->repackIfNeeded(
|
||||
thread.getGrContext());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void RenderProxy::releaseVDAtlasEntries() {
|
||||
RenderThread& thread = RenderThread::getInstance();
|
||||
thread.queue().post([&thread]() {
|
||||
thread.cacheManager().acquireVectorDrawableAtlas()->delayedReleaseEntries();
|
||||
// The context may be null if trimMemory executed, but then the atlas was deleted too.
|
||||
if (thread.getGrContext() != nullptr) {
|
||||
thread.cacheManager().acquireVectorDrawableAtlas()->delayedReleaseEntries();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user