OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/gpu/gpu_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void ApplyAndroidWorkarounds(const GPUInfo& gpu_info, | 91 void ApplyAndroidWorkarounds(const GPUInfo& gpu_info, |
92 CommandLine* command_line) { | 92 CommandLine* command_line) { |
93 std::string vendor(StringToLowerASCII(gpu_info.gl_vendor)); | 93 std::string vendor(StringToLowerASCII(gpu_info.gl_vendor)); |
94 std::string renderer(StringToLowerASCII(gpu_info.gl_renderer)); | 94 std::string renderer(StringToLowerASCII(gpu_info.gl_renderer)); |
95 bool is_img = | 95 bool is_img = |
96 gpu_info.gl_vendor.find("Imagination") != std::string::npos; | 96 gpu_info.gl_vendor.find("Imagination") != std::string::npos; |
97 bool is_arm = | 97 bool is_arm = |
98 gpu_info.gl_vendor.find("ARM") != std::string::npos; | 98 gpu_info.gl_vendor.find("ARM") != std::string::npos; |
99 bool is_qualcomm = | 99 bool is_qualcomm = |
100 gpu_info.gl_vendor.find("Qualcomm") != std::string::npos; | 100 gpu_info.gl_vendor.find("Qualcomm") != std::string::npos; |
| 101 bool is_broadcom = |
| 102 gpu_info.gl_vendor.find("Broadcom") != std::string::npos; |
101 bool is_mali_t604 = is_arm && | 103 bool is_mali_t604 = is_arm && |
102 gpu_info.gl_renderer.find("Mali-T604") != std::string::npos; | 104 gpu_info.gl_renderer.find("Mali-T604") != std::string::npos; |
103 | 105 |
104 bool is_vivante = | 106 bool is_vivante = |
105 gpu_info.gl_extensions.find("GL_VIV_shader_binary") != | 107 gpu_info.gl_extensions.find("GL_VIV_shader_binary") != |
106 std::string::npos; | 108 std::string::npos; |
107 | 109 |
108 bool is_nexus7 = | 110 bool is_nexus7 = |
109 gpu_info.machine_model.find("Nexus 7") != std::string::npos; | 111 gpu_info.machine_model.find("Nexus 7") != std::string::npos; |
110 bool is_nexus10 = | 112 bool is_nexus10 = |
111 gpu_info.machine_model.find("Nexus 10") != std::string::npos; | 113 gpu_info.machine_model.find("Nexus 10") != std::string::npos; |
112 | 114 |
113 // IMG: avoid context switching perf problems, crashes with share groups | 115 // IMG: avoid context switching perf problems, crashes with share groups |
114 // Mali-T604: http://crbug.com/154715 | 116 // Mali-T604: http://crbug.com/154715 |
115 // QualComm, NVIDIA: Crashes with share groups | 117 // QualComm, NVIDIA: Crashes with share groups |
116 if (is_vivante || is_img || is_mali_t604 || is_nexus7 || is_qualcomm) | 118 if (is_vivante || is_img || is_mali_t604 || is_nexus7 || is_qualcomm || |
| 119 is_broadcom) |
117 command_line->AppendSwitch(switches::kEnableVirtualGLContexts); | 120 command_line->AppendSwitch(switches::kEnableVirtualGLContexts); |
118 | 121 |
119 gfx::DeviceDisplayInfo info; | 122 gfx::DeviceDisplayInfo info; |
120 int default_tile_size = 256; | 123 int default_tile_size = 256; |
121 | 124 |
122 // For very high resolution displays (eg. Nexus 10), set the default | 125 // For very high resolution displays (eg. Nexus 10), set the default |
123 // tile size to be 512. This should be removed in favour of a generic | 126 // tile size to be 512. This should be removed in favour of a generic |
124 // hueristic that works across all platforms and devices, once that | 127 // hueristic that works across all platforms and devices, once that |
125 // exists: http://crbug.com/159524. This switches to 512 for screens | 128 // exists: http://crbug.com/159524. This switches to 512 for screens |
126 // containing 40 or more 256x256 tiles, such that 1080p devices do | 129 // containing 40 or more 256x256 tiles, such that 1080p devices do |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 int render_process_id, | 989 int render_process_id, |
987 int render_view_id, | 990 int render_view_id, |
988 ThreeDAPIType requester) { | 991 ThreeDAPIType requester) { |
989 GpuDataManagerImpl::UnlockedSession session(owner_); | 992 GpuDataManagerImpl::UnlockedSession session(owner_); |
990 observer_list_->Notify(&GpuDataManagerObserver::DidBlock3DAPIs, | 993 observer_list_->Notify(&GpuDataManagerObserver::DidBlock3DAPIs, |
991 url, render_process_id, render_view_id, requester); | 994 url, render_process_id, render_view_id, requester); |
992 } | 995 } |
993 | 996 |
994 } // namespace content | 997 } // namespace content |
995 | 998 |
OLD | NEW |