Chromium Code Reviews| Index: content/browser/gpu/gpu_internals_ui.cc |
| diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc |
| index e93c9015202ee9fd528180814c4897c98cb52c15..e8ddf3b565abe6e39176aef2ef25c2a3dda3c410 100644 |
| --- a/content/browser/gpu/gpu_internals_ui.cc |
| +++ b/content/browser/gpu/gpu_internals_ui.cc |
| @@ -42,6 +42,7 @@ |
| #endif |
| #if defined(OS_WIN) |
| #include "ui/base/win/shell.h" |
| +#include "ui/gfx/win/physical_size.h" |
| #endif |
| #if defined(OS_LINUX) && defined(USE_X11) |
| @@ -148,6 +149,21 @@ base::DictionaryValue* GpuInfoAsDictionaryValue() { |
| basic_info->Append(NewDescriptionValuePair("Using WARP", |
| new base::FundamentalValue(true))); |
| } |
| + |
| + std::vector<gfx::PhysicalDisplaySize> display_sizes; |
| + gfx::GetPhysicalSizeForDisplays(&display_sizes); |
| + for (const auto& display_size : display_sizes) { |
| + int w = display_size.width_mm; |
| + int h = display_size.height_mm; |
| + double size_mm = sqrt(w * w + h * h); |
|
scottmg
2016/01/12 01:03:13
Optional nit: Since these are just breaking up a c
Bret
2016/01/12 22:55:17
Done.
|
| + double size_inches = 0.0393701 * size_mm; |
| + double rounded_size_inches = floor(10.0 * size_inches) / 10.0; |
| + std::string size_string = base::StringPrintf("%.1f\"", rounded_size_inches); |
| + std::string description_string = base::StringPrintf( |
| + "Diagonal Monitor Size of %s", display_size.display_name.c_str()); |
| + basic_info->Append( |
| + NewDescriptionValuePair(description_string, size_string)); |
| + } |
| #endif |
| std::string disabled_extensions; |