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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 251 } |
252 #endif // OS_MACOSX | 252 #endif // OS_MACOSX |
253 | 253 |
254 #if defined(OS_ANDROID) | 254 #if defined(OS_ANDROID) |
255 void ApplyAndroidWorkarounds(const gpu::GPUInfo& gpu_info, | 255 void ApplyAndroidWorkarounds(const gpu::GPUInfo& gpu_info, |
256 CommandLine* command_line) { | 256 CommandLine* command_line) { |
257 std::string vendor(StringToLowerASCII(gpu_info.gl_vendor)); | 257 std::string vendor(StringToLowerASCII(gpu_info.gl_vendor)); |
258 std::string renderer(StringToLowerASCII(gpu_info.gl_renderer)); | 258 std::string renderer(StringToLowerASCII(gpu_info.gl_renderer)); |
259 bool is_img = | 259 bool is_img = |
260 gpu_info.gl_vendor.find("Imagination") != std::string::npos; | 260 gpu_info.gl_vendor.find("Imagination") != std::string::npos; |
261 bool is_nexus7 = | |
262 gpu_info.machine_model.find("Nexus 7") != std::string::npos; | |
263 bool is_nexus10 = | |
264 gpu_info.machine_model.find("Nexus 10") != std::string::npos; | |
265 | 261 |
266 gfx::DeviceDisplayInfo info; | 262 gfx::DeviceDisplayInfo info; |
267 int default_tile_size = 256; | 263 int default_tile_size = 256; |
268 | 264 |
269 // For very high resolution displays (eg. Nexus 10), set the default | 265 // For very high resolution displays (eg. Nexus 10), set the default |
270 // tile size to be 512. This should be removed in favour of a generic | 266 // tile size to be 512. This should be removed in favour of a generic |
271 // hueristic that works across all platforms and devices, once that | 267 // hueristic that works across all platforms and devices, once that |
272 // exists: http://crbug.com/159524. This switches to 512 for screens | 268 // exists: http://crbug.com/159524. This switches to 512 for screens |
273 // containing 40 or more 256x256 tiles, such that 1080p devices do | 269 // containing 40 or more 256x256 tiles, such that 1080p devices do |
274 // not use 512x512 tiles (eg. 1920x1280 requires 37.5 tiles) | 270 // not use 512x512 tiles (eg. 1920x1280 requires 37.5 tiles) |
(...skipping 18 matching lines...) Expand all Loading... |
293 if (default_tile_size != 256 && | 289 if (default_tile_size != 256 && |
294 !command_line->HasSwitch(switches::kDefaultTileWidth) && | 290 !command_line->HasSwitch(switches::kDefaultTileWidth) && |
295 !command_line->HasSwitch(switches::kDefaultTileHeight)) { | 291 !command_line->HasSwitch(switches::kDefaultTileHeight)) { |
296 std::stringstream size; | 292 std::stringstream size; |
297 size << default_tile_size; | 293 size << default_tile_size; |
298 command_line->AppendSwitchASCII( | 294 command_line->AppendSwitchASCII( |
299 switches::kDefaultTileWidth, size.str()); | 295 switches::kDefaultTileWidth, size.str()); |
300 command_line->AppendSwitchASCII( | 296 command_line->AppendSwitchASCII( |
301 switches::kDefaultTileHeight, size.str()); | 297 switches::kDefaultTileHeight, size.str()); |
302 } | 298 } |
303 | |
304 // Increase the resolution of low resolution tiles for Nexus tablets. | |
305 if ((is_nexus7 || is_nexus10) && | |
306 !command_line->HasSwitch( | |
307 cc::switches::kLowResolutionContentsScaleFactor)) { | |
308 command_line->AppendSwitchASCII( | |
309 cc::switches::kLowResolutionContentsScaleFactor, "0.25"); | |
310 } | |
311 } | 299 } |
312 #endif // OS_ANDROID | 300 #endif // OS_ANDROID |
313 | 301 |
314 // Block all domains' use of 3D APIs for this many milliseconds if | 302 // Block all domains' use of 3D APIs for this many milliseconds if |
315 // approaching a threshold where system stability might be compromised. | 303 // approaching a threshold where system stability might be compromised. |
316 const int64 kBlockAllDomainsMs = 10000; | 304 const int64 kBlockAllDomainsMs = 10000; |
317 const int kNumResetsWithinDuration = 1; | 305 const int kNumResetsWithinDuration = 1; |
318 | 306 |
319 // Enums for UMA histograms. | 307 // Enums for UMA histograms. |
320 enum BlockStatusHistogram { | 308 enum BlockStatusHistogram { |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 | 1223 |
1236 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1224 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
1237 gpu_process_accessible_ = false; | 1225 gpu_process_accessible_ = false; |
1238 gpu_info_.finalized = true; | 1226 gpu_info_.finalized = true; |
1239 complete_gpu_info_already_requested_ = true; | 1227 complete_gpu_info_already_requested_ = true; |
1240 // Some observers might be waiting. | 1228 // Some observers might be waiting. |
1241 NotifyGpuInfoUpdate(); | 1229 NotifyGpuInfoUpdate(); |
1242 } | 1230 } |
1243 | 1231 |
1244 } // namespace content | 1232 } // namespace content |
OLD | NEW |