| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/gpu_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
| 46 #include <ApplicationServices/ApplicationServices.h> | 46 #include <ApplicationServices/ApplicationServices.h> |
| 47 #endif // OS_MACOSX | 47 #endif // OS_MACOSX |
| 48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 49 #include "base/win/windows_version.h" | 49 #include "base/win/windows_version.h" |
| 50 #endif // OS_WIN | 50 #endif // OS_WIN |
| 51 #if defined(OS_ANDROID) | 51 #if defined(OS_ANDROID) |
| 52 #include "ui/gfx/android/device_display_info.h" | 52 #include "ui/gfx/android/device_display_info.h" |
| 53 #endif // OS_ANDROID | 53 #endif // OS_ANDROID |
| 54 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 54 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
| 55 #include "components/mus/common/gpu_service.h" |
| 55 #include "services/shell/runner/common/client_util.h" | 56 #include "services/shell/runner/common/client_util.h" |
| 56 #endif | 57 #endif |
| 57 | 58 |
| 58 namespace content { | 59 namespace content { |
| 59 | 60 |
| 60 namespace { | 61 namespace { |
| 61 | 62 |
| 62 enum GpuFeatureStatus { | 63 enum GpuFeatureStatus { |
| 63 kGpuFeatureEnabled = 0, | 64 kGpuFeatureEnabled = 0, |
| 64 kGpuFeatureBlacklisted = 1, | 65 kGpuFeatureBlacklisted = 1, |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 enum BlockStatusHistogram { | 264 enum BlockStatusHistogram { |
| 264 BLOCK_STATUS_NOT_BLOCKED, | 265 BLOCK_STATUS_NOT_BLOCKED, |
| 265 BLOCK_STATUS_SPECIFIC_DOMAIN_BLOCKED, | 266 BLOCK_STATUS_SPECIFIC_DOMAIN_BLOCKED, |
| 266 BLOCK_STATUS_ALL_DOMAINS_BLOCKED, | 267 BLOCK_STATUS_ALL_DOMAINS_BLOCKED, |
| 267 BLOCK_STATUS_MAX | 268 BLOCK_STATUS_MAX |
| 268 }; | 269 }; |
| 269 | 270 |
| 270 bool ShouldDisableHardwareAcceleration() { | 271 bool ShouldDisableHardwareAcceleration() { |
| 271 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) | 272 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
| 272 // TODO(rjkroege): Remove this when https://crbug.com/602519 is fixed. | 273 // TODO(rjkroege): Remove this when https://crbug.com/602519 is fixed. |
| 273 if (shell::ShellIsRemote()) | 274 if (shell::ShellIsRemote() && !mus::GpuService::UseChromeGpuCommandBuffer()) |
| 274 return true; | 275 return true; |
| 275 #endif | 276 #endif |
| 276 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 277 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 277 switches::kDisableGpu); | 278 switches::kDisableGpu); |
| 278 } | 279 } |
| 279 | 280 |
| 280 } // namespace anonymous | 281 } // namespace anonymous |
| 281 | 282 |
| 282 void GpuDataManagerImplPrivate::InitializeForTesting( | 283 void GpuDataManagerImplPrivate::InitializeForTesting( |
| 283 const std::string& gpu_blacklist_json, | 284 const std::string& gpu_blacklist_json, |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 UpdateGpuInfoHelper(); | 971 UpdateGpuInfoHelper(); |
| 971 return true; | 972 return true; |
| 972 } | 973 } |
| 973 | 974 |
| 974 bool GpuDataManagerImplPrivate::CanUseGpuBrowserCompositor() const { | 975 bool GpuDataManagerImplPrivate::CanUseGpuBrowserCompositor() const { |
| 975 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 976 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 976 switches::kDisableGpuCompositing)) | 977 switches::kDisableGpuCompositing)) |
| 977 return false; | 978 return false; |
| 978 if (ShouldUseSwiftShader()) | 979 if (ShouldUseSwiftShader()) |
| 979 return false; | 980 return false; |
| 980 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING)) | 981 // if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING)) |
| 981 return false; | 982 // return false; |
| 982 return true; | 983 return true; |
| 983 } | 984 } |
| 984 | 985 |
| 985 | 986 |
| 986 bool GpuDataManagerImplPrivate::ShouldDisableAcceleratedVideoDecode( | 987 bool GpuDataManagerImplPrivate::ShouldDisableAcceleratedVideoDecode( |
| 987 const base::CommandLine* command_line) const { | 988 const base::CommandLine* command_line) const { |
| 988 // Make sure that we initialize the experiment first to make sure that | 989 // Make sure that we initialize the experiment first to make sure that |
| 989 // statistics are bucket correctly in all cases. | 990 // statistics are bucket correctly in all cases. |
| 990 // This experiment is temporary and will be removed once enough data | 991 // This experiment is temporary and will be removed once enough data |
| 991 // to resolve crbug/442039 has been collected. | 992 // to resolve crbug/442039 has been collected. |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1284 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1285 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1285 #if defined(OS_WIN) | 1286 #if defined(OS_WIN) |
| 1286 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1287 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1287 #endif | 1288 #endif |
| 1288 complete_gpu_info_already_requested_ = true; | 1289 complete_gpu_info_already_requested_ = true; |
| 1289 // Some observers might be waiting. | 1290 // Some observers might be waiting. |
| 1290 NotifyGpuInfoUpdate(); | 1291 NotifyGpuInfoUpdate(); |
| 1291 } | 1292 } |
| 1292 | 1293 |
| 1293 } // namespace content | 1294 } // namespace content |
| OLD | NEW |