Commit 27b0b88a authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Add a graphics driver to render windows contents through the DIB engine.

parent d97d3425
......@@ -268,13 +268,15 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode )
/***********************************************************************
* __wine_set_visible_region (GDI32.@)
*/
void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, const RECT *device_rect )
void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, const RECT *device_rect,
struct window_surface *surface )
{
DC * dc;
if (!(dc = get_dc_ptr( hdc ))) return;
TRACE( "%p %p %s %s\n", hdc, hrgn, wine_dbgstr_rect(vis_rect), wine_dbgstr_rect(device_rect) );
TRACE( "%p %p %s %s %p\n", hdc, hrgn,
wine_dbgstr_rect(vis_rect), wine_dbgstr_rect(device_rect), surface );
/* map region to DC coordinates */
OffsetRgn( hrgn, -vis_rect->left, -vis_rect->top );
......@@ -284,6 +286,7 @@ void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect,
dc->vis_rect = *vis_rect;
dc->device_rect = *device_rect;
dc->hVisRgn = hrgn;
dibdrv_set_window_surface( dc, surface );
DC_UpdateXforms( dc );
update_dc_clipping( dc );
release_dc_ptr( dc );
......
......@@ -511,7 +511,7 @@
# GDI objects
@ cdecl __wine_make_gdi_object_system(long long)
@ cdecl __wine_set_visible_region(long long ptr ptr)
@ cdecl __wine_set_visible_region(long long ptr ptr ptr)
# OpenGL
@ cdecl __wine_get_wgl_driver(long long)
......@@ -283,6 +283,7 @@ extern DWORD get_image_from_bitmap( BITMAPOBJ *bmp, BITMAPINFO *info,
extern DWORD put_image_into_bitmap( BITMAPOBJ *bmp, HRGN clip, BITMAPINFO *info,
const struct gdi_image_bits *bits, struct bitblt_coords *src,
struct bitblt_coords *dst ) DECLSPEC_HIDDEN;
extern void dibdrv_set_window_surface( DC *dc, struct window_surface *surface ) DECLSPEC_HIDDEN;
/* driver.c */
extern const struct gdi_dc_funcs null_driver DECLSPEC_HIDDEN;
......
......@@ -162,7 +162,7 @@ static void update_visible_region( struct dce *dce )
(flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF );
top_rect = get_virtual_screen_rect();
__wine_set_visible_region( dce->hdc, vis_rgn, &win_rect, &top_rect );
__wine_set_visible_region( dce->hdc, vis_rgn, &win_rect, &top_rect, NULL );
}
......
......@@ -21,6 +21,8 @@
#ifndef __WINE_WINE_GDI_DRIVER_H
#define __WINE_WINE_GDI_DRIVER_H
#include "wine/list.h"
struct gdi_dc_funcs;
struct opengl_funcs;
......@@ -222,6 +224,41 @@ static inline void push_dc_driver( PHYSDEV *dev, PHYSDEV physdev, const struct g
*dev = physdev;
}
/* support for window surfaces */
struct window_surface;
struct window_surface_funcs
{
void (*lock)( struct window_surface *surface );
void (*unlock)( struct window_surface *surface );
void* (*get_info)( struct window_surface *surface, BITMAPINFO *info );
RECT* (*get_bounds)( struct window_surface *surface );
void (*flush)( struct window_surface *surface );
void (*destroy)( struct window_surface *surface );
};
struct window_surface
{
const struct window_surface_funcs *funcs; /* driver-specific implementations */
struct list entry; /* entry in global list managed by user32 */
LONG ref; /* reference count */
RECT rect; /* constant, no locking needed */
/* driver-specific fields here */
};
static inline ULONG window_surface_add_ref( struct window_surface *surface )
{
return InterlockedIncrement( &surface->ref );
}
static inline ULONG window_surface_release( struct window_surface *surface )
{
ULONG ret = InterlockedDecrement( &surface->ref );
if (!ret) surface->funcs->destroy( surface );
return ret;
}
/* the DC hook support is only exported on Win16, the 32-bit version is a Wine extension */
#define DCHC_INVALIDVISRGN 0x0001
......@@ -237,7 +274,7 @@ WINGDIAPI WORD WINAPI SetHookFlags(HDC,WORD);
extern void CDECL __wine_make_gdi_object_system( HGDIOBJ handle, BOOL set );
extern void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect,
const RECT *device_rect );
const RECT *device_rect, struct window_surface *surface );
extern struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version );
#endif /* __WINE_WINE_GDI_DRIVER_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment