| 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)) { | |
| 165 Destroy(true); | 162 Destroy(true); |
| 166 return false; | 163 return false; |
| 167 } | 164 } |
| 168 | 165 |
| 169 image_manager_.reset(new ImageManager()); | 166 image_manager_.reset(new ImageManager()); |
| 170 | 167 |
| 171 bind_generates_resource_ = group_->bind_generates_resource(); | 168 bind_generates_resource_ = group_->bind_generates_resource(); |
| 172 | 169 |
| 173 resources_ = group_->passthrough_resources(); | 170 resources_ = group_->passthrough_resources(); |
| 174 | 171 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 const FeatureInfo* GLES2DecoderPassthroughImpl::GetFeatureInfo() const { | 266 const FeatureInfo* GLES2DecoderPassthroughImpl::GetFeatureInfo() const { |
| 270 return group_->feature_info(); | 267 return group_->feature_info(); |
| 271 } | 268 } |
| 272 | 269 |
| 273 gpu::Capabilities GLES2DecoderPassthroughImpl::GetCapabilities() { | 270 gpu::Capabilities GLES2DecoderPassthroughImpl::GetCapabilities() { |
| 274 DCHECK(initialized()); | 271 DCHECK(initialized()); |
| 275 Capabilities caps; | 272 Capabilities caps; |
| 276 | 273 |
| 277 PopulateNumericCapabilities(&caps, feature_info_.get()); | 274 PopulateNumericCapabilities(&caps, feature_info_.get()); |
| 278 | 275 |
| 279 glGetIntegerv(GL_BIND_GENERATES_RESOURCE_CHROMIUM, | 276 caps.bind_generates_resource_chromium = group_->bind_generates_resource(); |
| 280 &caps.bind_generates_resource_chromium); | |
| 281 DCHECK_EQ(caps.bind_generates_resource_chromium != GL_FALSE, | |
| 282 group_->bind_generates_resource()); | |
| 283 | |
| 284 caps.egl_image_external = | 277 caps.egl_image_external = |
| 285 feature_info_->feature_flags().oes_egl_image_external; | 278 feature_info_->feature_flags().oes_egl_image_external; |
| 286 caps.texture_format_astc = | 279 caps.texture_format_astc = |
| 287 feature_info_->feature_flags().ext_texture_format_astc; | 280 feature_info_->feature_flags().ext_texture_format_astc; |
| 288 caps.texture_format_atc = | 281 caps.texture_format_atc = |
| 289 feature_info_->feature_flags().ext_texture_format_atc; | 282 feature_info_->feature_flags().ext_texture_format_atc; |
| 290 caps.texture_format_bgra8888 = | 283 caps.texture_format_bgra8888 = |
| 291 feature_info_->feature_flags().ext_texture_format_bgra8888; | 284 feature_info_->feature_flags().ext_texture_format_bgra8888; |
| 292 caps.texture_format_dxt1 = | 285 caps.texture_format_dxt1 = |
| 293 feature_info_->feature_flags().ext_texture_format_dxt1; | 286 feature_info_->feature_flags().ext_texture_format_dxt1; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 }, /* NOLINT */ | 532 }, /* NOLINT */ |
| 540 | 533 |
| 541 const GLES2DecoderPassthroughImpl::CommandInfo | 534 const GLES2DecoderPassthroughImpl::CommandInfo |
| 542 GLES2DecoderPassthroughImpl::command_info[] = { | 535 GLES2DecoderPassthroughImpl::command_info[] = { |
| 543 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; | 536 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; |
| 544 | 537 |
| 545 #undef GLES2_CMD_OP | 538 #undef GLES2_CMD_OP |
| 546 | 539 |
| 547 } // namespace gles2 | 540 } // namespace gles2 |
| 548 } // namespace gpu | 541 } // namespace gpu |
| OLD | NEW |