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

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

Issue 337783002: Remove EnableThreadedCompositing from the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thread: . Created 6 years, 6 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/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 if (command_line.HasSwitch(cc::switches::kEnablePinchVirtualViewport)) 161 if (command_line.HasSwitch(cc::switches::kEnablePinchVirtualViewport))
162 return true; 162 return true;
163 163
164 #if defined(OS_CHROMEOS) 164 #if defined(OS_CHROMEOS)
165 return true; 165 return true;
166 #else 166 #else
167 return false; 167 return false;
168 #endif 168 #endif
169 } 169 }
170 170
171 bool IsThreadedCompositingEnabled() {
172 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
173
174 // Command line switches take precedence over blacklist.
175 if (command_line.HasSwitch(switches::kDisableThreadedCompositing))
176 return false;
177 if (command_line.HasSwitch(switches::kEnableThreadedCompositing))
178 return true;
179
180 #if defined(USE_AURA) || defined(OS_MACOSX)
181 // We always want threaded compositing on Aura and Mac (the fallback is a
182 // threaded software compositor).
183 return true;
184 #else
185 return false;
186 #endif
187 }
188
189 bool IsDelegatedRendererEnabled() { 171 bool IsDelegatedRendererEnabled() {
190 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 172 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
191 bool enabled = false; 173 bool enabled = false;
192 174
193 #if defined(USE_AURA) 175 #if defined(USE_AURA)
194 // Enable on Aura. 176 // Enable on Aura.
195 enabled = true; 177 enabled = true;
196 #endif 178 #endif
197 179
198 // Flags override. 180 // Flags override.
199 enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer); 181 enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer);
200 enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer); 182 enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer);
201 183
202 // Needs compositing, and thread. 184 // Needs compositing, and thread.
203 if (enabled && !IsThreadedCompositingEnabled()) {
204 enabled = false;
205 LOG(ERROR) << "Disabling delegated-rendering because it needs "
206 << "force-compositing-mode and threaded-compositing.";
207 }
208
209 return enabled; 185 return enabled;
210 } 186 }
211 187
212 bool IsImplSidePaintingEnabled() { 188 bool IsImplSidePaintingEnabled() {
213 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 189 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
214 190
215 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) 191 if (command_line.HasSwitch(switches::kDisableImplSidePainting))
216 return false; 192 return false;
217 else if (command_line.HasSwitch(switches::kEnableImplSidePainting)) 193 else if (command_line.HasSwitch(switches::kEnableImplSidePainting))
218 return true; 194 return true;
219 else if (command_line.HasSwitch( 195 else if (command_line.HasSwitch(
220 switches::kEnableBleedingEdgeRenderingFastPaths)) 196 switches::kEnableBleedingEdgeRenderingFastPaths))
221 return true; 197 return true;
222 198
223 #if defined(OS_MACOSX) || defined(OS_WIN) 199 #if defined(OS_MACOSX) || defined(OS_WIN)
224 return false; 200 return false;
225 #else 201 #else
226 return IsThreadedCompositingEnabled(); 202 return true;
227 #endif 203 #endif
228 } 204 }
229 205
230 bool IsGpuRasterizationEnabled() { 206 bool IsGpuRasterizationEnabled() {
231 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 207 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
232 208
233 if (!IsImplSidePaintingEnabled()) 209 if (!IsImplSidePaintingEnabled())
234 return false; 210 return false;
235 211
236 if (command_line.HasSwitch(switches::kDisableGpuRasterization)) 212 if (command_line.HasSwitch(switches::kDisableGpuRasterization))
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } else { 267 } else {
292 status = "enabled"; 268 status = "enabled";
293 if (gpu_feature_info.name == kWebGLFeatureName && 269 if (gpu_feature_info.name == kWebGLFeatureName &&
294 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING)) 270 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING))
295 status += "_readback"; 271 status += "_readback";
296 if (gpu_feature_info.name == kRasterizationFeatureName) { 272 if (gpu_feature_info.name == kRasterizationFeatureName) {
297 if (IsForceGpuRasterizationEnabled()) 273 if (IsForceGpuRasterizationEnabled())
298 status += "_force"; 274 status += "_force";
299 } 275 }
300 } 276 }
301 if (gpu_feature_info.name == kGpuCompositingFeatureName) {
302 if (IsThreadedCompositingEnabled())
303 status += "_threaded";
304 }
305 feature_status_dict->SetString( 277 feature_status_dict->SetString(
306 gpu_feature_info.name.c_str(), status.c_str()); 278 gpu_feature_info.name.c_str(), status.c_str());
307 } 279 }
308 return feature_status_dict; 280 return feature_status_dict;
309 } 281 }
310 282
311 base::Value* GetProblems() { 283 base::Value* GetProblems() {
312 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); 284 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
313 std::string gpu_access_blocked_reason; 285 std::string gpu_access_blocked_reason;
314 bool gpu_access_blocked = 286 bool gpu_access_blocked =
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return problem_list; 321 return problem_list;
350 } 322 }
351 323
352 base::Value* GetDriverBugWorkarounds() { 324 base::Value* GetDriverBugWorkarounds() {
353 base::ListValue* workaround_list = new base::ListValue(); 325 base::ListValue* workaround_list = new base::ListValue();
354 GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(workaround_list); 326 GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(workaround_list);
355 return workaround_list; 327 return workaround_list;
356 } 328 }
357 329
358 } // namespace content 330 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698