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

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

Issue 1110423002: Fix crash when rotating screen after resume (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 0886768193444d6e61c7467c5ef30e28aeaf85a6..58aca229ecc49fdc7063d5ee03a71d9573eec36e 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3628,6 +3628,13 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
DCHECK(!have_context || context_->IsCurrent(NULL));
+ if (vertex_array_manager_ .get()) {
+ // Destroy needs to be called before the VertexAttribManagers are destroyed
+ // so that they know the context is no longer available and do not attempts
+ // to call gl* functions.
+ vertex_array_manager_->Destroy(have_context);
+ }
+
// Unbind everything.
state_.vertex_attrib_manager = NULL;
state_.default_vertex_attrib_manager = NULL;
@@ -3727,7 +3734,6 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
}
if (vertex_array_manager_ .get()) {
- vertex_array_manager_->Destroy(have_context);
vertex_array_manager_.reset();
}
@@ -3952,7 +3958,6 @@ error::Error GLES2DecoderImpl::HandleResizeCHROMIUM(uint32 immediate_data_size,
if (!resize_callback_.is_null()) {
resize_callback_.Run(gfx::Size(width, height), scale_factor);
- DCHECK(context_->IsCurrent(surface_.get()));
if (!context_->IsCurrent(surface_.get())) {
LOG(ERROR) << "GLES2DecoderImpl: Context lost because context no longer "
<< "current after resize callback.";
« 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