Commit f5d56799 by Peng Huang Committed by Commit Bot

Do not make context current during context deletion.

ANGLE will make a context current during deletion, so ANGLE can release related resources, but for an external context, the API user should make sure the native context is current during deleting the ANGLE external context, so ANGLE doesn't need to make the context current. Bug: angleproject:5509 Change-Id: Ia4cee4e3965e9e9e811e3f989f6f6d72bd940f41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2640593 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 203154b5
...@@ -1437,6 +1437,14 @@ Error Display::destroyContext(const Thread *thread, gl::Context *context) ...@@ -1437,6 +1437,14 @@ Error Display::destroyContext(const Thread *thread, gl::Context *context)
Surface *currentReadSurface = thread->getCurrentReadSurface(); Surface *currentReadSurface = thread->getCurrentReadSurface();
bool changeContextForDeletion = context != currentContext; bool changeContextForDeletion = context != currentContext;
// For external context, we cannot change the current native context, and the API user should
// make sure the native context is current.
if (changeContextForDeletion && context->isExternal())
{
ASSERT(!currentContext);
changeContextForDeletion = false;
}
// Make the context being deleted current during its deletion. This allows it to delete // Make the context being deleted current during its deletion. This allows it to delete
// any resources it's holding. // any resources it's holding.
if (changeContextForDeletion) if (changeContextForDeletion)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment