Commit a569f96f authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Logging to ensure that non-offscreen surfaces are destroyed as expected

We're hitting scenarios where it appears that we may be creating an
EGL window surface for a given window before destroying the previous.
This leads to errors on Android, and shouldn't be possible. We're
suspecting that someone may be taking a reference on the glSurface,
extending the lifetime beyond the expected range. This CL adds logging
to catch this scenario.

Bug: 787086
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I31bb0c55fb393a0719486f32f885273ee81ab9f8
Reviewed-on: https://chromium-review.googlesource.com/802186
Commit-Queue: Eric Karl <ericrk@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522293}
parent e1d7329e
......@@ -5019,6 +5019,9 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
transform_feedback_manager_.reset();
}
// Record this value before resetting the frame buffer below.
bool is_offscreen = !!offscreen_target_frame_buffer_;
offscreen_target_frame_buffer_.reset();
offscreen_target_color_texture_.reset();
offscreen_target_color_render_buffer_.reset();
......@@ -5048,6 +5051,13 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
group_ = NULL;
}
// If this is not an offscreen surface then it shouldn't be shared and we
// should have the only remaining ref. Logging to debug crbug.com/787086
if (!is_offscreen && surface_ && !surface_->HasOneRef()) {
LOG(ERROR) << "crbug.com/787086: Decoder is not the sole owner of "
"|surface_| at destruction time";
}
// Destroy the surface before the context, some surface destructors make GL
// calls.
surface_ = nullptr;
......
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