Commit d30da7ae authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the IWineD3DSwapChain typedefs.

parent 3ec19590
......@@ -7206,7 +7206,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
IWineD3DSurfaceImpl *dst_surface, const RECT *dst_rect_in, enum wined3d_blit_op blit_op,
DWORD Filter)
{
IWineD3DSwapChainImpl *dst_swapchain;
struct wined3d_swapchain *dst_swapchain;
struct wined3d_context *context;
RECT dst_rect = *dst_rect_in;
......
......@@ -1268,7 +1268,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
}
/* Do not call while under the GL lock. */
struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain,
struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
IWineD3DSurfaceImpl *target, const struct wined3d_format *ds_format)
{
IWineD3DDeviceImpl *device = swapchain->device;
......@@ -1875,7 +1875,7 @@ static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSur
}
else
{
IWineD3DSwapChainImpl *swapchain = This->swapchains[0];
struct wined3d_swapchain *swapchain = This->swapchains[0];
if (swapchain->back_buffers) target = swapchain->back_buffers[0];
else target = swapchain->front_buffer;
}
......@@ -2006,7 +2006,7 @@ static void context_validate_onscreen_formats(IWineD3DDeviceImpl *device,
struct wined3d_context *context, IWineD3DSurfaceImpl *depth_stencil)
{
/* Onscreen surfaces are always in a swapchain */
IWineD3DSwapChainImpl *swapchain = context->current_rt->container.u.swapchain;
struct wined3d_swapchain *swapchain = context->current_rt->container.u.swapchain;
if (context->render_offscreen || !depth_stencil) return;
if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->resource.format)) return;
......
......@@ -1079,7 +1079,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
DWORD d;
} tmpfloat;
unsigned int i;
IWineD3DSwapChain *swapchain;
struct wined3d_swapchain *swapchain;
IWineD3DSurface *backbuffer;
HRESULT hr;
......@@ -1305,8 +1305,8 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
/* Set the default viewport */
state->viewport.X = 0;
state->viewport.Y = 0;
state->viewport.Width = ((IWineD3DSwapChainImpl *)swapchain)->presentParms.BackBufferWidth;
state->viewport.Height = ((IWineD3DSwapChainImpl *)swapchain)->presentParms.BackBufferHeight;
state->viewport.Width = swapchain->presentParms.BackBufferWidth;
state->viewport.Height = swapchain->presentParms.BackBufferHeight;
state->viewport.MinZ = 0.0f;
state->viewport.MaxZ = 1.0f;
......
......@@ -1169,7 +1169,7 @@ void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, IWineD3DS
GLenum surface_get_gl_buffer(IWineD3DSurfaceImpl *surface)
{
IWineD3DSwapChainImpl *swapchain = surface->container.u.swapchain;
struct wined3d_swapchain *swapchain = surface->container.u.swapchain;
TRACE("surface %p.\n", surface);
......@@ -2260,7 +2260,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
pal = This->palette->palents;
} else {
IWineD3DSurfaceImpl *dds_primary;
IWineD3DSwapChainImpl *swapchain;
struct wined3d_swapchain *swapchain;
swapchain = This->resource.device->swapchains[0];
dds_primary = swapchain->front_buffer;
if (dds_primary && dds_primary->palette)
......@@ -2847,7 +2847,7 @@ void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back) {
static HRESULT WINAPI IWineD3DSurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DSurface *override, DWORD flags)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
IWineD3DSwapChainImpl *swapchain = NULL;
struct wined3d_swapchain *swapchain = NULL;
TRACE("iface %p, override %p, flags %#x.\n", iface, override, flags);
......@@ -3020,8 +3020,8 @@ static void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *dst_surface, IWine
const RECT *src_rect, const RECT *dst_rect_in, WINED3DTEXTUREFILTERTYPE Filter)
{
IWineD3DDeviceImpl *device = dst_surface->resource.device;
struct wined3d_swapchain *src_swapchain = NULL;
GLuint src, backup = 0;
IWineD3DSwapChainImpl *src_swapchain = NULL;
float left, right, top, bottom; /* Texture coordinates */
UINT fbwidth = src_surface->resource.width;
UINT fbheight = src_surface->resource.height;
......@@ -3568,7 +3568,7 @@ static void surface_blt_to_drawable(IWineD3DDeviceImpl *device,
IWineD3DSurfaceImpl *src_surface, const RECT *src_rect_in,
IWineD3DSurfaceImpl *dst_surface, const RECT *dst_rect_in)
{
IWineD3DSwapChainImpl *swapchain = NULL;
struct wined3d_swapchain *swapchain = NULL;
struct wined3d_context *context;
RECT src_rect, dst_rect;
......@@ -3660,7 +3660,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *dst_surface,
{
IWineD3DDeviceImpl *device = dst_surface->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
IWineD3DSwapChainImpl *srcSwapchain = NULL, *dstSwapchain = NULL;
struct wined3d_swapchain *srcSwapchain = NULL, *dstSwapchain = NULL;
RECT dst_rect, src_rect;
TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n",
......@@ -4918,7 +4918,7 @@ static WINED3DSURFTYPE WINAPI IWineD3DSurfaceImpl_GetImplType(IWineD3DSurface *i
BOOL surface_is_offscreen(IWineD3DSurfaceImpl *surface)
{
IWineD3DSwapChainImpl *swapchain = surface->container.u.swapchain;
struct wined3d_swapchain *swapchain = surface->container.u.swapchain;
/* Not on a swapchain - must be offscreen */
if (surface->container.type != WINED3D_CONTAINER_SWAPCHAIN) return TRUE;
......
......@@ -87,7 +87,7 @@ static void gdi_surface_realize_palette(IWineD3DSurfaceImpl *surface)
/* Tell the swapchain to update the screen. */
if (surface->container.type == WINED3D_CONTAINER_SWAPCHAIN)
{
IWineD3DSwapChainImpl *swapchain = surface->container.u.swapchain;
struct wined3d_swapchain *swapchain = surface->container.u.swapchain;
if (surface == swapchain->front_buffer)
{
x11_copy_to_screen(swapchain, NULL);
......@@ -184,7 +184,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Unmap(IWineD3DSurface *iface)
/* Tell the swapchain to update the screen */
if (This->container.type == WINED3D_CONTAINER_SWAPCHAIN)
{
IWineD3DSwapChainImpl *swapchain = This->container.u.swapchain;
struct wined3d_swapchain *swapchain = This->container.u.swapchain;
if (This == swapchain->front_buffer)
{
x11_copy_to_screen(swapchain, &This->lockedRect);
......@@ -213,7 +213,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Unmap(IWineD3DSurface *iface)
static HRESULT WINAPI IWineGDISurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DSurface *override, DWORD flags)
{
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)iface;
IWineD3DSwapChainImpl *swapchain;
struct wined3d_swapchain *swapchain;
HRESULT hr;
if (surface->container.type != WINED3D_CONTAINER_SWAPCHAIN)
......@@ -279,7 +279,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
pal = This->palette->palents;
} else {
IWineD3DSurfaceImpl *dds_primary;
IWineD3DSwapChainImpl *swapchain;
struct wined3d_swapchain *swapchain;
swapchain = This->resource.device->swapchains[0];
dds_primary = swapchain->front_buffer;
if (dds_primary && dds_primary->palette)
......
......@@ -27,7 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
WINE_DECLARE_DEBUG_CHANNEL(fps);
/* Do not call while under the GL lock. */
static void swapchain_cleanup(IWineD3DSwapChainImpl *swapchain)
static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
{
WINED3DDISPLAYMODE mode;
UINT i;
......@@ -269,11 +269,11 @@ HRESULT CDECL wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *s
}
/* A GL context is provided by the caller */
static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect)
static void swapchain_blit(struct wined3d_swapchain *swapchain,
struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect)
{
IWineD3DDeviceImpl *device = This->device;
IWineD3DSurfaceImpl *backbuffer = This->back_buffers[0];
IWineD3DSurfaceImpl *backbuffer = swapchain->back_buffers[0];
IWineD3DDeviceImpl *device = swapchain->device;
UINT src_w = src_rect->right - src_rect->left;
UINT src_h = src_rect->bottom - src_rect->top;
GLenum gl_filter;
......@@ -282,14 +282,14 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
UINT win_h;
TRACE("swapchain %p, context %p, src_rect %s, dst_rect %s.\n",
This, context, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect));
swapchain, context, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect));
if (src_w == dst_rect->right - dst_rect->left && src_h == dst_rect->bottom - dst_rect->top)
gl_filter = GL_NEAREST;
else
gl_filter = GL_LINEAR;
GetClientRect(This->win_handle, &win_rect);
GetClientRect(swapchain->win_handle, &win_rect);
win_h = win_rect.bottom - win_rect.top;
if (gl_info->fbo_ops.glBlitFramebuffer && is_identity_fixup(backbuffer->resource.format->color_fixup))
......@@ -309,7 +309,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
IWineD3DDeviceImpl_MarkStateDirty(device, STATE_RENDER(WINED3DRS_COLORWRITEENABLE3));
glDisable(GL_SCISSOR_TEST);
IWineD3DDeviceImpl_MarkStateDirty(This->device, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
IWineD3DDeviceImpl_MarkStateDirty(device, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
/* Note that the texture is upside down */
gl_info->fbo_ops.glBlitFramebuffer(src_rect->left, src_rect->top, src_rect->right, src_rect->bottom,
......@@ -326,7 +326,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
float tex_right = src_rect->right;
float tex_bottom = src_rect->bottom;
context2 = context_acquire(This->device, This->back_buffers[0]);
context2 = context_acquire(device, swapchain->back_buffers[0]);
context_apply_blit_state(context2, device);
if (backbuffer->flags & SFLAG_NORMCOORD)
......@@ -395,7 +395,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
}
}
static HRESULT swapchain_gl_present(IWineD3DSwapChainImpl *swapchain, const RECT *src_rect_in,
static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in,
const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags)
{
const struct wined3d_gl_info *gl_info;
......@@ -634,7 +634,7 @@ static const struct wined3d_swapchain_ops swapchain_gl_ops =
};
/* Helper function that blits the front buffer contents to the target window. */
void x11_copy_to_screen(IWineD3DSwapChainImpl *swapchain, const RECT *rect)
void x11_copy_to_screen(struct wined3d_swapchain *swapchain, const RECT *rect)
{
IWineD3DSurfaceImpl *front;
POINT offset = {0, 0};
......@@ -710,7 +710,7 @@ void x11_copy_to_screen(IWineD3DSwapChainImpl *swapchain, const RECT *rect)
ReleaseDC(window, dst_dc);
}
static HRESULT swapchain_gdi_present(IWineD3DSwapChainImpl *swapchain, const RECT *src_rect_in,
static HRESULT swapchain_gdi_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in,
const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags)
{
IWineD3DSurfaceImpl *front, *back;
......@@ -794,7 +794,7 @@ static const struct wined3d_swapchain_ops swapchain_gdi_ops =
};
/* Do not call while under the GL lock. */
HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface_type,
HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surface_type,
IWineD3DDeviceImpl *device, WINED3DPRESENT_PARAMETERS *present_parameters,
void *parent, const struct wined3d_parent_ops *parent_ops)
{
......
......@@ -54,8 +54,6 @@
typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl;
typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl;
typedef struct wined3d_swapchain IWineD3DSwapChainImpl;
typedef struct wined3d_swapchain IWineD3DSwapChain;
/* Texture format fixups */
......@@ -1050,7 +1048,7 @@ struct wined3d_context
DWORD numDirtyEntries;
DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */
IWineD3DSwapChainImpl *swapchain;
struct wined3d_swapchain *swapchain;
IWineD3DSurfaceImpl *current_rt;
DWORD tid; /* Thread ID which owns this context at the moment */
......@@ -1220,7 +1218,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
GLenum fbo_target, IWineD3DSurfaceImpl *depth_stencil, BOOL use_render_buffer) DECLSPEC_HIDDEN;
void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo) DECLSPEC_HIDDEN;
void context_check_fbo_status(struct wined3d_context *context, GLenum target) DECLSPEC_HIDDEN;
struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3DSurfaceImpl *target,
struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, IWineD3DSurfaceImpl *target,
const struct wined3d_format *ds_format) DECLSPEC_HIDDEN;
void context_destroy(IWineD3DDeviceImpl *This, struct wined3d_context *context) DECLSPEC_HIDDEN;
void context_free_event_query(struct wined3d_event_query *query) DECLSPEC_HIDDEN;
......@@ -1709,7 +1707,7 @@ struct IWineD3DDeviceImpl
WINED3DDEVTYPE devType;
HWND focus_window;
IWineD3DSwapChainImpl **swapchains;
struct wined3d_swapchain **swapchains;
UINT swapchain_count;
struct list resources; /* a linked list to track resources created by the device */
......@@ -2551,10 +2549,10 @@ struct wined3d_swapchain
HWND device_window;
};
void x11_copy_to_screen(IWineD3DSwapChainImpl *This, const RECT *rc) DECLSPEC_HIDDEN;
void x11_copy_to_screen(struct wined3d_swapchain *swapchain, const RECT *rect) DECLSPEC_HIDDEN;
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface_type,
HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surface_type,
IWineD3DDeviceImpl *device, WINED3DPRESENT_PARAMETERS *present_parameters,
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
......
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