Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: content/browser/gpu/compositor_util.cc

Issue 1157943004: cc: [WIP] Use worker context and OrderingBarrierCHROMIUM for one-copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: keep resource ownership in compositor. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 return false; 227 return false;
228 228
229 const base::CommandLine& command_line = 229 const base::CommandLine& command_line =
230 *base::CommandLine::ForCurrentProcess(); 230 *base::CommandLine::ForCurrentProcess();
231 return !command_line.HasSwitch(switches::kDisableOneCopy); 231 return !command_line.HasSwitch(switches::kDisableOneCopy);
232 } 232 }
233 233
234 bool IsZeroCopyUploadEnabled() { 234 bool IsZeroCopyUploadEnabled() {
235 const base::CommandLine& command_line = 235 const base::CommandLine& command_line =
236 *base::CommandLine::ForCurrentProcess(); 236 *base::CommandLine::ForCurrentProcess();
237 // Single-threaded mode in the renderer process (for layout tests) is
238 // synchronous, which depends on tiles being ready to draw when raster is
239 // complete. Therefore, it must use one of zero copy, software raster, or
240 // GPU raster. So we force zero-copy on for the case where software/GPU raster
241 // is not used.
242 // TODO(reveman): One-copy can work with sync compositing: crbug.com/490295.
243 if (command_line.HasSwitch(switches::kDisableThreadedCompositing))
244 return true;
245 return command_line.HasSwitch(switches::kEnableZeroCopy); 237 return command_line.HasSwitch(switches::kEnableZeroCopy);
246 } 238 }
247 239
248 bool IsGpuRasterizationEnabled() { 240 bool IsGpuRasterizationEnabled() {
249 const base::CommandLine& command_line = 241 const base::CommandLine& command_line =
250 *base::CommandLine::ForCurrentProcess(); 242 *base::CommandLine::ForCurrentProcess();
251 243
252 if (command_line.HasSwitch(switches::kDisableGpuRasterization)) 244 if (command_line.HasSwitch(switches::kDisableGpuRasterization))
253 return false; 245 return false;
254 else if (command_line.HasSwitch(switches::kEnableGpuRasterization)) 246 else if (command_line.HasSwitch(switches::kEnableGpuRasterization))
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 401 }
410 } 402 }
411 return problem_list; 403 return problem_list;
412 } 404 }
413 405
414 std::vector<std::string> GetDriverBugWorkarounds() { 406 std::vector<std::string> GetDriverBugWorkarounds() {
415 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); 407 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds();
416 } 408 }
417 409
418 } // namespace content 410 } // namespace content
OLDNEW
« cc/resources/resource_provider.cc ('K') | « cc/resources/resource_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698