Avoid gdi32 calls.
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/gdi.c | 1 + dlls/winemac.drv/macdrv.h | 1 + dlls/winemac.drv/window.c | 9 ++------- 3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c index 673dca40270..151bb144da1 100644 --- a/dlls/winemac.drv/gdi.c +++ b/dlls/winemac.drv/gdi.c @@ -268,6 +268,7 @@ static const struct user_driver_funcs macdrv_funcs = .pClipCursor = macdrv_ClipCursor, .pCreateDesktopWindow = macdrv_CreateDesktopWindow, .pCreateWindow = macdrv_CreateWindow, + .pDesktopWindowProc = macdrv_DesktopWindowProc, .pDestroyCursorIcon = macdrv_DestroyCursorIcon, .pDestroyWindow = macdrv_DestroyWindow, .pEnumDisplaySettingsEx = macdrv_EnumDisplaySettingsEx, diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 71a8d9f5bd2..79ae074dac6 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -137,6 +137,7 @@ extern BOOL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_HIDDEN; extern BOOL macdrv_ClipCursor(LPCRECT clip) DECLSPEC_HIDDEN; extern BOOL macdrv_CreateDesktopWindow(HWND hwnd) DECLSPEC_HIDDEN; extern BOOL macdrv_CreateWindow(HWND hwnd) DECLSPEC_HIDDEN; +extern LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) DECLSPEC_HIDDEN; extern void macdrv_DestroyWindow(HWND hwnd) DECLSPEC_HIDDEN; extern void macdrv_SetFocus(HWND hwnd) DECLSPEC_HIDDEN; extern void macdrv_SetLayeredWindowAttributes(HWND hwnd, COLORREF key, BYTE alpha, diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 147c979ebde..d5bcce654e8 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1557,11 +1557,9 @@ BOOL macdrv_CreateDesktopWindow(HWND hwnd) }
-static WNDPROC desktop_orig_wndproc; - #define WM_WINE_NOTIFY_ACTIVITY WM_USER
-static LRESULT CALLBACK desktop_wndproc_wrapper( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) +LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { switch (msg) { @@ -1580,7 +1578,7 @@ static LRESULT CALLBACK desktop_wndproc_wrapper( HWND hwnd, UINT msg, WPARAM wp, break; } } - return desktop_orig_wndproc( hwnd, msg, wp, lp ); + return NtUserMessageCall(hwnd, msg, wp, lp, 0, NtUserDefWindowProc, FALSE); }
/********************************************************************** @@ -1590,9 +1588,6 @@ BOOL macdrv_CreateWindow(HWND hwnd) { if (hwnd == GetDesktopWindow()) { - desktop_orig_wndproc = (WNDPROC)SetWindowLongPtrW( GetDesktopWindow(), - GWLP_WNDPROC, (LONG_PTR)desktop_wndproc_wrapper ); - macdrv_init_clipboard(); } return TRUE;
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/image.c | 24 +++++++++++++----------- dlls/winemac.drv/macdrv.h | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/dlls/winemac.drv/image.c b/dlls/winemac.drv/image.c index e5f3a4c0fa6..d501b27a3c3 100644 --- a/dlls/winemac.drv/image.c +++ b/dlls/winemac.drv/image.c @@ -69,7 +69,7 @@ CGImageRef create_cgimage_from_icon_bitmaps(HDC hdc, HANDLE icon, HBITMAP hbmCol
/* draw the cursor frame to a temporary buffer then create a CGImage from that */ memset(color_bits, 0x00, color_size); - SelectObject(hdc, hbmColor); + NtGdiSelectBitmap(hdc, hbmColor); if (!DrawIconEx(hdc, 0, 0, icon, width, height, istep, NULL, DI_NORMAL)) { WARN("Could not draw frame %d (walk past end of frames).\n", istep); @@ -128,7 +128,7 @@ CGImageRef create_cgimage_from_icon_bitmaps(HDC hdc, HANDLE icon, HBITMAP hbmCol
/* draw the cursor mask to a temporary buffer */ memset(mask_bits, 0xFF, mask_size); - SelectObject(hdc, hbmMask); + NtGdiSelectBitmap(hdc, hbmMask); if (!DrawIconEx(hdc, 0, 0, icon, width, height, istep, NULL, DI_MASK)) { WARN("Failed to draw frame mask %d.\n", istep); @@ -202,17 +202,17 @@ CGImageRef create_cgimage_from_icon(HANDLE icon, int width, int height) if (!GetIconInfo(icon, &info)) return NULL;
- GetObjectW(info.hbmMask, sizeof(bm), &bm); + NtGdiExtGetObjectW(info.hbmMask, sizeof(bm), &bm); if (!info.hbmColor) bm.bmHeight = max(1, bm.bmHeight / 2); width = bm.bmWidth; height = bm.bmHeight; TRACE("new width %d height %d\n", width, height);
- DeleteObject(info.hbmColor); - DeleteObject(info.hbmMask); + NtGdiDeleteObjectApp(info.hbmColor); + NtGdiDeleteObjectApp(info.hbmMask); }
- hdc = CreateCompatibleDC(0); + hdc = NtGdiCreateCompatibleDC(0);
bitmapinfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bitmapinfo->bmiHeader.biWidth = width; @@ -226,7 +226,8 @@ CGImageRef create_cgimage_from_icon(HANDLE icon, int width, int height) bitmapinfo->bmiHeader.biBitCount = 32; color_size = width * height * 4; bitmapinfo->bmiHeader.biSizeImage = color_size; - hbmColor = CreateDIBSection(hdc, bitmapinfo, DIB_RGB_COLORS, (VOID **) &color_bits, NULL, 0); + hbmColor = NtGdiCreateDIBSection(hdc, NULL, 0, bitmapinfo, DIB_RGB_COLORS, + 0, 0, 0, (void **)&color_bits); if (!hbmColor) { WARN("failed to create DIB section for cursor color data\n"); @@ -244,7 +245,8 @@ CGImageRef create_cgimage_from_icon(HANDLE icon, int width, int height) bitmapinfo->bmiColors[1].rgbReserved = 0; mask_size = ((width + 31) / 32 * 4) * height; bitmapinfo->bmiHeader.biSizeImage = mask_size; - hbmMask = CreateDIBSection(hdc, bitmapinfo, DIB_RGB_COLORS, (VOID **) &mask_bits, NULL, 0); + hbmMask = NtGdiCreateDIBSection(hdc, NULL, 0, bitmapinfo, DIB_RGB_COLORS, + 0, 0, 0, (void **)&mask_bits); if (!hbmMask) { WARN("failed to create DIB section for cursor mask data\n"); @@ -255,9 +257,9 @@ CGImageRef create_cgimage_from_icon(HANDLE icon, int width, int height) mask_bits, mask_size, width, height, 0);
cleanup: - if (hbmColor) DeleteObject(hbmColor); - if (hbmMask) DeleteObject(hbmMask); - DeleteDC(hdc); + if (hbmColor) NtGdiDeleteObjectApp(hbmColor); + if (hbmMask) NtGdiDeleteObjectApp(hbmMask); + NtGdiDeleteObjectApp(hdc); return ret; }
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 79ae074dac6..29fbe8a8cb9 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -30,7 +30,7 @@ #include "macdrv_cocoa.h" #include "windef.h" #include "winbase.h" -#include "wingdi.h" +#include "ntgdi.h" #include "wine/debug.h" #include "wine/gdi_driver.h"
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/mouse.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index d101d2513c8..e22cbe5e23f 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -290,7 +290,7 @@ CFArrayRef create_monochrome_cursor(HDC hdc, const ICONINFOEXW *icon, int width, } xor_bits = (unsigned long*)((char*)and_bits + info->bmiHeader.biSizeImage / 2);
- if (!GetDIBits(hdc, icon->hbmMask, 0, height * 2, and_bits, info, DIB_RGB_COLORS)) + if (!NtGdiGetDIBitsInternal(hdc, icon->hbmMask, 0, height * 2, and_bits, info, DIB_RGB_COLORS, 0, 0)) { WARN("GetDIBits failed\n"); HeapFree(GetProcessHeap(), 0, and_bits); @@ -579,7 +579,8 @@ static CFArrayRef create_color_cursor(HDC hdc, const ICONINFOEXW *iinfo, HANDLE info->bmiHeader.biBitCount = 32; color_size = width * height * 4; info->bmiHeader.biSizeImage = color_size; - hbmColor = CreateDIBSection(hdc, info, DIB_RGB_COLORS, (VOID **) &color_bits, NULL, 0); + hbmColor = NtGdiCreateDIBSection(hdc, NULL, 0, info, DIB_RGB_COLORS, + 0, 0, 0, (void **)&color_bits); if (!hbmColor) { WARN("failed to create DIB section for cursor color data\n"); @@ -597,7 +598,8 @@ static CFArrayRef create_color_cursor(HDC hdc, const ICONINFOEXW *iinfo, HANDLE
mask_size = ((width + 31) / 32 * 4) * height; /* width_bytes * height */ info->bmiHeader.biSizeImage = mask_size; - hbmMask = CreateDIBSection(hdc, info, DIB_RGB_COLORS, (VOID **) &mask_bits, NULL, 0); + hbmMask = NtGdiCreateDIBSection(hdc, NULL, 0, info, DIB_RGB_COLORS, + 0, 0, 0, (void **)&mask_bits); if (!hbmMask) { WARN("failed to create DIB section for cursor mask data\n"); @@ -625,8 +627,8 @@ cleanup: else TRACE("returning cursor with %d frames\n", nFrames); /* Cleanup all of the resources used to obtain the frame data */ - if (hbmColor) DeleteObject(hbmColor); - if (hbmMask) DeleteObject(hbmMask); + if (hbmColor) NtGdiDeleteObjectApp(hbmColor); + if (hbmMask) NtGdiDeleteObjectApp(hbmMask); HeapFree(GetProcessHeap(), 0, info); return frames; } @@ -748,15 +750,15 @@ void macdrv_SetCursor(HCURSOR cursor)
if ((cursor_name = copy_system_cursor_name(&info))) { - DeleteObject(info.hbmColor); - DeleteObject(info.hbmMask); + NtGdiDeleteObjectApp(info.hbmColor); + NtGdiDeleteObjectApp(info.hbmMask); } else { BITMAP bm; HDC hdc;
- GetObjectW(info.hbmMask, sizeof(bm), &bm); + NtGdiExtGetObjectW(info.hbmMask, sizeof(bm), &bm); if (!info.hbmColor) bm.bmHeight = max(1, bm.bmHeight / 2);
/* make sure hotspot is valid */ @@ -766,18 +768,18 @@ void macdrv_SetCursor(HCURSOR cursor) info.yHotspot = bm.bmHeight / 2; }
- hdc = CreateCompatibleDC(0); + hdc = NtGdiCreateCompatibleDC(0);
if (info.hbmColor) { cursor_frames = create_color_cursor(hdc, &info, cursor, bm.bmWidth, bm.bmHeight); - DeleteObject(info.hbmColor); + NtGdiDeleteObjectApp(info.hbmColor); } else cursor_frames = create_monochrome_cursor(hdc, &info, bm.bmWidth, bm.bmHeight);
- DeleteObject(info.hbmMask); - DeleteDC(hdc); + NtGdiDeleteObjectApp(info.hbmMask); + NtGdiDeleteObjectApp(hdc); }
if (cursor_name || cursor_frames)
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/opengl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c index f553b93da5a..bf7effa7aeb 100644 --- a/dlls/winemac.drv/opengl.c +++ b/dlls/winemac.drv/opengl.c @@ -3071,7 +3071,7 @@ static HDC macdrv_wglGetPbufferDCARB(struct wgl_pbuffer *pbuffer) HDC hdc; struct wgl_pbuffer *prev;
- hdc = CreateDCA("DISPLAY", NULL, NULL, NULL); + hdc = NtGdiOpenDCW(NULL, NULL, NULL, 0, TRUE, NULL, NULL, NULL); if (!hdc) return 0;
pthread_mutex_lock(&dc_pbuffers_mutex); @@ -3932,7 +3932,7 @@ static int macdrv_wglReleasePbufferDCARB(struct wgl_pbuffer *pbuffer, HDC hdc)
pthread_mutex_unlock(&dc_pbuffers_mutex);
- return hdc && DeleteDC(hdc); + return hdc && NtGdiDeleteObjectApp(hdc); }
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/surface.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/dlls/winemac.drv/surface.c b/dlls/winemac.drv/surface.c index 6b0abb10780..9605e704c92 100644 --- a/dlls/winemac.drv/surface.c +++ b/dlls/winemac.drv/surface.c @@ -82,14 +82,14 @@ static void update_blit_data(struct macdrv_window_surface *surface)
if (surface->drawn) { - HRGN blit = CreateRectRgn(0, 0, 0, 0); + HRGN blit = NtGdiCreateRectRgn(0, 0, 0, 0);
- if (CombineRgn(blit, surface->drawn, 0, RGN_COPY) > NULLREGION && - (!surface->region || CombineRgn(blit, blit, surface->region, RGN_AND) > NULLREGION) && + if (NtGdiCombineRgn(blit, surface->drawn, 0, RGN_COPY) > NULLREGION && + (!surface->region || NtGdiCombineRgn(blit, blit, surface->region, RGN_AND) > NULLREGION) && OffsetRgn(blit, surface->header.rect.left, surface->header.rect.top) > NULLREGION) surface->blit_data = get_region_data(blit, 0);
- DeleteObject(blit); + NtGdiDeleteObjectApp(blit); } }
@@ -148,12 +148,12 @@ static void macdrv_surface_set_region(struct window_surface *window_surface, HRG
if (region) { - if (!surface->region) surface->region = CreateRectRgn(0, 0, 0, 0); - CombineRgn(surface->region, region, 0, RGN_COPY); + if (!surface->region) surface->region = NtGdiCreateRectRgn(0, 0, 0, 0); + NtGdiCombineRgn(surface->region, region, 0, RGN_COPY); } else { - if (surface->region) DeleteObject(surface->region); + if (surface->region) NtGdiDeleteObjectApp(surface->region); surface->region = 0; } update_blit_data(surface); @@ -178,12 +178,14 @@ static void macdrv_surface_flush(struct window_surface *window_surface) rect = cgrect_from_rect(surface->bounds); rect = CGRectOffset(rect, surface->header.rect.left, surface->header.rect.top);
- if (!IsRectEmpty(&surface->bounds) && (region = CreateRectRgnIndirect(&surface->bounds))) + if (!IsRectEmpty(&surface->bounds) && + (region = NtGdiCreateRectRgn(surface->bounds.left, surface->bounds.top, + surface->bounds.right, surface->bounds.bottom))) { if (surface->drawn) { - CombineRgn(surface->drawn, surface->drawn, region, RGN_OR); - DeleteObject(region); + NtGdiCombineRgn(surface->drawn, surface->drawn, region, RGN_OR); + NtGdiDeleteObjectApp(region); } else surface->drawn = region; @@ -205,8 +207,8 @@ static void macdrv_surface_destroy(struct window_surface *window_surface) struct macdrv_window_surface *surface = get_mac_surface(window_surface);
TRACE("freeing %p bits %p\n", surface, surface->bits); - if (surface->region) DeleteObject(surface->region); - if (surface->drawn) DeleteObject(surface->drawn); + if (surface->region) NtGdiDeleteObjectApp(surface->region); + if (surface->drawn) NtGdiDeleteObjectApp(surface->drawn); HeapFree(GetProcessHeap(), 0, surface->blit_data); HeapFree(GetProcessHeap(), 0, surface->bits); pthread_mutex_destroy(&surface->mutex); @@ -283,11 +285,11 @@ struct window_surface *create_surface(macdrv_window window, const RECT *rect, reset_bounds(&surface->bounds); if (old_mac_surface && old_mac_surface->drawn) { - surface->drawn = CreateRectRgnIndirect(rect); + surface->drawn = NtGdiCreateRectRgn(rect->left, rect->top, rect->right, rect->bottom); OffsetRgn(surface->drawn, -rect->left, -rect->top); - if (CombineRgn(surface->drawn, surface->drawn, old_mac_surface->drawn, RGN_AND) <= NULLREGION) + if (NtGdiCombineRgn(surface->drawn, surface->drawn, old_mac_surface->drawn, RGN_AND) <= NULLREGION) { - DeleteObject(surface->drawn); + NtGdiDeleteObjectApp(surface->drawn); surface->drawn = 0; } } @@ -456,10 +458,10 @@ void surface_clip_to_visible_rect(struct window_surface *window_surface, const R rect = *visible_rect; OffsetRect(&rect, -rect.left, -rect.top);
- if ((region = CreateRectRgnIndirect(&rect))) + if ((region = NtGdiCreateRectRgn(rect.left, rect.top, rect.right, rect.bottom))) { - CombineRgn(surface->drawn, surface->drawn, region, RGN_AND); - DeleteObject(region); + NtGdiCombineRgn(surface->drawn, surface->drawn, region, RGN_AND); + NtGdiDeleteObjectApp(region);
update_blit_data(surface); }
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/window.c | 56 ++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 27 deletions(-)
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index d5bcce654e8..e0dc2352d37 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -384,16 +384,16 @@ static void sync_window_region(struct macdrv_win_data *data, HRGN win_region)
if (hrgn == (HRGN)1) /* hack: win_region == 1 means retrieve region from server */ { - if (!(hrgn = CreateRectRgn(0, 0, 0, 0))) return; + if (!(hrgn = NtGdiCreateRectRgn(0, 0, 0, 0))) return; if (GetWindowRgn(data->hwnd, hrgn) == ERROR) { - DeleteObject(hrgn); + NtGdiDeleteObjectApp(hrgn); hrgn = 0; } }
if (hrgn && GetWindowLongW(data->hwnd, GWL_EXSTYLE) & WS_EX_LAYOUTRTL) - MirrorRgn(data->hwnd, hrgn); + NtUserMirrorRgn(data->hwnd, hrgn); if (hrgn) { OffsetRgn(hrgn, data->window_rect.left - data->whole_rect.left, @@ -428,7 +428,7 @@ static void sync_window_region(struct macdrv_win_data *data, HRGN win_region) HeapFree(GetProcessHeap(), 0, region_data); data->shaped = (region_data != NULL);
- if (hrgn && hrgn != win_region) DeleteObject(hrgn); + if (hrgn && hrgn != win_region) NtGdiDeleteObjectApp(hrgn); }
@@ -678,10 +678,10 @@ static void create_cocoa_window(struct macdrv_win_data *data) BYTE alpha; DWORD layered_flags;
- if ((win_rgn = CreateRectRgn(0, 0, 0, 0)) && + if ((win_rgn = NtGdiCreateRectRgn(0, 0, 0, 0)) && GetWindowRgn(data->hwnd, win_rgn) == ERROR) { - DeleteObject(win_rgn); + NtGdiDeleteObjectApp(win_rgn); win_rgn = 0; } data->shaped = (win_rgn != 0); @@ -720,7 +720,7 @@ static void create_cocoa_window(struct macdrv_win_data *data) sync_window_opacity(data, key, alpha, FALSE, layered_flags);
done: - if (win_rgn) DeleteObject(win_rgn); + if (win_rgn) NtGdiDeleteObjectApp(win_rgn); }
@@ -1053,7 +1053,7 @@ RGNDATA *get_region_data(HRGN hrgn, HDC hdc_lptodp) RECT *rect; CGRect *cgrect;
- if (!hrgn || !(size = GetRegionData(hrgn, 0, NULL))) return NULL; + if (!hrgn || !(size = NtGdiGetRegionData(hrgn, 0, NULL))) return NULL; if (sizeof(CGRect) > sizeof(RECT)) { /* add extra size for CGRect array */ @@ -1061,7 +1061,7 @@ RGNDATA *get_region_data(HRGN hrgn, HDC hdc_lptodp) size += count * (sizeof(CGRect) - sizeof(RECT)); } if (!(data = HeapAlloc(GetProcessHeap(), 0, size))) return NULL; - if (!GetRegionData(hrgn, size, data)) + if (!NtGdiGetRegionData(hrgn, size, data)) { HeapFree(GetProcessHeap(), 0, data); return NULL; @@ -1071,7 +1071,8 @@ RGNDATA *get_region_data(HRGN hrgn, HDC hdc_lptodp) cgrect = (CGRect *)data->Buffer; if (hdc_lptodp) /* map to device coordinates */ { - LPtoDP(hdc_lptodp, (POINT *)rect, data->rdh.nCount * 2); + NtGdiTransformPoints(hdc_lptodp, (POINT *)rect, (POINT *)rect, + data->rdh.nCount * 2, NtGdiLPtoDP); for (i = 0; i < data->rdh.nCount; i++) { if (rect[i].right < rect[i].left) @@ -1213,16 +1214,16 @@ static void move_window_bits(HWND hwnd, macdrv_window window, const RECT *old_re hdc_src = hdc_dst = GetDCEx(hwnd, 0, DCX_CACHE); }
- rgn = CreateRectRgnIndirect(&dst_rect); - SelectClipRgn(hdc_dst, rgn); - DeleteObject(rgn); + rgn = NtGdiCreateRectRgn(dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom); + NtGdiExtSelectClipRgn(hdc_dst, rgn, RGN_COPY); + NtGdiDeleteObjectApp(rgn); ExcludeUpdateRgn(hdc_dst, hwnd);
TRACE("copying bits for win %p/%p %s -> %s\n", hwnd, window, wine_dbgstr_rect(&src_rect), wine_dbgstr_rect(&dst_rect)); - BitBlt(hdc_dst, dst_rect.left, dst_rect.top, - dst_rect.right - dst_rect.left, dst_rect.bottom - dst_rect.top, - hdc_src, src_rect.left, src_rect.top, SRCCOPY); + NtGdiBitBlt(hdc_dst, dst_rect.left, dst_rect.top, + dst_rect.right - dst_rect.left, dst_rect.bottom - dst_rect.top, + hdc_src, src_rect.left, src_rect.top, SRCCOPY, 0, 0);
ReleaseDC(hwnd, hdc_dst); if (hdc_src != hdc_dst) ReleaseDC(parent, hdc_src); @@ -1919,26 +1920,27 @@ BOOL macdrv_UpdateLayeredWindow(HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
dst_bits = surface->funcs->get_info(surface, bmi);
- if (!(dib = CreateDIBSection(info->hdcDst, bmi, DIB_RGB_COLORS, &src_bits, NULL, 0))) goto done; - if (!(hdc = CreateCompatibleDC(0))) goto done; + if (!(dib = NtGdiCreateDIBSection(info->hdcDst, NULL, 0, bmi, DIB_RGB_COLORS, + 0, 0, 0, &src_bits))) goto done; + if (!(hdc = NtGdiCreateCompatibleDC(0))) goto done;
- SelectObject(hdc, dib); + NtGdiSelectBitmap(hdc, dib); if (info->prcDirty) { IntersectRect(&rect, &rect, info->prcDirty); surface->funcs->lock(surface); memcpy(src_bits, dst_bits, bmi->bmiHeader.biSizeImage); surface->funcs->unlock(surface); - PatBlt(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, BLACKNESS); + NtGdiPatBlt(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, BLACKNESS); } src_rect = rect; if (info->pptSrc) OffsetRect( &src_rect, info->pptSrc->x, info->pptSrc->y ); - DPtoLP( info->hdcSrc, (POINT *)&src_rect, 2 ); + NtGdiTransformPoints(info->hdcSrc, (POINT *)&src_rect, (POINT *)&src_rect, 2, NtGdiDPtoLP);
- if (!(ret = GdiAlphaBlend(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, - info->hdcSrc, src_rect.left, src_rect.top, - src_rect.right - src_rect.left, src_rect.bottom - src_rect.top, - blend))) + if (!(ret = NtGdiAlphaBlend(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, + info->hdcSrc, src_rect.left, src_rect.top, + src_rect.right - src_rect.left, src_rect.bottom - src_rect.top, + blend, 0))) goto done;
if ((data = get_win_data(hwnd))) @@ -1960,8 +1962,8 @@ BOOL macdrv_UpdateLayeredWindow(HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
done: window_surface_release(surface); - if (hdc) DeleteDC(hdc); - if (dib) DeleteObject(dib); + if (hdc) NtGdiDeleteObjectApp(hdc); + if (dib) NtGdiDeleteObjectApp(dib); return ret; }
This merge request was approved by Huw Davies.