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 "content/browser/gpu/compositor_util.h" | 5 #include "content/browser/gpu/compositor_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 235 |
236 #if defined(OS_ANDROID) | 236 #if defined(OS_ANDROID) |
237 return false; | 237 return false; |
238 #endif | 238 #endif |
239 return true; | 239 return true; |
240 } | 240 } |
241 | 241 |
242 bool IsZeroCopyUploadEnabled() { | 242 bool IsZeroCopyUploadEnabled() { |
243 const base::CommandLine& command_line = | 243 const base::CommandLine& command_line = |
244 *base::CommandLine::ForCurrentProcess(); | 244 *base::CommandLine::ForCurrentProcess(); |
245 // Single-threaded mode in the renderer process (for layout tests) is | |
246 // synchronous, which depends on tiles being ready to draw when raster is | |
247 // complete. Therefore, it must use one of zero copy, software raster, or | |
248 // GPU raster. So we force zero-copy on for the case where software/GPU raster | |
249 // is not used. | |
250 // TODO(reveman): One-copy can work with sync compositing: crbug.com/490295. | |
251 if (command_line.HasSwitch(switches::kDisableThreadedCompositing)) | |
252 return true; | |
253 return command_line.HasSwitch(switches::kEnableZeroCopy); | 245 return command_line.HasSwitch(switches::kEnableZeroCopy); |
254 } | 246 } |
255 | 247 |
256 bool IsPersistentGpuMemoryBufferEnabled() { | 248 bool IsPersistentGpuMemoryBufferEnabled() { |
257 // Zero copy currently doesn't take advantage of persistent buffers. | 249 // Zero copy currently doesn't take advantage of persistent buffers. |
258 if (IsZeroCopyUploadEnabled()) | 250 if (IsZeroCopyUploadEnabled()) |
259 return false; | 251 return false; |
260 const auto& command_line = *base::CommandLine::ForCurrentProcess(); | 252 const auto& command_line = *base::CommandLine::ForCurrentProcess(); |
261 return !command_line.HasSwitch(switches::kDisablePersistentGpuMemoryBuffer); | 253 return !command_line.HasSwitch(switches::kDisablePersistentGpuMemoryBuffer); |
262 } | 254 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 } | 418 } |
427 } | 419 } |
428 return problem_list; | 420 return problem_list; |
429 } | 421 } |
430 | 422 |
431 std::vector<std::string> GetDriverBugWorkarounds() { | 423 std::vector<std::string> GetDriverBugWorkarounds() { |
432 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); | 424 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); |
433 } | 425 } |
434 | 426 |
435 } // namespace content | 427 } // namespace content |
OLD | NEW |