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 3574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3585 // Clear the backbuffer. | 3585 // Clear the backbuffer. |
3586 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); | 3586 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); |
3587 | 3587 |
3588 // Restore alpha clear value if we changed it. | 3588 // Restore alpha clear value if we changed it. |
3589 if (clear_alpha) { | 3589 if (clear_alpha) { |
3590 glClearColor(0.0f, 0.0f, 0.0f, 0.0f); | 3590 glClearColor(0.0f, 0.0f, 0.0f, 0.0f); |
3591 } | 3591 } |
3592 } | 3592 } |
3593 | 3593 |
3594 supports_post_sub_buffer_ = surface->SupportsPostSubBuffer(); | 3594 supports_post_sub_buffer_ = surface->SupportsPostSubBuffer(); |
3595 if (workarounds() | |
3596 .disable_post_sub_buffers_for_onscreen_surfaces && | |
3597 !surface->IsOffscreen()) | |
3598 supports_post_sub_buffer_ = false; | |
3599 | 3595 |
3600 supports_swap_buffers_with_bounds_ = surface->SupportsSwapBuffersWithBounds(); | 3596 supports_swap_buffers_with_bounds_ = surface->SupportsSwapBuffersWithBounds(); |
3601 | 3597 |
3602 supports_commit_overlay_planes_ = surface->SupportsCommitOverlayPlanes(); | 3598 supports_commit_overlay_planes_ = surface->SupportsCommitOverlayPlanes(); |
3603 | 3599 |
3604 supports_async_swap_ = surface->SupportsAsyncSwap(); | 3600 supports_async_swap_ = surface->SupportsAsyncSwap(); |
3605 | 3601 |
3606 supports_dc_layers_ = !offscreen && surface->SupportsDCLayers(); | 3602 supports_dc_layers_ = !offscreen && surface->SupportsDCLayers(); |
3607 | 3603 |
3608 if (workarounds().reverse_point_sprite_coord_origin) { | 3604 if (workarounds().reverse_point_sprite_coord_origin) { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3809 caps.gpu_rasterization = | 3805 caps.gpu_rasterization = |
3810 group_->gpu_feature_info() | 3806 group_->gpu_feature_info() |
3811 .status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] == | 3807 .status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] == |
3812 kGpuFeatureStatusEnabled; | 3808 kGpuFeatureStatusEnabled; |
3813 caps.disable_webgl_rgb_multisampling_usage = | 3809 caps.disable_webgl_rgb_multisampling_usage = |
3814 workarounds().disable_webgl_rgb_multisampling_usage; | 3810 workarounds().disable_webgl_rgb_multisampling_usage; |
3815 caps.software_to_accelerated_canvas_upgrade = | 3811 caps.software_to_accelerated_canvas_upgrade = |
3816 !workarounds().disable_software_to_accelerated_canvas_upgrade; | 3812 !workarounds().disable_software_to_accelerated_canvas_upgrade; |
3817 caps.emulate_rgb_buffer_with_rgba = | 3813 caps.emulate_rgb_buffer_with_rgba = |
3818 workarounds().disable_gl_rgb_format; | 3814 workarounds().disable_gl_rgb_format; |
3815 if (workarounds().disable_post_sub_buffers_for_onscreen_surfaces && | |
3816 !surface_->IsOffscreen()) { | |
jbauman
2017/04/20 21:30:06
We need a different workaround for this. Otherwise
reveman
2017/04/20 22:11:40
Unlikely that we do empty swaps without overlays b
| |
3817 caps.disable_non_empty_post_sub_buffers = true; | |
3818 } | |
3819 | 3819 |
3820 return caps; | 3820 return caps; |
3821 } | 3821 } |
3822 | 3822 |
3823 void GLES2DecoderImpl::UpdateCapabilities() { | 3823 void GLES2DecoderImpl::UpdateCapabilities() { |
3824 util_.set_num_compressed_texture_formats( | 3824 util_.set_num_compressed_texture_formats( |
3825 validators_->compressed_texture_format.GetValues().size()); | 3825 validators_->compressed_texture_format.GetValues().size()); |
3826 util_.set_num_shader_binary_formats( | 3826 util_.set_num_shader_binary_formats( |
3827 validators_->shader_binary_format.GetValues().size()); | 3827 validators_->shader_binary_format.GetValues().size()); |
3828 } | 3828 } |
(...skipping 15748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
19577 } | 19577 } |
19578 | 19578 |
19579 // Include the auto-generated part of this file. We split this because it means | 19579 // Include the auto-generated part of this file. We split this because it means |
19580 // we can easily edit the non-auto generated parts right here in this file | 19580 // we can easily edit the non-auto generated parts right here in this file |
19581 // instead of having to edit some template or the code generator. | 19581 // instead of having to edit some template or the code generator. |
19582 #include "base/macros.h" | 19582 #include "base/macros.h" |
19583 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19583 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
19584 | 19584 |
19585 } // namespace gles2 | 19585 } // namespace gles2 |
19586 } // namespace gpu | 19586 } // namespace gpu |
OLD | NEW |