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 "gpu/command_buffer/service/feature_info.h" | 7 #include "gpu/command_buffer/service/feature_info.h" |
8 #include "gpu/command_buffer/service/gl_utils.h" | 8 #include "gpu/command_buffer/service/gl_utils.h" |
9 #include "ui/gl/gl_version_info.h" | 9 #include "ui/gl/gl_version_info.h" |
10 | 10 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 surface_ = surface; | 151 surface_ = surface; |
152 | 152 |
153 if (!group_->Initialize(this, attrib_helper.context_type, | 153 if (!group_->Initialize(this, attrib_helper.context_type, |
154 disallowed_features)) { | 154 disallowed_features)) { |
155 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. | 155 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. |
156 Destroy(true); | 156 Destroy(true); |
157 return false; | 157 return false; |
158 } | 158 } |
159 | 159 |
160 // Check for required extensions | 160 // Check for required extensions |
161 if (!feature_info_->feature_flags().angle_robust_client_memory) { | 161 if (!feature_info_->feature_flags().angle_robust_client_memory || |
| 162 !feature_info_->feature_flags().chromium_bind_generates_resource || |
| 163 (feature_info_->IsWebGLContext() != |
| 164 feature_info_->feature_flags().angle_webgl_compatibility)) { |
162 Destroy(true); | 165 Destroy(true); |
163 return false; | 166 return false; |
164 } | 167 } |
165 | 168 |
166 image_manager_.reset(new ImageManager()); | 169 image_manager_.reset(new ImageManager()); |
167 | 170 |
168 bind_generates_resource_ = group_->bind_generates_resource(); | 171 bind_generates_resource_ = group_->bind_generates_resource(); |
169 | 172 |
170 resources_ = group_->passthrough_resources(); | 173 resources_ = group_->passthrough_resources(); |
171 | 174 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 const FeatureInfo* GLES2DecoderPassthroughImpl::GetFeatureInfo() const { | 269 const FeatureInfo* GLES2DecoderPassthroughImpl::GetFeatureInfo() const { |
267 return group_->feature_info(); | 270 return group_->feature_info(); |
268 } | 271 } |
269 | 272 |
270 gpu::Capabilities GLES2DecoderPassthroughImpl::GetCapabilities() { | 273 gpu::Capabilities GLES2DecoderPassthroughImpl::GetCapabilities() { |
271 DCHECK(initialized()); | 274 DCHECK(initialized()); |
272 Capabilities caps; | 275 Capabilities caps; |
273 | 276 |
274 PopulateNumericCapabilities(&caps, feature_info_.get()); | 277 PopulateNumericCapabilities(&caps, feature_info_.get()); |
275 | 278 |
276 caps.bind_generates_resource_chromium = group_->bind_generates_resource(); | 279 glGetIntegerv(GL_BIND_GENERATES_RESOURCE_CHROMIUM, |
| 280 &caps.bind_generates_resource_chromium); |
| 281 DCHECK_EQ(caps.bind_generates_resource_chromium != GL_FALSE, |
| 282 group_->bind_generates_resource()); |
| 283 |
277 caps.egl_image_external = | 284 caps.egl_image_external = |
278 feature_info_->feature_flags().oes_egl_image_external; | 285 feature_info_->feature_flags().oes_egl_image_external; |
279 caps.texture_format_astc = | 286 caps.texture_format_astc = |
280 feature_info_->feature_flags().ext_texture_format_astc; | 287 feature_info_->feature_flags().ext_texture_format_astc; |
281 caps.texture_format_atc = | 288 caps.texture_format_atc = |
282 feature_info_->feature_flags().ext_texture_format_atc; | 289 feature_info_->feature_flags().ext_texture_format_atc; |
283 caps.texture_format_bgra8888 = | 290 caps.texture_format_bgra8888 = |
284 feature_info_->feature_flags().ext_texture_format_bgra8888; | 291 feature_info_->feature_flags().ext_texture_format_bgra8888; |
285 caps.texture_format_dxt1 = | 292 caps.texture_format_dxt1 = |
286 feature_info_->feature_flags().ext_texture_format_dxt1; | 293 feature_info_->feature_flags().ext_texture_format_dxt1; |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 }, /* NOLINT */ | 539 }, /* NOLINT */ |
533 | 540 |
534 const GLES2DecoderPassthroughImpl::CommandInfo | 541 const GLES2DecoderPassthroughImpl::CommandInfo |
535 GLES2DecoderPassthroughImpl::command_info[] = { | 542 GLES2DecoderPassthroughImpl::command_info[] = { |
536 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; | 543 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; |
537 | 544 |
538 #undef GLES2_CMD_OP | 545 #undef GLES2_CMD_OP |
539 | 546 |
540 } // namespace gles2 | 547 } // namespace gles2 |
541 } // namespace gpu | 548 } // namespace gpu |
OLD | NEW |