| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 bool IsThreadedCompositingEnabled() { | 43 bool IsThreadedCompositingEnabled() { |
| 44 #if defined(OS_WIN) && defined(USE_AURA) | 44 #if defined(OS_WIN) && defined(USE_AURA) |
| 45 // We always want compositing on Aura Windows. | 45 // We always want compositing on Aura Windows. |
| 46 return true; | 46 return true; |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 if (!CanDoAcceleratedCompositing()) | 49 if (!CanDoAcceleratedCompositing()) |
| 50 return false; | 50 return false; |
| 51 | 51 |
| 52 const GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance(); |
| 53 GpuFeatureType blacklisted_features = |
| 54 gpu_data_manager->GetBlacklistedFeatures(); |
| 55 // Disallow threaded compositing when texture sharing is blacklisted since |
| 56 // this triggers renderer-side readbacks for the thumbnailer / extensions. |
| 57 // http://crbug.com/158747 |
| 58 if (blacklisted_features & GPU_FEATURE_TYPE_TEXTURE_SHARING) |
| 59 return false; |
| 60 |
| 52 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 61 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 53 | 62 |
| 54 // Command line switches take precedence over field trials. | 63 // Command line switches take precedence over field trials. |
| 55 if (command_line.HasSwitch(switches::kDisableForceCompositingMode) || | 64 if (command_line.HasSwitch(switches::kDisableForceCompositingMode) || |
| 56 command_line.HasSwitch(switches::kDisableThreadedCompositing)) | 65 command_line.HasSwitch(switches::kDisableThreadedCompositing)) |
| 57 return false; | 66 return false; |
| 58 | 67 |
| 59 if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) | 68 if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) |
| 60 return true; | 69 return true; |
| 61 | 70 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 90 // Force compositing is enabled in both the force compositing | 99 // Force compositing is enabled in both the force compositing |
| 91 // and threaded compositing mode field trials. | 100 // and threaded compositing mode field trials. |
| 92 return trial && | 101 return trial && |
| 93 (trial->group_name() == | 102 (trial->group_name() == |
| 94 content::kGpuCompositingFieldTrialForceCompositingEnabledName || | 103 content::kGpuCompositingFieldTrialForceCompositingEnabledName || |
| 95 trial->group_name() == | 104 trial->group_name() == |
| 96 content::kGpuCompositingFieldTrialThreadEnabledName); | 105 content::kGpuCompositingFieldTrialThreadEnabledName); |
| 97 } | 106 } |
| 98 | 107 |
| 99 } // namespace content | 108 } // namespace content |
| OLD | NEW |