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

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

Issue 11361077: Disable threaded compositing when texture sharing is blacklisted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix include path Created 8 years, 1 month 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/public/browser/compositor_util.h" 5 #include "content/public/browser/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 29 matching lines...) Expand all
40 40
41 bool IsThreadedCompositingEnabled() { 41 bool IsThreadedCompositingEnabled() {
42 #if defined(OS_WIN) && defined(USE_AURA) 42 #if defined(OS_WIN) && defined(USE_AURA)
43 // We always want compositing on Aura Windows. 43 // We always want compositing on Aura Windows.
44 return true; 44 return true;
45 #endif 45 #endif
46 46
47 if (!CanDoAcceleratedCompositing()) 47 if (!CanDoAcceleratedCompositing())
48 return false; 48 return false;
49 49
50 const GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance();
51 GpuFeatureType blacklisted_features =
52 gpu_data_manager->GetBlacklistedFeatures();
53 // Disallow threaded compositing when texture sharing is blacklisted since
54 // this triggers renderer-side readbacks for the thumbnailer / extensions.
55 // http://crbug.com/158747
56 if (blacklisted_features & GPU_FEATURE_TYPE_TEXTURE_SHARING)
57 return false;
58
50 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 59 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
51 60
52 // Command line switches take precedence over field trials. 61 // Command line switches take precedence over field trials.
53 if (command_line.HasSwitch(switches::kDisableForceCompositingMode) || 62 if (command_line.HasSwitch(switches::kDisableForceCompositingMode) ||
54 command_line.HasSwitch(switches::kDisableThreadedCompositing)) 63 command_line.HasSwitch(switches::kDisableThreadedCompositing))
55 return false; 64 return false;
56 65
57 if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) 66 if (command_line.HasSwitch(switches::kEnableThreadedCompositing))
58 return true; 67 return true;
59 68
(...skipping 26 matching lines...) Expand all
86 95
87 // Force compositing is enabled in both the force compositing 96 // Force compositing is enabled in both the force compositing
88 // and threaded compositing mode field trials. 97 // and threaded compositing mode field trials.
89 return trial && 98 return trial &&
90 (trial->group_name() == 99 (trial->group_name() ==
91 kGpuCompositingFieldTrialForceCompositingEnabledName || 100 kGpuCompositingFieldTrialForceCompositingEnabledName ||
92 trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName); 101 trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName);
93 } 102 }
94 103
95 } // namespace content 104 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/gpu/gpu_feature_browsertest.cc ('k') | webkit/compositor_bindings/web_compositor_support_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698