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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 // synchronous, which depends on tiles being ready to draw when raster is | 261 // synchronous, which depends on tiles being ready to draw when raster is |
| 262 // complete. Therefore, it must use one of zero copy, software raster, or | 262 // complete. Therefore, it must use one of zero copy, software raster, or |
| 263 // GPU raster. So we force zero-copy on for the case where software/GPU raster | 263 // GPU raster. So we force zero-copy on for the case where software/GPU raster |
| 264 // is not used. | 264 // is not used. |
| 265 // TODO(reveman): One-copy can work with sync compositing: crbug.com/490295. | 265 // TODO(reveman): One-copy can work with sync compositing: crbug.com/490295. |
| 266 if (command_line.HasSwitch(switches::kDisableThreadedCompositing)) | 266 if (command_line.HasSwitch(switches::kDisableThreadedCompositing)) |
| 267 return true; | 267 return true; |
| 268 return command_line.HasSwitch(switches::kEnableZeroCopy); | 268 return command_line.HasSwitch(switches::kEnableZeroCopy); |
| 269 } | 269 } |
| 270 | 270 |
| 271 bool HavePersistentGpuMemoryBuffers() { | |
| 272 // We don't need to support this for ZeroCopy as it can't do anything with it | |
| 273 // yet. | |
| 274 if (IsZeroCopyUploadEnabled()) | |
| 275 return false; | |
| 276 const base::CommandLine& command_line = | |
| 277 *base::CommandLine::ForCurrentProcess(); | |
| 278 if (command_line.HasSwitch(switches::kEnableNativeGpuMemoryBuffers)) { | |
| 279 // TODO(reveman): Need native support for this. crbug.com/489438 | |
| 280 return false; | |
| 281 } | |
| 282 return true; | |
| 283 } | |
|
reveman
2015/05/22 17:15:13
How about we land the initial version of this with
danakj
2015/05/26 19:02:52
Sure, if you like. That'll make reverts smaller.
danakj
2015/05/26 23:37:34
Done.
| |
| 284 | |
| 271 bool IsGpuRasterizationEnabled() { | 285 bool IsGpuRasterizationEnabled() { |
| 272 const base::CommandLine& command_line = | 286 const base::CommandLine& command_line = |
| 273 *base::CommandLine::ForCurrentProcess(); | 287 *base::CommandLine::ForCurrentProcess(); |
| 274 | 288 |
| 275 if (!IsImplSidePaintingEnabled()) | 289 if (!IsImplSidePaintingEnabled()) |
| 276 return false; | 290 return false; |
| 277 | 291 |
| 278 if (command_line.HasSwitch(switches::kDisableGpuRasterization)) | 292 if (command_line.HasSwitch(switches::kDisableGpuRasterization)) |
| 279 return false; | 293 return false; |
| 280 else if (command_line.HasSwitch(switches::kEnableGpuRasterization)) | 294 else if (command_line.HasSwitch(switches::kEnableGpuRasterization)) |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 } | 456 } |
| 443 } | 457 } |
| 444 return problem_list; | 458 return problem_list; |
| 445 } | 459 } |
| 446 | 460 |
| 447 std::vector<std::string> GetDriverBugWorkarounds() { | 461 std::vector<std::string> GetDriverBugWorkarounds() { |
| 448 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); | 462 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); |
| 449 } | 463 } |
| 450 | 464 |
| 451 } // namespace content | 465 } // namespace content |
| OLD | NEW |