[PATCH 0/1] MR9912: win32u: Remove unnecessary window_surface exports.
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/win32u/dce.c | 66 ++++++++++++++++++------------------ dlls/win32u/win32u_private.h | 7 +++- include/wine/gdi_driver.h | 6 ---- 3 files changed, 39 insertions(+), 40 deletions(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index ed7d82cb8ba..e8ed17e352c 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -524,8 +524,31 @@ static BOOL update_surface_shape( struct window_surface *surface, const RECT *re return clear_surface_shape( surface ); } -W32KAPI struct window_surface *window_surface_create( UINT size, const struct window_surface_funcs *funcs, HWND hwnd, - const RECT *rect, BITMAPINFO *info, HBITMAP bitmap ) +static void *window_surface_get_color( struct window_surface *surface, BITMAPINFO *info ) +{ + struct bitblt_coords coords = {0}; + struct gdi_image_bits gdi_bits; + BITMAPOBJ *bmp; + + if (surface == &dummy_surface) + { + static BITMAPINFOHEADER header = {.biSize = sizeof(header), .biWidth = 1, .biHeight = 1, + .biPlanes = 1, .biBitCount = 32, .biCompression = BI_RGB}; + static DWORD dummy_data; + + info->bmiHeader = header; + return &dummy_data; + } + + if (!(bmp = GDI_GetObjPtr( surface->color_bitmap, NTGDI_OBJ_BITMAP ))) return NULL; + get_image_from_bitmap( bmp, info, &gdi_bits, &coords ); + GDI_ReleaseObj( surface->color_bitmap ); + + return gdi_bits.ptr; +} + +struct window_surface *window_surface_create( UINT size, const struct window_surface_funcs *funcs, HWND hwnd, + const RECT *rect, BITMAPINFO *info, HBITMAP bitmap ) { struct window_surface *surface; @@ -554,12 +577,12 @@ W32KAPI struct window_surface *window_surface_create( UINT size, const struct wi return surface; } -W32KAPI void window_surface_add_ref( struct window_surface *surface ) +void window_surface_add_ref( struct window_surface *surface ) { InterlockedIncrement( &surface->ref ); } -W32KAPI void window_surface_release( struct window_surface *surface ) +void window_surface_release( struct window_surface *surface ) { ULONG ret = InterlockedDecrement( &surface->ref ); if (!ret) @@ -573,42 +596,19 @@ W32KAPI void window_surface_release( struct window_surface *surface ) } } -W32KAPI void window_surface_lock( struct window_surface *surface ) +void window_surface_lock( struct window_surface *surface ) { if (surface == &dummy_surface) return; pthread_mutex_lock( &surface->mutex ); } -W32KAPI void window_surface_unlock( struct window_surface *surface ) +void window_surface_unlock( struct window_surface *surface ) { if (surface == &dummy_surface) return; pthread_mutex_unlock( &surface->mutex ); } -void *window_surface_get_color( struct window_surface *surface, BITMAPINFO *info ) -{ - struct bitblt_coords coords = {0}; - struct gdi_image_bits gdi_bits; - BITMAPOBJ *bmp; - - if (surface == &dummy_surface) - { - static BITMAPINFOHEADER header = {.biSize = sizeof(header), .biWidth = 1, .biHeight = 1, - .biPlanes = 1, .biBitCount = 32, .biCompression = BI_RGB}; - static DWORD dummy_data; - - info->bmiHeader = header; - return &dummy_data; - } - - if (!(bmp = GDI_GetObjPtr( surface->color_bitmap, NTGDI_OBJ_BITMAP ))) return NULL; - get_image_from_bitmap( bmp, info, &gdi_bits, &coords ); - GDI_ReleaseObj( surface->color_bitmap ); - - return gdi_bits.ptr; -} - -W32KAPI void window_surface_flush( struct window_surface *surface ) +void window_surface_flush( struct window_surface *surface ) { char color_buf[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; char shape_buf[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; @@ -643,7 +643,7 @@ W32KAPI void window_surface_flush( struct window_surface *surface ) window_surface_unlock( surface ); } -W32KAPI void window_surface_set_layered( struct window_surface *surface, COLORREF color_key, UINT alpha_bits, UINT alpha_mask ) +void window_surface_set_layered( struct window_surface *surface, COLORREF color_key, UINT alpha_bits, UINT alpha_mask ) { char color_buf[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; BITMAPINFO *color_info = (BITMAPINFO *)color_buf; @@ -672,7 +672,7 @@ W32KAPI void window_surface_set_layered( struct window_surface *surface, COLORRE window_surface_unlock( surface ); } -W32KAPI void window_surface_set_clip( struct window_surface *surface, HRGN clip_region ) +void window_surface_set_clip( struct window_surface *surface, HRGN clip_region ) { window_surface_lock( surface ); @@ -705,7 +705,7 @@ W32KAPI void window_surface_set_clip( struct window_surface *surface, HRGN clip_ window_surface_unlock( surface ); } -W32KAPI void window_surface_set_shape( struct window_surface *surface, HRGN shape_region ) +void window_surface_set_shape( struct window_surface *surface, HRGN shape_region ) { window_surface_lock( surface ); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 0f9d17644b5..b823f38bf11 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -54,7 +54,12 @@ extern void move_window_bits_surface( HWND hwnd, const RECT *window_rect, struct const RECT *old_visible_rect, const RECT *valid_rects ); extern void register_window_surface( struct window_surface *old, struct window_surface *new ); -extern void *window_surface_get_color( struct window_surface *surface, BITMAPINFO *info ); + +extern void window_surface_lock( struct window_surface *surface ); +extern void window_surface_unlock( struct window_surface *surface ); +extern void window_surface_flush( struct window_surface *surface ); +extern void window_surface_set_clip( struct window_surface *surface, HRGN clip_region ); +extern void window_surface_set_layered( struct window_surface *surface, COLORREF color_key, UINT alpha_bits, UINT alpha_mask ); /* defwnd.c */ extern BOOL adjust_window_rect( RECT *rect, DWORD style, BOOL menu, DWORD ex_style, UINT dpi ); diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index d7b5018719c..f6390bce878 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -319,13 +319,7 @@ W32KAPI struct window_surface *window_surface_create( UINT size, const struct wi const RECT *rect, BITMAPINFO *info, HBITMAP bitmap ); W32KAPI void window_surface_add_ref( struct window_surface *surface ); W32KAPI void window_surface_release( struct window_surface *surface ); -W32KAPI void window_surface_lock( struct window_surface *surface ); -W32KAPI void window_surface_unlock( struct window_surface *surface ); -W32KAPI void window_surface_set_layered( struct window_surface *surface, COLORREF color_key, UINT alpha_bits, UINT alpha_mask ); -W32KAPI void window_surface_flush( struct window_surface *surface ); -W32KAPI void window_surface_set_clip( struct window_surface *surface, HRGN clip_region ); W32KAPI void window_surface_set_shape( struct window_surface *surface, HRGN shape_region ); -W32KAPI void window_surface_set_layered( struct window_surface *surface, COLORREF color_key, UINT alpha_bits, UINT alpha_mask ); /* display manager interface, used to initialize display device registry data */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9912
participants (2)
-
Rémi Bernon -
Rémi Bernon (@rbernon)