зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1240180 - Optimize native theme scaling for the single-monitor case. r=emk
This commit is contained in:
Родитель
42564dac5c
Коммит
7c5888a083
|
@ -1550,13 +1550,18 @@ AssumeThemePartAndStateAreTransparent(int32_t aPart, int32_t aState)
|
|||
// with a different DPI setting from the system's primary monitor, we need to
|
||||
// apply scaling to native-themed elements as the Windows theme APIs assume
|
||||
// the primary monitor's resolution.
|
||||
static double
|
||||
static inline double
|
||||
GetThemeDpiScaleFactor(nsIFrame* aFrame)
|
||||
{
|
||||
double primaryScale =
|
||||
WinUtils::LogToPhysFactor(WinUtils::GetPrimaryMonitor());
|
||||
nsIWidget* rootWidget = aFrame->PresContext()->GetRootWidget();
|
||||
return rootWidget ? rootWidget->GetDefaultScale().scale / primaryScale : 1.0;
|
||||
if (WinUtils::IsPerMonitorDPIAware() && GetSystemMetrics(SM_CMONITORS) > 1) {
|
||||
nsIWidget* rootWidget = aFrame->PresContext()->GetRootWidget();
|
||||
if (rootWidget) {
|
||||
double primaryScale =
|
||||
WinUtils::LogToPhysFactor(WinUtils::GetPrimaryMonitor());
|
||||
return rootWidget->GetDefaultScale().scale / primaryScale;
|
||||
}
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче