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

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

Issue 202863004: Fix "unreachable code" warnings (MSVC warning 4702) in content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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 "build/build_config.h" 9 #include "build/build_config.h"
10 #include "cc/base/switches.h" 10 #include "cc/base/switches.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 gpu::GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE); 187 gpu::GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE);
188 } 188 }
189 189
190 } // namespace 190 } // namespace
191 191
192 bool IsThreadedCompositingEnabled() { 192 bool IsThreadedCompositingEnabled() {
193 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 193 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
194 194
195 // Command line switches take precedence over blacklist. 195 // Command line switches take precedence over blacklist.
196 if (command_line.HasSwitch(switches::kDisableForceCompositingMode) || 196 if (command_line.HasSwitch(switches::kDisableForceCompositingMode) ||
197 command_line.HasSwitch(switches::kDisableThreadedCompositing)) { 197 command_line.HasSwitch(switches::kDisableThreadedCompositing))
198 return false; 198 return false;
199 } else if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) { 199 if (command_line.HasSwitch(switches::kEnableThreadedCompositing))
200 return true; 200 return true;
201 }
202 201
203 #if defined(USE_AURA) || defined(OS_MACOSX) 202 #if defined(USE_AURA) || defined(OS_MACOSX)
204 // We always want threaded compositing on Aura and Mac (the fallback is a 203 // We always want threaded compositing on Aura and Mac (the fallback is a
205 // threaded software compositor). 204 // threaded software compositor).
206 return true; 205 return true;
206 #else
207 return false;
207 #endif 208 #endif
208
209 if (!CanDoAcceleratedCompositing() || IsForceCompositingModeBlacklisted())
210 return false;
211
212 #if defined(OS_WIN)
213 // Windows Vista+ has been shipping with TCM enabled at 100% since M24 and
214 // The blacklist check above takes care of returning false before this hits
215 // on unsupported Win versions.
216 return true;
217 #endif
218
219 return false;
220 } 209 }
221 210
222 bool IsForceCompositingModeEnabled() { 211 bool IsForceCompositingModeEnabled() {
223 // Force compositing mode is a subset of threaded compositing mode. 212 // Force compositing mode is a subset of threaded compositing mode.
224 if (IsThreadedCompositingEnabled()) 213 if (IsThreadedCompositingEnabled())
225 return true; 214 return true;
226 215
227 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 216 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
228 217
229 // Command line switches take precedence over blacklisting. 218 // Command line switches take precedence over blacklisting.
230 if (command_line.HasSwitch(switches::kDisableForceCompositingMode)) 219 if (command_line.HasSwitch(switches::kDisableForceCompositingMode))
231 return false; 220 return false;
232 else if (command_line.HasSwitch(switches::kForceCompositingMode)) 221 if (command_line.HasSwitch(switches::kForceCompositingMode))
233 return true; 222 return true;
234 223
235 if (!CanDoAcceleratedCompositing() || IsForceCompositingModeBlacklisted()) 224 if (!CanDoAcceleratedCompositing() || IsForceCompositingModeBlacklisted())
236 return false; 225 return false;
237 226
238 #if defined(OS_MACOSX) || defined(OS_WIN) 227 #if defined(OS_MACOSX) || defined(OS_WIN)
239 // Windows Vista+ has been shipping with TCM enabled at 100% since M24 and 228 // Windows Vista+ has been shipping with TCM enabled at 100% since M24 and
240 // Mac OSX 10.8+ since M28. The blacklist check above takes care of returning 229 // Mac OSX 10.8+ since M28. The blacklist check above takes care of returning
241 // false before this hits on unsupported Win/Mac versions. 230 // false before this hits on unsupported Win/Mac versions.
242 return true; 231 return true;
232 #else
233 return false;
243 #endif 234 #endif
244
245 return false;
246 } 235 }
247 236
248 bool IsDelegatedRendererEnabled() { 237 bool IsDelegatedRendererEnabled() {
249 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 238 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
250 bool enabled = false; 239 bool enabled = false;
251 240
252 #if defined(USE_AURA) 241 #if defined(USE_AURA)
253 // Enable on Aura. 242 // Enable on Aura.
254 enabled = true; 243 enabled = true;
255 #endif 244 #endif
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 return problem_list; 386 return problem_list;
398 } 387 }
399 388
400 base::Value* GetDriverBugWorkarounds() { 389 base::Value* GetDriverBugWorkarounds() {
401 base::ListValue* workaround_list = new base::ListValue(); 390 base::ListValue* workaround_list = new base::ListValue();
402 GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(workaround_list); 391 GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(workaround_list);
403 return workaround_list; 392 return workaround_list;
404 } 393 }
405 394
406 } // namespace content 395 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/dom_storage/dom_storage_database.cc ('k') | content/browser/indexed_db/indexed_db_leveldb_coding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698