[PATCH 3/5] wined3d: Get rid of the IWineD3DSwapChain typedefs.
Henri Verbeet
hverbeet at codeweavers.com
Wed Apr 13 12:14:32 CDT 2011
---
dlls/wined3d/arb_program_shader.c | 2 +-
dlls/wined3d/context.c | 6 +-
dlls/wined3d/device.c | 113 ++++++++++++++++++++-----------------
dlls/wined3d/stateblock.c | 6 +-
dlls/wined3d/surface.c | 14 ++--
dlls/wined3d/surface_gdi.c | 8 +-
dlls/wined3d/swapchain.c | 26 ++++----
dlls/wined3d/wined3d_private.h | 12 ++--
8 files changed, 97 insertions(+), 90 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 77f04d6..669cac2 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -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;
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index be2ad3c..c965095 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -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;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index ab41e95..4b32da8 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1278,10 +1278,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface,
/* Do not call while under the GL lock. */
static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice *iface,
WINED3DPRESENT_PARAMETERS *present_parameters, WINED3DSURFTYPE surface_type,
- void *parent, const struct wined3d_parent_ops *parent_ops, IWineD3DSwapChain **swapchain)
+ void *parent, const struct wined3d_parent_ops *parent_ops,
+ struct wined3d_swapchain **swapchain)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- IWineD3DSwapChainImpl *object;
+ struct wined3d_swapchain *object;
HRESULT hr;
TRACE("iface %p, present_parameters %p, swapchain %p, parent %p, surface_type %#x.\n",
@@ -1303,7 +1304,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice *iface,
}
TRACE("Created swapchain %p.\n", object);
- *swapchain = (IWineD3DSwapChain *)object;
+ *swapchain = object;
return WINED3D_OK;
}
@@ -1318,22 +1319,27 @@ static UINT WINAPI IWineD3DDeviceImpl_GetNumberOfSwapChains(IWineD3DDevice *ifac
}
static HRESULT WINAPI IWineD3DDeviceImpl_GetSwapChain(IWineD3DDevice *iface,
- UINT iSwapChain, IWineD3DSwapChain **pSwapChain)
+ UINT swapchain_idx, struct wined3d_swapchain **swapchain)
{
- IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- TRACE("(%p) : swapchain %d\n", This, iSwapChain);
+ IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
- if (iSwapChain < This->swapchain_count)
+ TRACE("iface %p, swapchain_idx %u, swapchain %p.\n",
+ iface, swapchain_idx, swapchain);
+
+ if (swapchain_idx >= device->swapchain_count)
{
- *pSwapChain = (IWineD3DSwapChain *)This->swapchains[iSwapChain];
- wined3d_swapchain_incref(*pSwapChain);
- TRACE("(%p) returning %p\n", This, *pSwapChain);
- return WINED3D_OK;
- } else {
- TRACE("Swapchain out of range\n");
- *pSwapChain = NULL;
+ WARN("swapchain_idx %u >= swapchain_count %u.\n",
+ swapchain_idx, device->swapchain_count);
+ *swapchain = NULL;
+
return WINED3DERR_INVALIDCALL;
}
+
+ *swapchain = device->swapchains[swapchain_idx];
+ wined3d_swapchain_incref(*swapchain);
+ TRACE("Returning %p.\n", *swapchain);
+
+ return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice *iface,
@@ -1888,7 +1894,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
- IWineD3DSwapChainImpl *swapchain = NULL;
+ struct wined3d_swapchain *swapchain = NULL;
struct wined3d_context *context;
HRESULT hr;
DWORD state;
@@ -1951,7 +1957,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
/* Setup the implicit swapchain. This also initializes a context. */
TRACE("Creating implicit swapchain\n");
hr = IWineD3DDeviceParent_CreateSwapChain(This->device_parent,
- pPresentationParameters, (IWineD3DSwapChain **)&swapchain);
+ pPresentationParameters, &swapchain);
if (FAILED(hr))
{
WARN("Failed to create implicit swapchain\n");
@@ -2087,13 +2093,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_InitGDI(IWineD3DDevice *iface,
WINED3DPRESENT_PARAMETERS *pPresentationParameters)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
- IWineD3DSwapChainImpl *swapchain = NULL;
+ struct wined3d_swapchain *swapchain = NULL;
HRESULT hr;
/* Setup the implicit swapchain */
TRACE("Creating implicit swapchain\n");
hr = IWineD3DDeviceParent_CreateSwapChain(This->device_parent,
- pPresentationParameters, (IWineD3DSwapChain **)&swapchain);
+ pPresentationParameters, &swapchain);
if (FAILED(hr))
{
WARN("Failed to create implicit swapchain\n");
@@ -4616,7 +4622,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface,
static HRESULT WINAPI IWineD3DDeviceImpl_GetBackBuffer(IWineD3DDevice *iface, UINT swapchain_idx,
UINT backbuffer_idx, WINED3DBACKBUFFER_TYPE backbuffer_type, IWineD3DSurface **backbuffer)
{
- IWineD3DSwapChain *swapchain;
+ struct wined3d_swapchain *swapchain;
HRESULT hr;
TRACE("iface %p, swapchain_idx %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
@@ -4649,36 +4655,37 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDeviceCaps(IWineD3DDevice *iface, WI
return wined3d_get_device_caps(device->wined3d, device->adapter->ordinal, device->devType, caps);
}
-static HRESULT WINAPI IWineD3DDeviceImpl_GetDisplayMode(IWineD3DDevice *iface, UINT iSwapChain, WINED3DDISPLAYMODE* pMode) {
- IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- IWineD3DSwapChain *swapChain;
+static HRESULT WINAPI IWineD3DDeviceImpl_GetDisplayMode(IWineD3DDevice *iface,
+ UINT swapchain_idx, WINED3DDISPLAYMODE *mode)
+{
+ IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
+ struct wined3d_swapchain *swapchain;
HRESULT hr;
- if(iSwapChain > 0) {
- hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapChain);
+ TRACE("iface %p, swapchain_idx %u, mode %p.\n", iface, swapchain_idx, mode);
+
+ if (swapchain_idx)
+ {
+ hr = IWineD3DDeviceImpl_GetSwapChain(iface, swapchain_idx, &swapchain);
if (SUCCEEDED(hr))
{
- hr = wined3d_swapchain_get_display_mode(swapChain, pMode);
- wined3d_swapchain_decref(swapChain);
- }
- else
- {
- FIXME("(%p) Error getting display mode\n", This);
+ hr = wined3d_swapchain_get_display_mode(swapchain, mode);
+ wined3d_swapchain_decref(swapchain);
}
}
else
{
- /* Don't read the real display mode,
- but return the stored mode instead. X11 can't change the color
- depth, and some apps are pretty angry if they SetDisplayMode from
- 24 to 16 bpp and find out that GetDisplayMode still returns 24 bpp
-
- Also don't relay to the swapchain because with ddraw it's possible
- that there isn't a swapchain at all */
- pMode->Width = This->ddraw_width;
- pMode->Height = This->ddraw_height;
- pMode->Format = This->ddraw_format;
- pMode->RefreshRate = 0;
+ /* Don't read the real display mode, but return the stored mode
+ * instead. X11 can't change the color depth, and some apps are
+ * pretty angry if they SetDisplayMode from 24 to 16 bpp and find out
+ * that GetDisplayMode still returns 24 bpp.
+ *
+ * Also don't relay to the swapchain because with ddraw it's possible
+ * that there isn't a swapchain at all. */
+ mode->Width = device->ddraw_width;
+ mode->Height = device->ddraw_height;
+ mode->Format = device->ddraw_format;
+ mode->RefreshRate = 0;
hr = WINED3D_OK;
}
@@ -5229,7 +5236,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
static HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *iface,
UINT swapchain_idx, IWineD3DSurface *dst_surface)
{
- IWineD3DSwapChain *swapchain;
+ struct wined3d_swapchain *swapchain;
HRESULT hr;
TRACE("iface %p, swapchain_idx %u, dst_surface %p.\n", iface, swapchain_idx, dst_surface);
@@ -5457,7 +5464,7 @@ static BOOL WINAPI IWineD3DDeviceImpl_GetSoftwareVertexProcessing(IWineD3DD
static HRESULT WINAPI IWineD3DDeviceImpl_GetRasterStatus(IWineD3DDevice *iface,
UINT swapchain_idx, WINED3DRASTER_STATUS *raster_status)
{
- IWineD3DSwapChain *swapchain;
+ struct wined3d_swapchain *swapchain;
HRESULT hr;
TRACE("iface %p, swapchain_idx %u, raster_status %p.\n",
@@ -6268,7 +6275,7 @@ static BOOL is_display_mode_supported(IWineD3DDeviceImpl *This, const WINED3DPRE
}
/* Do not call while under the GL lock. */
-static void delete_opengl_contexts(IWineD3DDeviceImpl *device, IWineD3DSwapChainImpl *swapchain)
+static void delete_opengl_contexts(IWineD3DDeviceImpl *device, struct wined3d_swapchain *swapchain)
{
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
@@ -6315,7 +6322,7 @@ static void delete_opengl_contexts(IWineD3DDeviceImpl *device, IWineD3DSwapChain
}
/* Do not call while under the GL lock. */
-static HRESULT create_primary_opengl_context(IWineD3DDeviceImpl *device, IWineD3DSwapChainImpl *swapchain)
+static HRESULT create_primary_opengl_context(IWineD3DDeviceImpl *device, struct wined3d_swapchain *swapchain)
{
struct wined3d_context *context;
HRESULT hr;
@@ -6383,14 +6390,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice *iface,
WINED3DPRESENT_PARAMETERS *pPresentationParameters)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
- IWineD3DSwapChainImpl *swapchain;
+ struct wined3d_swapchain *swapchain;
HRESULT hr;
BOOL DisplayModeChanged = FALSE;
WINED3DDISPLAYMODE mode;
TRACE("(%p)\n", This);
- hr = IWineD3DDevice_GetSwapChain(iface, 0, (IWineD3DSwapChain **) &swapchain);
- if(FAILED(hr)) {
+ hr = IWineD3DDevice_GetSwapChain(iface, 0, &swapchain);
+ if (FAILED(hr))
+ {
ERR("Failed to get the first implicit swapchain\n");
return hr;
}
@@ -6662,7 +6670,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetCreationParameters(IWineD3DDevice
static void WINAPI IWineD3DDeviceImpl_SetGammaRamp(IWineD3DDevice *iface,
UINT iSwapChain, DWORD flags, const WINED3DGAMMARAMP *pRamp)
{
- IWineD3DSwapChain *swapchain;
+ struct wined3d_swapchain *swapchain;
TRACE("Relaying to swapchain\n");
@@ -6673,8 +6681,9 @@ static void WINAPI IWineD3DDeviceImpl_SetGammaRamp(IWineD3DDevice *iface,
}
}
-static void WINAPI IWineD3DDeviceImpl_GetGammaRamp(IWineD3DDevice *iface, UINT iSwapChain, WINED3DGAMMARAMP* pRamp) {
- IWineD3DSwapChain *swapchain;
+static void WINAPI IWineD3DDeviceImpl_GetGammaRamp(IWineD3DDevice *iface, UINT iSwapChain, WINED3DGAMMARAMP* pRamp)
+{
+ struct wined3d_swapchain *swapchain;
TRACE("Relaying to swapchain\n");
@@ -7109,7 +7118,7 @@ void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *h
void get_drawable_size_backbuffer(struct wined3d_context *context, UINT *width, UINT *height)
{
- IWineD3DSwapChainImpl *swapchain = context->swapchain;
+ struct wined3d_swapchain *swapchain = context->swapchain;
/* The drawable size of a backbuffer / aux buffer offscreen target is the size of the
* current context's drawable, which is the size of the back buffer of the swapchain
* the active context belongs to. */
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 5c3f4a8..6e662e3 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -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;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5acc4cd..0f6f247 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -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;
diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c
index d868136..db9cf8b 100644
--- a/dlls/wined3d/surface_gdi.c
+++ b/dlls/wined3d/surface_gdi.c
@@ -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)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index ccf9785..21d518f 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -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)
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9e3e49e..c838db2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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;
--
1.7.3.4
More information about the wine-patches
mailing list