Chromium Code Reviews| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 | 237 |
| 238 #if defined(OS_ANDROID) | 238 #if defined(OS_ANDROID) |
| 239 return false; | 239 return false; |
| 240 #endif | 240 #endif |
| 241 return true; | 241 return true; |
| 242 } | 242 } |
| 243 | 243 |
| 244 bool IsZeroCopyUploadEnabled() { | 244 bool IsZeroCopyUploadEnabled() { |
| 245 const base::CommandLine& command_line = | 245 const base::CommandLine& command_line = |
| 246 *base::CommandLine::ForCurrentProcess(); | 246 *base::CommandLine::ForCurrentProcess(); |
| 247 // Single-threaded mode in the renderer process (for layout tests) is | |
| 248 // synchronous, which depends on tiles being ready to draw when raster is | |
| 249 // complete. Therefore, it must use one of zero copy, software raster, or | |
| 250 // GPU raster. So we force zero-copy on for the case where software/GPU raster | |
| 251 // is not used. | |
| 252 // TODO(reveman): One-copy can work with sync compositing: crbug.com/490295. | |
| 253 if (command_line.HasSwitch(switches::kDisableThreadedCompositing)) | |
| 254 return true; | |
| 255 return command_line.HasSwitch(switches::kEnableZeroCopy); | 247 return command_line.HasSwitch(switches::kEnableZeroCopy); |
| 248 ; | |
|
reveman
2015/06/11 14:19:25
typo?
| |
| 256 } | 249 } |
| 257 | 250 |
| 258 bool IsGpuRasterizationEnabled() { | 251 bool IsGpuRasterizationEnabled() { |
| 259 const base::CommandLine& command_line = | 252 const base::CommandLine& command_line = |
| 260 *base::CommandLine::ForCurrentProcess(); | 253 *base::CommandLine::ForCurrentProcess(); |
| 261 | 254 |
| 262 if (!IsImplSidePaintingEnabled()) | 255 if (!IsImplSidePaintingEnabled()) |
| 263 return false; | 256 return false; |
| 264 | 257 |
| 265 if (command_line.HasSwitch(switches::kDisableGpuRasterization)) | 258 if (command_line.HasSwitch(switches::kDisableGpuRasterization)) |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 } | 422 } |
| 430 } | 423 } |
| 431 return problem_list; | 424 return problem_list; |
| 432 } | 425 } |
| 433 | 426 |
| 434 std::vector<std::string> GetDriverBugWorkarounds() { | 427 std::vector<std::string> GetDriverBugWorkarounds() { |
| 435 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); | 428 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); |
| 436 } | 429 } |
| 437 | 430 |
| 438 } // namespace content | 431 } // namespace content |
| OLD | NEW |