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" | |
46 #endif | 45 #endif |
47 | 46 |
48 #if defined(OS_LINUX) && defined(USE_X11) | 47 #if defined(OS_LINUX) && defined(USE_X11) |
49 #include "ui/base/x/x11_util.h" | 48 #include "ui/base/x/x11_util.h" |
50 #include "ui/gfx/x/x11_atom_cache.h" | 49 #include "ui/gfx/x/x11_atom_cache.h" |
51 #endif | 50 #endif |
52 | 51 |
53 namespace content { | 52 namespace content { |
54 namespace { | 53 namespace { |
55 | 54 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 141 } |
143 #if defined(OS_WIN) | 142 #if defined(OS_WIN) |
144 std::string compositor = | 143 std::string compositor = |
145 ui::win::IsAeroGlassEnabled() ? "Aero Glass" : "none"; | 144 ui::win::IsAeroGlassEnabled() ? "Aero Glass" : "none"; |
146 basic_info->Append( | 145 basic_info->Append( |
147 NewDescriptionValuePair("Desktop compositing", compositor)); | 146 NewDescriptionValuePair("Desktop compositing", compositor)); |
148 if (GpuDataManagerImpl::GetInstance()->ShouldUseWarp()) { | 147 if (GpuDataManagerImpl::GetInstance()->ShouldUseWarp()) { |
149 basic_info->Append(NewDescriptionValuePair("Using WARP", | 148 basic_info->Append(NewDescriptionValuePair("Using WARP", |
150 new base::FundamentalValue(true))); | 149 new base::FundamentalValue(true))); |
151 } | 150 } |
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 } | |
167 #endif | 151 #endif |
168 | 152 |
169 std::string disabled_extensions; | 153 std::string disabled_extensions; |
170 GpuDataManagerImpl::GetInstance()->GetDisabledExtensions( | 154 GpuDataManagerImpl::GetInstance()->GetDisabledExtensions( |
171 &disabled_extensions); | 155 &disabled_extensions); |
172 | 156 |
173 basic_info->Append( | 157 basic_info->Append( |
174 NewDescriptionValuePair("Driver vendor", gpu_info.driver_vendor)); | 158 NewDescriptionValuePair("Driver vendor", gpu_info.driver_vendor)); |
175 basic_info->Append(NewDescriptionValuePair("Driver version", | 159 basic_info->Append(NewDescriptionValuePair("Driver version", |
176 gpu_info.driver_version)); | 160 gpu_info.driver_version)); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 : WebUIController(web_ui) { | 523 : WebUIController(web_ui) { |
540 web_ui->AddMessageHandler(new GpuMessageHandler()); | 524 web_ui->AddMessageHandler(new GpuMessageHandler()); |
541 | 525 |
542 // Set up the chrome://gpu/ source. | 526 // Set up the chrome://gpu/ source. |
543 BrowserContext* browser_context = | 527 BrowserContext* browser_context = |
544 web_ui->GetWebContents()->GetBrowserContext(); | 528 web_ui->GetWebContents()->GetBrowserContext(); |
545 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 529 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
546 } | 530 } |
547 | 531 |
548 } // namespace content | 532 } // namespace content |
OLD | NEW |