Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2995 | 2995 |
| 2996 // If the failIfMajorPerformanceCaveat context creation attribute was true | 2996 // If the failIfMajorPerformanceCaveat context creation attribute was true |
| 2997 // and we are using a software renderer, fail. | 2997 // and we are using a software renderer, fail. |
| 2998 if (attrib_helper.fail_if_major_perf_caveat && | 2998 if (attrib_helper.fail_if_major_perf_caveat && |
| 2999 feature_info_->feature_flags().is_swiftshader) { | 2999 feature_info_->feature_flags().is_swiftshader) { |
| 3000 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. | 3000 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. |
| 3001 Destroy(true); | 3001 Destroy(true); |
| 3002 return false; | 3002 return false; |
| 3003 } | 3003 } |
| 3004 | 3004 |
| 3005 // Reset PIXEL_UNPACK_BUFFER to avoid context creation failure. | |
| 3006 const char* version_str = | |
| 3007 reinterpret_cast<const char*>(glGetString(GL_VERSION)); | |
| 3008 std::unique_ptr<gl::GLVersionInfo> version_info; | |
| 3009 version_info.reset(new gl::GLVersionInfo(version_str, "", "")); | |
| 3010 if (version_info->IsAtLeastGL(3, 2) || version_info->IsAtLeastGLES(3, 0)) | |
|
Zhenyao Mo
2016/09/08 18:19:23
This should be feature_info_->IsES3Capable()
qiankun
2016/09/09 02:06:44
IsES3Capable() cannot be used until group_->Initia
| |
| 3011 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); | |
|
Zhenyao Mo
2016/09/02 17:10:23
Thanks for tracking down the problem, but this is
qiankun
2016/09/02 23:12:01
Do you mean moving the code to virtual context ini
| |
| 3012 | |
| 3005 if (!group_->Initialize(this, attrib_helper.context_type, | 3013 if (!group_->Initialize(this, attrib_helper.context_type, |
| 3006 disallowed_features)) { | 3014 disallowed_features)) { |
| 3007 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. | 3015 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. |
| 3008 Destroy(true); | 3016 Destroy(true); |
| 3009 return false; | 3017 return false; |
| 3010 } | 3018 } |
| 3011 CHECK_GL_ERROR(); | 3019 CHECK_GL_ERROR(); |
| 3012 | 3020 |
| 3013 should_use_native_gmb_for_backbuffer_ = | 3021 should_use_native_gmb_for_backbuffer_ = |
| 3014 attrib_helper.should_use_native_gmb_for_backbuffer; | 3022 attrib_helper.should_use_native_gmb_for_backbuffer; |
| (...skipping 14735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 17750 } | 17758 } |
| 17751 | 17759 |
| 17752 // Include the auto-generated part of this file. We split this because it means | 17760 // Include the auto-generated part of this file. We split this because it means |
| 17753 // we can easily edit the non-auto generated parts right here in this file | 17761 // we can easily edit the non-auto generated parts right here in this file |
| 17754 // instead of having to edit some template or the code generator. | 17762 // instead of having to edit some template or the code generator. |
| 17755 #include "base/macros.h" | 17763 #include "base/macros.h" |
| 17756 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 17764 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 17757 | 17765 |
| 17758 } // namespace gles2 | 17766 } // namespace gles2 |
| 17759 } // namespace gpu | 17767 } // namespace gpu |
| OLD | NEW |