Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2103913002: Change destruction order of GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp73_backbuffer
Patch Set: Remove DCHECK. Causes WebGL2 failures. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index e1eea99544f79a8640fd96780d5741671a91c3a0..6394cde378d52f41e24e1ba5f7d646e93be180ee 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -4446,25 +4446,6 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
DCHECK(!have_context || context_->IsCurrent(nullptr));
- // Unbind everything.
- state_.vertex_attrib_manager = nullptr;
- state_.default_vertex_attrib_manager = nullptr;
- state_.texture_units.clear();
- state_.sampler_units.clear();
- state_.bound_array_buffer = nullptr;
- state_.bound_copy_read_buffer = nullptr;
- state_.bound_copy_write_buffer = nullptr;
- state_.bound_pixel_pack_buffer = nullptr;
- state_.bound_pixel_unpack_buffer = nullptr;
- state_.bound_transform_feedback_buffer = nullptr;
- state_.bound_uniform_buffer = nullptr;
- framebuffer_state_.bound_read_framebuffer = nullptr;
- framebuffer_state_.bound_draw_framebuffer = nullptr;
- state_.bound_renderbuffer = nullptr;
- state_.bound_transform_feedback = nullptr;
- state_.default_transform_feedback = nullptr;
- state_.indexed_uniform_buffer_bindings = nullptr;
-
ReleaseAllBackTextures(have_context);
if (have_context) {
if (apply_framebuffer_attachment_cmaa_intel_.get()) {
@@ -4545,6 +4526,25 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
}
deschedule_until_finished_fences_.clear();
+ // Unbind everything.
+ state_.vertex_attrib_manager = nullptr;
+ state_.default_vertex_attrib_manager = nullptr;
+ state_.texture_units.clear();
+ state_.sampler_units.clear();
+ state_.bound_array_buffer = nullptr;
+ state_.bound_copy_read_buffer = nullptr;
+ state_.bound_copy_write_buffer = nullptr;
+ state_.bound_pixel_pack_buffer = nullptr;
+ state_.bound_pixel_unpack_buffer = nullptr;
+ state_.bound_transform_feedback_buffer = nullptr;
+ state_.bound_uniform_buffer = nullptr;
+ framebuffer_state_.bound_read_framebuffer = nullptr;
+ framebuffer_state_.bound_draw_framebuffer = nullptr;
+ state_.bound_renderbuffer = nullptr;
+ state_.bound_transform_feedback = nullptr;
+ state_.default_transform_feedback = nullptr;
+ state_.indexed_uniform_buffer_bindings = nullptr;
+
// Current program must be cleared after calling ProgramManager::UnuseProgram.
// Otherwise, we can leak objects. http://crbug.com/258772.
// state_.current_program must be reset before group_ is reset because
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698