| OLD | NEW |
| 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 Loading... |
| 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 | |
| 59 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 50 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 60 | 51 |
| 61 // Command line switches take precedence over field trials. | 52 // Command line switches take precedence over field trials. |
| 62 if (command_line.HasSwitch(switches::kDisableForceCompositingMode) || | 53 if (command_line.HasSwitch(switches::kDisableForceCompositingMode) || |
| 63 command_line.HasSwitch(switches::kDisableThreadedCompositing)) | 54 command_line.HasSwitch(switches::kDisableThreadedCompositing)) |
| 64 return false; | 55 return false; |
| 65 | 56 |
| 66 if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) | 57 if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) |
| 67 return true; | 58 return true; |
| 68 | 59 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 95 | 86 |
| 96 // Force compositing is enabled in both the force compositing | 87 // Force compositing is enabled in both the force compositing |
| 97 // and threaded compositing mode field trials. | 88 // and threaded compositing mode field trials. |
| 98 return trial && | 89 return trial && |
| 99 (trial->group_name() == | 90 (trial->group_name() == |
| 100 kGpuCompositingFieldTrialForceCompositingEnabledName || | 91 kGpuCompositingFieldTrialForceCompositingEnabledName || |
| 101 trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName); | 92 trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName); |
| 102 } | 93 } |
| 103 | 94 |
| 104 } // namespace content | 95 } // namespace content |
| OLD | NEW |