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

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

Issue 1986843003: Add feature for main frame before activation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error Created 4 years, 7 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h"
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/metrics/field_trial.h" 13 #include "base/metrics/field_trial.h"
13 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
14 #include "base/sys_info.h" 15 #include "base/sys_info.h"
15 #include "build/build_config.h" 16 #include "build/build_config.h"
16 #include "cc/base/math_util.h" 17 #include "cc/base/math_util.h"
17 #include "cc/base/switches.h" 18 #include "cc/base/switches.h"
18 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 19 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
19 #include "content/browser/gpu/gpu_data_manager_impl.h" 20 #include "content/browser/gpu/gpu_data_manager_impl.h"
21 #include "content/public/common/content_features.h"
20 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
21 #include "gpu/config/gpu_feature_type.h" 23 #include "gpu/config/gpu_feature_type.h"
22 24
23 namespace content { 25 namespace content {
24 26
25 namespace { 27 namespace {
26 28
27 static bool IsGpuRasterizationBlacklisted() { 29 static bool IsGpuRasterizationBlacklisted() {
28 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); 30 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
29 return manager->IsFeatureBlacklisted( 31 return manager->IsFeatureBlacklisted(
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 msaa_sample_count >= kMinMSAASampleCount) { 276 msaa_sample_count >= kMinMSAASampleCount) {
275 return msaa_sample_count; 277 return msaa_sample_count;
276 } else { 278 } else {
277 DLOG(WARNING) << "Failed to parse switch " 279 DLOG(WARNING) << "Failed to parse switch "
278 << switches::kGpuRasterizationMSAASampleCount << ": " 280 << switches::kGpuRasterizationMSAASampleCount << ": "
279 << string_value; 281 << string_value;
280 return 0; 282 return 0;
281 } 283 }
282 } 284 }
283 285
286 bool IsMainFrameBeforeActivationEnabled() {
287 if (base::SysInfo::NumberOfProcessors() < 4)
288 return false;
289
290 const base::CommandLine& command_line =
291 *base::CommandLine::ForCurrentProcess();
292
293 if (command_line.HasSwitch(cc::switches::kDisableMainFrameBeforeActivation))
294 return false;
295
296 if (command_line.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation))
297 return true;
298
299 return base::FeatureList::IsEnabled(features::kMainFrameBeforeActivation);
300 }
301
284 base::DictionaryValue* GetFeatureStatus() { 302 base::DictionaryValue* GetFeatureStatus() {
285 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); 303 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
286 std::string gpu_access_blocked_reason; 304 std::string gpu_access_blocked_reason;
287 bool gpu_access_blocked = 305 bool gpu_access_blocked =
288 !manager->GpuAccessAllowed(&gpu_access_blocked_reason); 306 !manager->GpuAccessAllowed(&gpu_access_blocked_reason);
289 307
290 base::DictionaryValue* feature_status_dict = new base::DictionaryValue(); 308 base::DictionaryValue* feature_status_dict = new base::DictionaryValue();
291 309
292 bool eof = false; 310 bool eof = false;
293 for (size_t i = 0; !eof; ++i) { 311 for (size_t i = 0; !eof; ++i) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 } 393 }
376 } 394 }
377 return problem_list; 395 return problem_list;
378 } 396 }
379 397
380 std::vector<std::string> GetDriverBugWorkarounds() { 398 std::vector<std::string> GetDriverBugWorkarounds() {
381 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); 399 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds();
382 } 400 }
383 401
384 } // namespace content 402 } // 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