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

Side by Side Diff: ui/gl/gl_surface_win.cc

Issue 613033002: Filled in missing dmSize, dmDriverExtra values for EnumDisplaySettings call (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | no next file » | 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 "ui/gl/gl_surface.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // favor the DWM value because any additional frames produced will be 111 // favor the DWM value because any additional frames produced will be
112 // discarded by the OS. If the display refresh rate is lower, however, we 112 // discarded by the OS. If the display refresh rate is lower, however, we
113 // can use that to limit the frames we produce more intelligently. 113 // can use that to limit the frames we produce more intelligently.
114 // If DWM compositing is not active we will always use the display refresh. 114 // If DWM compositing is not active we will always use the display refresh.
115 HMONITOR monitor = MonitorFromWindow(window_, MONITOR_DEFAULTTONEAREST); 115 HMONITOR monitor = MonitorFromWindow(window_, MONITOR_DEFAULTTONEAREST);
116 MONITORINFOEX monitor_info; 116 MONITORINFOEX monitor_info;
117 monitor_info.cbSize = sizeof(MONITORINFOEX); 117 monitor_info.cbSize = sizeof(MONITORINFOEX);
118 BOOL result = GetMonitorInfo(monitor, &monitor_info); 118 BOOL result = GetMonitorInfo(monitor, &monitor_info);
119 if (result) { 119 if (result) {
120 DEVMODE display_info; 120 DEVMODE display_info;
121 display_info.dmSize = sizeof(DEVMODE);
122 display_info.dmDriverExtra = 0;
121 result = EnumDisplaySettings(monitor_info.szDevice, ENUM_CURRENT_SETTINGS, 123 result = EnumDisplaySettings(monitor_info.szDevice, ENUM_CURRENT_SETTINGS,
122 &display_info); 124 &display_info);
123 if (result && display_info.dmDisplayFrequency > 1) { 125 if (result && display_info.dmDisplayFrequency > 1) {
124 base::TimeDelta display_interval = base::TimeDelta::FromMicroseconds( 126 base::TimeDelta display_interval = base::TimeDelta::FromMicroseconds(
125 (1.0 / static_cast<double>(display_info.dmDisplayFrequency)) * 127 (1.0 / static_cast<double>(display_info.dmDisplayFrequency)) *
126 base::Time::kMicrosecondsPerSecond); 128 base::Time::kMicrosecondsPerSecond);
127 129
128 if (!dwm_active || display_interval > interval) { 130 if (!dwm_active || display_interval > interval) {
129 interval = display_interval; 131 interval = display_interval;
130 } 132 }
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 349 }
348 350
349 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 351 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
350 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11) || 352 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11) ||
351 CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp)) 353 CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp))
352 return GetDC(NULL); 354 return GetDC(NULL);
353 return EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE; 355 return EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE;
354 } 356 }
355 357
356 } // namespace gfx 358 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698