| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_passthrough.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" |
| 6 | 6 |
| 7 #include "base/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
| 8 #include "gpu/command_buffer/service/feature_info.h" | 8 #include "gpu/command_buffer/service/feature_info.h" |
| 9 #include "gpu/command_buffer/service/gl_utils.h" | 9 #include "gpu/command_buffer/service/gl_utils.h" |
| 10 #include "ui/gl/gl_version_info.h" | 10 #include "ui/gl/gl_version_info.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) | 73 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) |
| 74 : commands_to_process_(0), | 74 : commands_to_process_(0), |
| 75 debug_marker_manager_(), | 75 debug_marker_manager_(), |
| 76 logger_(&debug_marker_manager_), | 76 logger_(&debug_marker_manager_), |
| 77 surface_(), | 77 surface_(), |
| 78 context_(), | 78 context_(), |
| 79 offscreen_(false), | 79 offscreen_(false), |
| 80 group_(group), | 80 group_(group), |
| 81 feature_info_(group->feature_info()) { | 81 feature_info_(new FeatureInfo) { |
| 82 DCHECK(group); | 82 DCHECK(group); |
| 83 } | 83 } |
| 84 | 84 |
| 85 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {} | 85 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {} |
| 86 | 86 |
| 87 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands( | 87 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands( |
| 88 unsigned int num_commands, | 88 unsigned int num_commands, |
| 89 const volatile void* buffer, | 89 const volatile void* buffer, |
| 90 int num_entries, | 90 int num_entries, |
| 91 int* entries_processed) { | 91 int* entries_processed) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 surface_ = surface; | 165 surface_ = surface; |
| 166 offscreen_ = offscreen; | 166 offscreen_ = offscreen; |
| 167 | 167 |
| 168 if (!group_->Initialize(this, attrib_helper.context_type, | 168 if (!group_->Initialize(this, attrib_helper.context_type, |
| 169 disallowed_features)) { | 169 disallowed_features)) { |
| 170 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. | 170 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. |
| 171 Destroy(true); | 171 Destroy(true); |
| 172 return false; | 172 return false; |
| 173 } | 173 } |
| 174 | 174 |
| 175 // Each context initializes its own feature info because some extensions may |
| 176 // be enabled dynamically |
| 177 DisallowedFeatures adjusted_disallowed_features = |
| 178 AdjustDisallowedFeatures(attrib_helper.context_type, disallowed_features); |
| 179 if (!feature_info_->Initialize(attrib_helper.context_type, |
| 180 adjusted_disallowed_features)) { |
| 181 Destroy(true); |
| 182 return false; |
| 183 } |
| 184 |
| 175 // Check for required extensions | 185 // Check for required extensions |
| 176 if (!feature_info_->feature_flags().angle_robust_client_memory || | 186 if (!feature_info_->feature_flags().angle_robust_client_memory || |
| 177 !feature_info_->feature_flags().chromium_bind_generates_resource || | 187 !feature_info_->feature_flags().chromium_bind_generates_resource || |
| 178 !feature_info_->feature_flags().chromium_copy_texture || | 188 !feature_info_->feature_flags().chromium_copy_texture || |
| 179 !feature_info_->feature_flags().angle_client_arrays || | 189 !feature_info_->feature_flags().angle_client_arrays || |
| 180 glIsEnabled(GL_CLIENT_ARRAYS_ANGLE) != GL_FALSE) { | 190 glIsEnabled(GL_CLIENT_ARRAYS_ANGLE) != GL_FALSE || |
| 181 // TODO(geofflang): Verify that ANGLE_webgl_compatibility is enabled if this | 191 feature_info_->feature_flags().angle_webgl_compatibility != |
| 182 // is a WebGL context (depends on crbug.com/671217). | 192 IsWebGLContextType(attrib_helper.context_type) || |
| 193 !feature_info_->feature_flags().angle_request_extension) { |
| 183 Destroy(true); | 194 Destroy(true); |
| 184 return false; | 195 return false; |
| 185 } | 196 } |
| 186 | 197 |
| 187 image_manager_.reset(new ImageManager()); | 198 image_manager_.reset(new ImageManager()); |
| 188 | 199 |
| 189 bind_generates_resource_ = group_->bind_generates_resource(); | 200 bind_generates_resource_ = group_->bind_generates_resource(); |
| 190 | 201 |
| 191 resources_ = group_->passthrough_resources(); | 202 resources_ = group_->passthrough_resources(); |
| 192 | 203 |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 }, /* NOLINT */ | 870 }, /* NOLINT */ |
| 860 | 871 |
| 861 const GLES2DecoderPassthroughImpl::CommandInfo | 872 const GLES2DecoderPassthroughImpl::CommandInfo |
| 862 GLES2DecoderPassthroughImpl::command_info[] = { | 873 GLES2DecoderPassthroughImpl::command_info[] = { |
| 863 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; | 874 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; |
| 864 | 875 |
| 865 #undef GLES2_CMD_OP | 876 #undef GLES2_CMD_OP |
| 866 | 877 |
| 867 } // namespace gles2 | 878 } // namespace gles2 |
| 868 } // namespace gpu | 879 } // namespace gpu |
| OLD | NEW |