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
jdk/src/java.desktop/windows/native/libawt/windows
@ -753,10 +753,15 @@ JNIEXPORT jobject JNICALL Java_sun_awt_windows_ThemeReader_getPosition
|
|||||||
}
|
}
|
||||||
|
|
||||||
void rescale(SIZE *size) {
|
void rescale(SIZE *size) {
|
||||||
HWND hWnd = ::GetDesktopWindow();
|
static int dpiX = -1;
|
||||||
HDC hDC = ::GetDC(hWnd);
|
static int dpiY = -1;
|
||||||
int dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
|
if (dpiX == -1 || dpiY == -1) {
|
||||||
int dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
|
HWND hWnd = ::GetDesktopWindow();
|
||||||
|
HDC hDC = ::GetDC(hWnd);
|
||||||
|
dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
|
||||||
|
dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
|
||||||
|
::ReleaseDC(hWnd, hDC);
|
||||||
|
}
|
||||||
|
|
||||||
if (dpiX !=0 && dpiX != 96) {
|
if (dpiX !=0 && dpiX != 96) {
|
||||||
float invScaleX = 96.0f / dpiX;
|
float invScaleX = 96.0f / dpiX;
|
||||||
@ -766,7 +771,6 @@ void rescale(SIZE *size) {
|
|||||||
float invScaleY = 96.0f / dpiY;
|
float invScaleY = 96.0f / dpiY;
|
||||||
size->cy = ROUND_TO_INT(size->cy * invScaleY);
|
size->cy = ROUND_TO_INT(size->cy * invScaleY);
|
||||||
}
|
}
|
||||||
::ReleaseDC(hWnd, hDC);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -88,11 +88,16 @@ void AwtDesktopProperties::GetWindowsParameters() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void getInvScale(float &invScaleX, float &invScaleY) {
|
void getInvScale(float &invScaleX, float &invScaleY) {
|
||||||
HWND hWnd = ::GetDesktopWindow();
|
static int dpiX = -1;
|
||||||
HDC hDC = ::GetDC(hWnd);
|
static int dpiY = -1;
|
||||||
int dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
|
if (dpiX == -1 || dpiY == -1) {
|
||||||
int dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
|
HWND hWnd = ::GetDesktopWindow();
|
||||||
::ReleaseDC(hWnd, hDC);
|
HDC hDC = ::GetDC(hWnd);
|
||||||
|
dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
|
||||||
|
dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
|
||||||
|
::ReleaseDC(hWnd, hDC);
|
||||||
|
}
|
||||||
|
|
||||||
invScaleX = (dpiX == 0.0f) ? 1.0f : 96.0f / dpiX;
|
invScaleX = (dpiX == 0.0f) ? 1.0f : 96.0f / dpiX;
|
||||||
invScaleY = (dpiY == 0.0f) ? 1.0f : 96.0f / dpiY;
|
invScaleY = (dpiY == 0.0f) ? 1.0f : 96.0f / dpiY;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user