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/browser/gpu/gpu_internals_ui.h" | 5 #include "content/browser/gpu/gpu_internals_ui.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "gpu/config/gpu_feature_type.h" | 35 #include "gpu/config/gpu_feature_type.h" |
36 #include "gpu/config/gpu_info.h" | 36 #include "gpu/config/gpu_info.h" |
37 #include "third_party/angle/src/common/version.h" | 37 #include "third_party/angle/src/common/version.h" |
38 #include "ui/gl/gpu_switching_manager.h" | 38 #include "ui/gl/gpu_switching_manager.h" |
39 | 39 |
40 #if defined(OS_LINUX) && defined(USE_X11) | 40 #if defined(OS_LINUX) && defined(USE_X11) |
41 #include <X11/Xlib.h> | 41 #include <X11/Xlib.h> |
42 #endif | 42 #endif |
43 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
44 #include "ui/base/win/shell.h" | 44 #include "ui/base/win/shell.h" |
| 45 #include "ui/gfx/win/physical_size.h" |
45 #endif | 46 #endif |
46 | 47 |
47 #if defined(OS_LINUX) && defined(USE_X11) | 48 #if defined(OS_LINUX) && defined(USE_X11) |
48 #include "ui/base/x/x11_util.h" | 49 #include "ui/base/x/x11_util.h" |
49 #include "ui/gfx/x/x11_atom_cache.h" | 50 #include "ui/gfx/x/x11_atom_cache.h" |
50 #endif | 51 #endif |
51 | 52 |
52 namespace content { | 53 namespace content { |
53 namespace { | 54 namespace { |
54 | 55 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 142 } |
142 #if defined(OS_WIN) | 143 #if defined(OS_WIN) |
143 std::string compositor = | 144 std::string compositor = |
144 ui::win::IsAeroGlassEnabled() ? "Aero Glass" : "none"; | 145 ui::win::IsAeroGlassEnabled() ? "Aero Glass" : "none"; |
145 basic_info->Append( | 146 basic_info->Append( |
146 NewDescriptionValuePair("Desktop compositing", compositor)); | 147 NewDescriptionValuePair("Desktop compositing", compositor)); |
147 if (GpuDataManagerImpl::GetInstance()->ShouldUseWarp()) { | 148 if (GpuDataManagerImpl::GetInstance()->ShouldUseWarp()) { |
148 basic_info->Append(NewDescriptionValuePair("Using WARP", | 149 basic_info->Append(NewDescriptionValuePair("Using WARP", |
149 new base::FundamentalValue(true))); | 150 new base::FundamentalValue(true))); |
150 } | 151 } |
| 152 |
| 153 std::vector<gfx::PhysicalDisplaySize> display_sizes = |
| 154 gfx::GetPhysicalSizeForDisplays(); |
| 155 for (const auto& display_size : display_sizes) { |
| 156 const int w = display_size.width_mm; |
| 157 const int h = display_size.height_mm; |
| 158 const double size_mm = sqrt(w * w + h * h); |
| 159 const double size_inches = 0.0393701 * size_mm; |
| 160 const double rounded_size_inches = floor(10.0 * size_inches) / 10.0; |
| 161 std::string size_string = base::StringPrintf("%.1f\"", rounded_size_inches); |
| 162 std::string description_string = base::StringPrintf( |
| 163 "Diagonal Monitor Size of %s", display_size.display_name.c_str()); |
| 164 basic_info->Append( |
| 165 NewDescriptionValuePair(description_string, size_string)); |
| 166 } |
151 #endif | 167 #endif |
152 | 168 |
153 std::string disabled_extensions; | 169 std::string disabled_extensions; |
154 GpuDataManagerImpl::GetInstance()->GetDisabledExtensions( | 170 GpuDataManagerImpl::GetInstance()->GetDisabledExtensions( |
155 &disabled_extensions); | 171 &disabled_extensions); |
156 | 172 |
157 basic_info->Append( | 173 basic_info->Append( |
158 NewDescriptionValuePair("Driver vendor", gpu_info.driver_vendor)); | 174 NewDescriptionValuePair("Driver vendor", gpu_info.driver_vendor)); |
159 basic_info->Append(NewDescriptionValuePair("Driver version", | 175 basic_info->Append(NewDescriptionValuePair("Driver version", |
160 gpu_info.driver_version)); | 176 gpu_info.driver_version)); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 : WebUIController(web_ui) { | 539 : WebUIController(web_ui) { |
524 web_ui->AddMessageHandler(new GpuMessageHandler()); | 540 web_ui->AddMessageHandler(new GpuMessageHandler()); |
525 | 541 |
526 // Set up the chrome://gpu/ source. | 542 // Set up the chrome://gpu/ source. |
527 BrowserContext* browser_context = | 543 BrowserContext* browser_context = |
528 web_ui->GetWebContents()->GetBrowserContext(); | 544 web_ui->GetWebContents()->GetBrowserContext(); |
529 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 545 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
530 } | 546 } |
531 | 547 |
532 } // namespace content | 548 } // namespace content |
OLD | NEW |