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

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

Issue 2121293004: Reland of Fix initialization ordering in GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | gpu/command_buffer/tests/gl_manager.h » ('j') | 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 6212d7fdbf357d1b22988ba6f48f4a8e4a55700b..e9aec35e7c55f2bcb144750e7013533fb6949897 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2951,6 +2951,23 @@
lose_context_when_out_of_memory_ =
attrib_helper.lose_context_when_out_of_memory;
+ // If the failIfMajorPerformanceCaveat context creation attribute was true
+ // and we are using a software renderer, fail.
+ if (attrib_helper.fail_if_major_perf_caveat &&
+ feature_info_->feature_flags().is_swiftshader) {
+ group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
+ Destroy(true);
+ return false;
+ }
+
+ if (!group_->Initialize(this, attrib_helper.context_type,
+ disallowed_features)) {
+ group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
+ Destroy(true);
+ return false;
+ }
+ CHECK_GL_ERROR();
+
should_use_native_gmb_for_backbuffer_ =
attrib_helper.should_use_native_gmb_for_backbuffer;
if (should_use_native_gmb_for_backbuffer_) {
@@ -2970,28 +2987,10 @@
}
if (!supported) {
- group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
Destroy(true);
return false;
}
}
-
- // If the failIfMajorPerformanceCaveat context creation attribute was true
- // and we are using a software renderer, fail.
- if (attrib_helper.fail_if_major_perf_caveat &&
- feature_info_->feature_flags().is_swiftshader) {
- group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
- Destroy(true);
- return false;
- }
-
- if (!group_->Initialize(this, attrib_helper.context_type,
- disallowed_features)) {
- group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
- Destroy(true);
- return false;
- }
- CHECK_GL_ERROR();
bool needs_emulation = feature_info_->gl_version_info().IsLowerThanGL(4, 2);
transform_feedback_manager_.reset(new TransformFeedbackManager(
« no previous file with comments | « no previous file | gpu/command_buffer/tests/gl_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698