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/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 enable_shader_name_hashing(false) { | 85 enable_shader_name_hashing(false) { |
86 } | 86 } |
87 | 87 |
88 FeatureInfo::Workarounds::Workarounds() | 88 FeatureInfo::Workarounds::Workarounds() |
89 : clear_alpha_in_readpixels(false), | 89 : clear_alpha_in_readpixels(false), |
90 needs_glsl_built_in_function_emulation(false), | 90 needs_glsl_built_in_function_emulation(false), |
91 needs_offscreen_buffer_workaround(false), | 91 needs_offscreen_buffer_workaround(false), |
92 reverse_point_sprite_coord_origin(false), | 92 reverse_point_sprite_coord_origin(false), |
93 set_texture_filter_before_generating_mipmap(false), | 93 set_texture_filter_before_generating_mipmap(false), |
94 use_current_program_after_successful_link(false), | 94 use_current_program_after_successful_link(false), |
| 95 restore_scissor_on_fbo_change(false), |
95 max_texture_size(0), | 96 max_texture_size(0), |
96 max_cube_map_texture_size(0) { | 97 max_cube_map_texture_size(0) { |
97 } | 98 } |
98 | 99 |
99 FeatureInfo::FeatureInfo() { | 100 FeatureInfo::FeatureInfo() { |
100 static const GLenum kAlphaTypes[] = { | 101 static const GLenum kAlphaTypes[] = { |
101 GL_UNSIGNED_BYTE, | 102 GL_UNSIGNED_BYTE, |
102 }; | 103 }; |
103 static const GLenum kRGBTypes[] = { | 104 static const GLenum kRGBTypes[] = { |
104 GL_UNSIGNED_BYTE, | 105 GL_UNSIGNED_BYTE, |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback"); | 665 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback"); |
665 | 666 |
666 if (!feature_flags_.disable_workarounds) { | 667 if (!feature_flags_.disable_workarounds) { |
667 workarounds_.set_texture_filter_before_generating_mipmap = true; | 668 workarounds_.set_texture_filter_before_generating_mipmap = true; |
668 workarounds_.clear_alpha_in_readpixels = true; | 669 workarounds_.clear_alpha_in_readpixels = true; |
669 | 670 |
670 if (is_nvidia) { | 671 if (is_nvidia) { |
671 workarounds_.use_current_program_after_successful_link = true; | 672 workarounds_.use_current_program_after_successful_link = true; |
672 } | 673 } |
673 | 674 |
| 675 if (is_qualcomm) { |
| 676 workarounds_.restore_scissor_on_fbo_change = true; |
| 677 } |
| 678 |
674 #if defined(OS_MACOSX) | 679 #if defined(OS_MACOSX) |
675 workarounds_.needs_offscreen_buffer_workaround = is_nvidia; | 680 workarounds_.needs_offscreen_buffer_workaround = is_nvidia; |
676 workarounds_.needs_glsl_built_in_function_emulation = is_amd; | 681 workarounds_.needs_glsl_built_in_function_emulation = is_amd; |
677 | 682 |
678 if ((is_amd || is_intel) && | 683 if ((is_amd || is_intel) && |
679 gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) { | 684 gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) { |
680 workarounds_.reverse_point_sprite_coord_origin = true; | 685 workarounds_.reverse_point_sprite_coord_origin = true; |
681 } | 686 } |
682 | 687 |
683 // Limit Intel on Mac to 4096 max tex size and 1024 max cube map tex size. | 688 // Limit Intel on Mac to 4096 max tex size and 1024 max cube map tex size. |
(...skipping 25 matching lines...) Expand all Loading... |
709 if (extensions_.find(str) == std::string::npos) { | 714 if (extensions_.find(str) == std::string::npos) { |
710 extensions_ += (extensions_.empty() ? "" : " ") + str; | 715 extensions_ += (extensions_.empty() ? "" : " ") + str; |
711 } | 716 } |
712 } | 717 } |
713 | 718 |
714 FeatureInfo::~FeatureInfo() { | 719 FeatureInfo::~FeatureInfo() { |
715 } | 720 } |
716 | 721 |
717 } // namespace gles2 | 722 } // namespace gles2 |
718 } // namespace gpu | 723 } // namespace gpu |
OLD | NEW |