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

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

Issue 22797008: Force delegated renderer on Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix whitespace Created 7 years, 3 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 | Annotate | Revision Log
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/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "content/public/browser/gpu_data_manager.h" 9 #include "content/public/browser/gpu_data_manager.h"
10 #include "content/public/common/content_constants.h" 10 #include "content/public/common/content_constants.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 base::FieldTrialList::Find(kGpuCompositingFieldTrialName); 96 base::FieldTrialList::Find(kGpuCompositingFieldTrialName);
97 97
98 // Force compositing is enabled in both the force compositing 98 // Force compositing is enabled in both the force compositing
99 // and threaded compositing mode field trials. 99 // and threaded compositing mode field trials.
100 return trial && 100 return trial &&
101 (trial->group_name() == 101 (trial->group_name() ==
102 kGpuCompositingFieldTrialForceCompositingEnabledName || 102 kGpuCompositingFieldTrialForceCompositingEnabledName ||
103 trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName); 103 trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName);
104 } 104 }
105 105
106 bool IsDelegatedRendererEnabled() {
107 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
108 bool enabled = false;
109
110 #if defined(USE_AURA)
111 // Default to true on Aura, but allow override via flags.
112 enabled = true;
113 #endif
114
115 // Flags override.
116 enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer);
117 enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer);
118
119 // Needs compositing, and thread.
120 if (enabled &&
121 (!IsForceCompositingModeEnabled() || !IsThreadedCompositingEnabled())) {
122 enabled = false;
123 LOG(ERROR) << "Disabling delegated-rendering because it needs "
124 << "force-compositing-mode and threaded-compositing.";
125 }
126
127 return enabled;
128 }
129
106 } // namespace content 130 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/compositor_util.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698