Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: content/browser/gpu/gpu_internals_ui.cc

Issue 1563183008: Added capability on Windows to get the physical dimensions of your attached monitors. Also added th… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gn build and applied guid brace warning fix Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698