Skip to content

Commit

Permalink
Avoid trying to disconnect twice with ANGLE
Browse files Browse the repository at this point in the history
The Vulkan runtime makes all the native_window_* calls
when running with ANGLE.

Noticed while debugging b/184280023.

Bug: b/154237217
Test: MixedDeviceOwnerTest on Cuttlefish w/ SwANGLE
Change-Id: Ie7c5ebcedf6eb0c23fdd1223c0ef866d4a2d9944
  • Loading branch information
jmacnak committed Jun 15, 2021
1 parent 2c34aa6 commit 26c6f83
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions opengl/libs/EGL/egl_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ egl_surface_t::~egl_surface_t() {

void egl_surface_t::disconnect() {
if (win != nullptr && connected) {
native_window_set_buffers_format(win, 0);
if (native_window_api_disconnect(win, NATIVE_WINDOW_API_EGL)) {
ALOGW("EGLNativeWindowType %p disconnect failed", win);
// NOTE: When using Vulkan backend, the Vulkan runtime makes all the
// native_window_* calls, so don't do them here.
if (!cnx->useAngle) {
native_window_set_buffers_format(win, 0);
if (native_window_api_disconnect(win, NATIVE_WINDOW_API_EGL)) {
ALOGW("EGLNativeWindowType %p disconnect failed", win);
}
}
connected = false;
}
Expand Down

0 comments on commit 26c6f83

Please sign in to comment.