< prev index next >
src/java.desktop/windows/native/libfontmanager/lcdglyph.c
Print this page
*** 155,164 ****
--- 155,167 ----
DeleteObject(hMemoryDC); \
} \
if (hBitmap != 0) { \
DeleteObject(hBitmap); \
} \
+ if (tmpBitmap != 0) { \
+ DeleteObject(tmpBitmap); \
+ } \
if (dibImage != NULL) { \
free(dibImage); \
} \
if (glyphInfo != NULL) { \
free(glyphInfo); \
*** 194,203 ****
--- 197,207 ----
int topLeftY;
int err;
int bmWidth, bmHeight;
int x, y;
HBITMAP hBitmap = NULL, hOrigBM;
+ HBITMAP tmpBitmap = NULL;
int gamma, orient;
HWND hWnd = NULL;
HDC hDesktopDC = NULL;
HDC hMemoryDC = NULL;
*** 248,257 ****
--- 252,267 ----
if (hFont == NULL) {
FREE_AND_RETURN;
}
oldFont = SelectObject(hMemoryDC, hFont);
+ tmpBitmap = CreateCompatibleBitmap(hDesktopDC, 1, 1);
+ if (tmpBitmap == NULL) {
+ FREE_AND_RETURN;
+ }
+ hOrigBM = (HBITMAP)SelectObject(hMemoryDC, tmpBitmap);
+
memset(&textMetric, 0, sizeof(TEXTMETRIC));
err = GetTextMetrics(hMemoryDC, &textMetric);
if (err == 0) {
FREE_AND_RETURN;
}
*** 332,342 ****
/* Must use desktop DC to create a bitmap of that depth */
hBitmap = CreateCompatibleBitmap(hDesktopDC, bmWidth, bmHeight);
if (hBitmap == NULL) {
FREE_AND_RETURN;
}
! hOrigBM = (HBITMAP)SelectObject(hMemoryDC, hBitmap);
/* Fill in black */
rect.left = 0;
rect.top = 0;
rect.right = bmWidth;
--- 342,352 ----
/* Must use desktop DC to create a bitmap of that depth */
hBitmap = CreateCompatibleBitmap(hDesktopDC, bmWidth, bmHeight);
if (hBitmap == NULL) {
FREE_AND_RETURN;
}
! SelectObject(hMemoryDC, hBitmap);
/* Fill in black */
rect.left = 0;
rect.top = 0;
rect.right = bmWidth;
*** 476,483 ****
--- 486,494 ----
free(dibImage);
ReleaseDC(hWnd, hDesktopDC);
DeleteObject(hMemoryDC);
DeleteObject(hBitmap);
+ DeleteObject(tmpBitmap);
return ptr_to_jlong(glyphInfo);
}
< prev index next >