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" |
| 8 #include "gpu/command_buffer/service/gl_utils.h" |
| 9 #include "ui/gl/gl_version_info.h" |
| 10 |
7 namespace gpu { | 11 namespace gpu { |
8 namespace gles2 { | 12 namespace gles2 { |
9 | 13 |
10 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) | 14 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) |
11 : commands_to_process_(0), | 15 : commands_to_process_(0), |
12 debug_marker_manager_(), | 16 debug_marker_manager_(), |
13 logger_(&debug_marker_manager_), | 17 logger_(&debug_marker_manager_), |
14 surface_(), | 18 surface_(), |
15 context_(), | 19 context_(), |
16 group_(group), | 20 group_(group), |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 return nullptr; | 178 return nullptr; |
175 } | 179 } |
176 | 180 |
177 const FeatureInfo* GLES2DecoderPassthroughImpl::GetFeatureInfo() const { | 181 const FeatureInfo* GLES2DecoderPassthroughImpl::GetFeatureInfo() const { |
178 return nullptr; | 182 return nullptr; |
179 } | 183 } |
180 | 184 |
181 gpu::Capabilities GLES2DecoderPassthroughImpl::GetCapabilities() { | 185 gpu::Capabilities GLES2DecoderPassthroughImpl::GetCapabilities() { |
182 DCHECK(initialized()); | 186 DCHECK(initialized()); |
183 Capabilities caps; | 187 Capabilities caps; |
| 188 |
| 189 PopulateNumericCapabilities(&caps, feature_info_.get()); |
| 190 |
| 191 caps.bind_generates_resource_chromium = group_->bind_generates_resource(); |
| 192 caps.egl_image_external = |
| 193 feature_info_->feature_flags().oes_egl_image_external; |
| 194 caps.texture_format_astc = |
| 195 feature_info_->feature_flags().ext_texture_format_astc; |
| 196 caps.texture_format_atc = |
| 197 feature_info_->feature_flags().ext_texture_format_atc; |
| 198 caps.texture_format_bgra8888 = |
| 199 feature_info_->feature_flags().ext_texture_format_bgra8888; |
| 200 caps.texture_format_dxt1 = |
| 201 feature_info_->feature_flags().ext_texture_format_dxt1; |
| 202 caps.texture_format_dxt5 = |
| 203 feature_info_->feature_flags().ext_texture_format_dxt5; |
| 204 caps.texture_format_etc1 = |
| 205 feature_info_->feature_flags().oes_compressed_etc1_rgb8_texture; |
| 206 caps.texture_format_etc1_npot = caps.texture_format_etc1; |
| 207 caps.texture_rectangle = feature_info_->feature_flags().arb_texture_rectangle; |
| 208 caps.texture_usage = feature_info_->feature_flags().angle_texture_usage; |
| 209 caps.texture_storage = feature_info_->feature_flags().ext_texture_storage; |
| 210 caps.discard_framebuffer = |
| 211 feature_info_->feature_flags().ext_discard_framebuffer; |
| 212 caps.sync_query = feature_info_->feature_flags().chromium_sync_query; |
| 213 #if defined(OS_MACOSX) |
| 214 // This is unconditionally true on mac, no need to test for it at runtime. |
| 215 caps.iosurface = true; |
| 216 #endif |
| 217 caps.image = true; |
| 218 caps.flips_vertically = surface_->FlipsVertically(); |
| 219 caps.blend_equation_advanced = |
| 220 feature_info_->feature_flags().blend_equation_advanced; |
| 221 caps.blend_equation_advanced_coherent = |
| 222 feature_info_->feature_flags().blend_equation_advanced_coherent; |
| 223 caps.texture_rg = feature_info_->feature_flags().ext_texture_rg; |
| 224 caps.texture_half_float_linear = |
| 225 feature_info_->feature_flags().enable_texture_half_float_linear; |
| 226 caps.image_ycbcr_422 = |
| 227 feature_info_->feature_flags().chromium_image_ycbcr_422; |
| 228 caps.image_ycbcr_420v = |
| 229 feature_info_->feature_flags().chromium_image_ycbcr_420v; |
| 230 caps.max_copy_texture_chromium_size = |
| 231 feature_info_->workarounds().max_copy_texture_chromium_size; |
| 232 caps.render_buffer_format_bgra8888 = |
| 233 feature_info_->feature_flags().ext_render_buffer_format_bgra8888; |
| 234 caps.occlusion_query_boolean = |
| 235 feature_info_->feature_flags().occlusion_query_boolean; |
| 236 |
| 237 // TODO: |
| 238 // caps.timer_queries |
| 239 // caps.post_sub_buffer |
| 240 // caps.commit_overlay_planes |
| 241 // caps.surfaceless |
| 242 // caps.is_offscreen |
| 243 // caps.flips_vertically |
| 244 |
184 return caps; | 245 return caps; |
185 } | 246 } |
186 | 247 |
187 void GLES2DecoderPassthroughImpl::RestoreState(const ContextState* prev_state) { | 248 void GLES2DecoderPassthroughImpl::RestoreState(const ContextState* prev_state) { |
188 | 249 |
189 } | 250 } |
190 | 251 |
191 void GLES2DecoderPassthroughImpl::RestoreActiveTexture() const {} | 252 void GLES2DecoderPassthroughImpl::RestoreActiveTexture() const {} |
192 | 253 |
193 void GLES2DecoderPassthroughImpl::RestoreAllTextureUnitBindings( | 254 void GLES2DecoderPassthroughImpl::RestoreAllTextureUnitBindings( |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 }, /* NOLINT */ | 443 }, /* NOLINT */ |
383 | 444 |
384 const GLES2DecoderPassthroughImpl::CommandInfo | 445 const GLES2DecoderPassthroughImpl::CommandInfo |
385 GLES2DecoderPassthroughImpl::command_info[] = { | 446 GLES2DecoderPassthroughImpl::command_info[] = { |
386 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; | 447 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; |
387 | 448 |
388 #undef GLES2_CMD_OP | 449 #undef GLES2_CMD_OP |
389 | 450 |
390 } // namespace gles2 | 451 } // namespace gles2 |
391 } // namespace gpu | 452 } // namespace gpu |
OLD | NEW |