8158411: Regression on Swingmark on 8u102 b03 comparing 8u102 b02 on several configs on win32
Reviewed-by: prr, ssadetsky
This commit is contained in:
parent
252779d212
commit
6d5b6597cd
@ -753,10 +753,15 @@ JNIEXPORT jobject JNICALL Java_sun_awt_windows_ThemeReader_getPosition
|
||||
}
|
||||
|
||||
void rescale(SIZE *size) {
|
||||
HWND hWnd = ::GetDesktopWindow();
|
||||
HDC hDC = ::GetDC(hWnd);
|
||||
int dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
|
||||
int dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
|
||||
static int dpiX = -1;
|
||||
static int dpiY = -1;
|
||||
if (dpiX == -1 || dpiY == -1) {
|
||||
HWND hWnd = ::GetDesktopWindow();
|
||||
HDC hDC = ::GetDC(hWnd);
|
||||
dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
|
||||
dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
|
||||
::ReleaseDC(hWnd, hDC);
|
||||
}
|
||||
|
||||
if (dpiX !=0 && dpiX != 96) {
|
||||
float invScaleX = 96.0f / dpiX;
|
||||
@ -766,7 +771,6 @@ void rescale(SIZE *size) {
|
||||
float invScaleY = 96.0f / dpiY;
|
||||
size->cy = ROUND_TO_INT(size->cy * invScaleY);
|
||||
}
|
||||
::ReleaseDC(hWnd, hDC);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -88,11 +88,16 @@ void AwtDesktopProperties::GetWindowsParameters() {
|
||||
}
|
||||
|
||||
void getInvScale(float &invScaleX, float &invScaleY) {
|
||||
HWND hWnd = ::GetDesktopWindow();
|
||||
HDC hDC = ::GetDC(hWnd);
|
||||
int dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
|
||||
int dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
|
||||
::ReleaseDC(hWnd, hDC);
|
||||
static int dpiX = -1;
|
||||
static int dpiY = -1;
|
||||
if (dpiX == -1 || dpiY == -1) {
|
||||
HWND hWnd = ::GetDesktopWindow();
|
||||
HDC hDC = ::GetDC(hWnd);
|
||||
dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
|
||||
dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
|
||||
::ReleaseDC(hWnd, hDC);
|
||||
}
|
||||
|
||||
invScaleX = (dpiX == 0.0f) ? 1.0f : 96.0f / dpiX;
|
||||
invScaleY = (dpiY == 0.0f) ? 1.0f : 96.0f / dpiY;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user