wined3d: Get rid of the IWineD3DSurface typedefs.

This commit is contained in:
Henri Verbeet 2011-04-29 13:03:42 +02:00 committed by Alexandre Julliard
parent 1c1de920e3
commit c4b73c4550
13 changed files with 510 additions and 513 deletions

View File

@ -6862,7 +6862,7 @@ static GLuint gen_p8_shader(struct arbfp_blit_priv *priv,
}
/* Context activation is done by the caller. */
static void upload_palette(IWineD3DSurfaceImpl *surface)
static void upload_palette(struct wined3d_surface *surface)
{
BYTE table[256][4];
IWineD3DDeviceImpl *device = surface->resource.device;
@ -7051,7 +7051,7 @@ static GLuint gen_yuv_shader(struct arbfp_blit_priv *priv, const struct wined3d_
}
/* Context activation is done by the caller. */
static HRESULT arbfp_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface)
static HRESULT arbfp_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, struct wined3d_surface *surface)
{
GLenum shader;
float size[4] = {(float) surface->pow2Width, (float) surface->pow2Height, 1.0f, 1.0f};
@ -7195,9 +7195,8 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum win
}
}
HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_surface, const RECT *src_rect,
IWineD3DSurfaceImpl *dst_surface, const RECT *dst_rect_in, enum wined3d_blit_op blit_op,
DWORD Filter)
HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const RECT *dst_rect_in, enum wined3d_blit_op blit_op, DWORD Filter)
{
struct wined3d_context *context;
RECT dst_rect = *dst_rect_in;
@ -7236,7 +7235,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
}
/* Do not call while under the GL lock. */
static HRESULT arbfp_blit_color_fill(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *dst_surface,
static HRESULT arbfp_blit_color_fill(IWineD3DDeviceImpl *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const WINED3DCOLORVALUE *color)
{
FIXME("Color filling not implemented by arbfp_blit\n");
@ -7245,7 +7244,7 @@ static HRESULT arbfp_blit_color_fill(IWineD3DDeviceImpl *device, IWineD3DSurface
/* Do not call while under the GL lock. */
static HRESULT arbfp_blit_depth_fill(IWineD3DDeviceImpl *device,
IWineD3DSurfaceImpl *surface, const RECT *rect, float depth)
struct wined3d_surface *surface, const RECT *rect, float depth)
{
FIXME("Depth filling not implemented by arbfp_blit.\n");
return WINED3DERR_INVALIDCALL;

View File

@ -113,7 +113,7 @@ static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo)
/* GL locking is done by the caller */
static void context_apply_attachment_filter_states(const struct wined3d_context *context,
IWineD3DSurfaceImpl *surface, DWORD location)
struct wined3d_surface *surface, DWORD location)
{
/* Update base texture states array */
if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
@ -191,7 +191,7 @@ static void context_apply_attachment_filter_states(const struct wined3d_context
/* GL locking is done by the caller */
void context_attach_depth_stencil_fbo(struct wined3d_context *context,
GLenum fbo_target, IWineD3DSurfaceImpl *depth_stencil, BOOL use_render_buffer)
GLenum fbo_target, struct wined3d_surface *depth_stencil, BOOL use_render_buffer)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
@ -263,7 +263,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
/* GL locking is done by the caller */
static void context_attach_surface_fbo(const struct wined3d_context *context,
GLenum fbo_target, DWORD idx, IWineD3DSurfaceImpl *surface, DWORD location)
GLenum fbo_target, DWORD idx, struct wined3d_surface *surface, DWORD location)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
@ -308,9 +308,12 @@ void context_check_fbo_status(struct wined3d_context *context, GLenum target)
if (status == GL_FRAMEBUFFER_COMPLETE)
{
TRACE("FBO complete\n");
} else {
IWineD3DSurfaceImpl *attachment;
}
else
{
struct wined3d_surface *attachment;
unsigned int i;
FIXME("FBO status %s (%#x)\n", debug_fbostatus(status), status);
if (!context->current_fbo)
@ -344,7 +347,7 @@ void context_check_fbo_status(struct wined3d_context *context, GLenum target)
}
static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *context,
IWineD3DSurfaceImpl **render_targets, IWineD3DSurfaceImpl *depth_stencil, DWORD location)
struct wined3d_surface **render_targets, struct wined3d_surface *depth_stencil, DWORD location)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry;
@ -362,7 +365,7 @@ static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *contex
/* GL locking is done by the caller */
static void context_reuse_fbo_entry(struct wined3d_context *context, GLenum target,
IWineD3DSurfaceImpl **render_targets, IWineD3DSurfaceImpl *depth_stencil,
struct wined3d_surface **render_targets, struct wined3d_surface *depth_stencil,
DWORD location, struct fbo_entry *entry)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
@ -393,7 +396,7 @@ static void context_destroy_fbo_entry(struct wined3d_context *context, struct fb
/* GL locking is done by the caller */
static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context, GLenum target,
IWineD3DSurfaceImpl **render_targets, IWineD3DSurfaceImpl *depth_stencil, DWORD location)
struct wined3d_surface **render_targets, struct wined3d_surface *depth_stencil, DWORD location)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry;
@ -474,7 +477,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
/* GL locking is done by the caller */
static void context_apply_fbo_state(struct wined3d_context *context, GLenum target,
IWineD3DSurfaceImpl **render_targets, IWineD3DSurfaceImpl *depth_stencil, DWORD location)
struct wined3d_surface **render_targets, struct wined3d_surface *depth_stencil, DWORD location)
{
struct fbo_entry *entry, *entry2;
@ -503,7 +506,7 @@ static void context_apply_fbo_state(struct wined3d_context *context, GLenum targ
/* GL locking is done by the caller */
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,
IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil, DWORD location)
struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location)
{
if (location != SFLAG_INDRAWABLE || surface_is_offscreen(render_target))
{
@ -650,7 +653,7 @@ void context_free_event_query(struct wined3d_event_query *query)
typedef void (context_fbo_entry_func_t)(struct wined3d_context *context, struct fbo_entry *entry);
static void context_enum_surface_fbo_entries(IWineD3DDeviceImpl *device,
IWineD3DSurfaceImpl *surface, context_fbo_entry_func_t *callback)
struct wined3d_surface *surface, context_fbo_entry_func_t *callback)
{
UINT i;
@ -727,7 +730,7 @@ void context_resource_unloaded(struct IWineD3DDeviceImpl *device,
}
}
void context_surface_update(struct wined3d_context *context, IWineD3DSurfaceImpl *surface)
void context_surface_update(struct wined3d_context *context, struct wined3d_surface *surface)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry = context->current_fbo;
@ -1326,7 +1329,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
/* Do not call while under the GL lock. */
struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
IWineD3DSurfaceImpl *target, const struct wined3d_format *ds_format)
struct wined3d_surface *target, const struct wined3d_format *ds_format)
{
IWineD3DDeviceImpl *device = swapchain->device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@ -1915,7 +1918,7 @@ static void SetupForBlit(IWineD3DDeviceImpl *This, struct wined3d_context *conte
}
/* Do not call while under the GL lock. */
static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target)
static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, struct wined3d_surface *target)
{
struct wined3d_context *current_context = context_get_current();
struct wined3d_context *context;
@ -1968,7 +1971,7 @@ static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSur
}
/* Context activation is done by the caller. */
static void context_apply_draw_buffers(struct wined3d_context *context, UINT rt_count, IWineD3DSurfaceImpl **rts)
static void context_apply_draw_buffers(struct wined3d_context *context, UINT rt_count, struct wined3d_surface **rts)
{
if (!rt_count)
{
@ -2058,9 +2061,10 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing,
if(required_stencil && required_stencil != existing_stencil) return FALSE;
return TRUE;
}
/* The caller provides a context */
static void context_validate_onscreen_formats(IWineD3DDeviceImpl *device,
struct wined3d_context *context, IWineD3DSurfaceImpl *depth_stencil)
struct wined3d_context *context, struct wined3d_surface *depth_stencil)
{
/* Onscreen surfaces are always in a swapchain */
struct wined3d_swapchain *swapchain = context->current_rt->container.u.swapchain;
@ -2122,7 +2126,7 @@ void context_apply_blit_state(struct wined3d_context *context, IWineD3DDeviceImp
}
static BOOL context_validate_rt_config(UINT rt_count,
IWineD3DSurfaceImpl **rts, IWineD3DSurfaceImpl *ds)
struct wined3d_surface **rts, struct wined3d_surface *ds)
{
unsigned int i;
@ -2140,7 +2144,7 @@ static BOOL context_validate_rt_config(UINT rt_count,
/* Context activation is done by the caller. */
BOOL context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device,
UINT rt_count, IWineD3DSurfaceImpl **rts, IWineD3DSurfaceImpl *depth_stencil)
UINT rt_count, struct wined3d_surface **rts, struct wined3d_surface *depth_stencil)
{
const struct StateEntry *state_table = device->StateTable;
UINT i;
@ -2284,7 +2288,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImp
}
static void context_setup_target(IWineD3DDeviceImpl *device,
struct wined3d_context *context, IWineD3DSurfaceImpl *target)
struct wined3d_context *context, struct wined3d_surface *target)
{
BOOL old_render_offscreen = context->render_offscreen, render_offscreen;
const struct StateEntry *StateTable = device->StateTable;
@ -2349,7 +2353,7 @@ static void context_setup_target(IWineD3DDeviceImpl *device,
}
/* Do not call while under the GL lock. */
struct wined3d_context *context_acquire(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *target)
struct wined3d_context *context_acquire(IWineD3DDeviceImpl *device, struct wined3d_surface *target)
{
struct wined3d_context *current_context = context_get_current();
struct wined3d_context *context;

View File

@ -574,7 +574,7 @@ void device_get_draw_rect(IWineD3DDeviceImpl *device, RECT *rect)
/* Do not call while under the GL lock. */
void device_switch_onscreen_ds(IWineD3DDeviceImpl *device,
struct wined3d_context *context, IWineD3DSurfaceImpl *depth_stencil)
struct wined3d_context *context, struct wined3d_surface *depth_stencil)
{
if (device->onscreen_depth_stencil)
{
@ -588,7 +588,7 @@ void device_switch_onscreen_ds(IWineD3DDeviceImpl *device,
wined3d_surface_incref(device->onscreen_depth_stencil);
}
static BOOL is_full_clear(IWineD3DSurfaceImpl *target, const RECT *draw_rect, const RECT *clear_rect)
static BOOL is_full_clear(struct wined3d_surface *target, const RECT *draw_rect, const RECT *clear_rect)
{
/* partial draw rect */
if (draw_rect->left || draw_rect->top
@ -605,7 +605,7 @@ static BOOL is_full_clear(IWineD3DSurfaceImpl *target, const RECT *draw_rect, co
return TRUE;
}
static void prepare_ds_clear(IWineD3DSurfaceImpl *ds, struct wined3d_context *context,
static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context *context,
DWORD location, const RECT *draw_rect, UINT rect_count, const RECT *clear_rect)
{
RECT current_rect, r;
@ -651,12 +651,12 @@ static void prepare_ds_clear(IWineD3DSurfaceImpl *ds, struct wined3d_context *co
}
/* Do not call while under the GL lock. */
HRESULT device_clear_render_targets(IWineD3DDeviceImpl *device, UINT rt_count, IWineD3DSurfaceImpl **rts,
IWineD3DSurfaceImpl *depth_stencil, UINT rect_count, const RECT *rects, const RECT *draw_rect,
HRESULT device_clear_render_targets(IWineD3DDeviceImpl *device, UINT rt_count, struct wined3d_surface **rts,
struct wined3d_surface *depth_stencil, UINT rect_count, const RECT *rects, const RECT *draw_rect,
DWORD flags, const WINED3DCOLORVALUE *color, float depth, DWORD stencil)
{
const RECT *clear_rect = (rect_count > 0 && rects) ? (const RECT *)rects : NULL;
IWineD3DSurfaceImpl *target = rt_count ? rts[0] : NULL;
struct wined3d_surface *target = rt_count ? rts[0] : NULL;
UINT drawable_width, drawable_height;
struct wined3d_context *context;
GLbitfield clear_mask = 0;
@ -1047,10 +1047,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface,
static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Width, UINT Height,
enum wined3d_format_id Format, BOOL Lockable, BOOL Discard, UINT Level, DWORD Usage, WINED3DPOOL Pool,
WINED3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, WINED3DSURFTYPE Impl,
void *parent, const struct wined3d_parent_ops *parent_ops, IWineD3DSurface **surface)
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_surface **surface)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DSurfaceImpl *object;
struct wined3d_surface *object;
HRESULT hr;
TRACE("iface %p, width %u, height %u, format %s (%#x), lockable %#x, discard %#x, level %u\n",
@ -1083,7 +1083,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UI
TRACE("(%p) : Created surface %p\n", This, object);
*surface = (IWineD3DSurface *)object;
*surface = object;
return hr;
}
@ -4614,7 +4614,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface,
* Get Back Buffer
*****/
static HRESULT WINAPI IWineD3DDeviceImpl_GetBackBuffer(IWineD3DDevice *iface, UINT swapchain_idx,
UINT backbuffer_idx, WINED3DBACKBUFFER_TYPE backbuffer_type, IWineD3DSurface **backbuffer)
UINT backbuffer_idx, WINED3DBACKBUFFER_TYPE backbuffer_type, struct wined3d_surface **backbuffer)
{
struct wined3d_swapchain *swapchain;
HRESULT hr;
@ -4810,7 +4810,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD rect
if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
{
IWineD3DSurfaceImpl *ds = device->depth_stencil;
struct wined3d_surface *ds = device->depth_stencil;
if (!ds)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
@ -5159,15 +5159,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
{
case WINED3DRTYPE_TEXTURE:
{
IWineD3DSurface *src_surface;
IWineD3DSurface *dst_surface;
struct wined3d_surface *src_surface;
struct wined3d_surface *dst_surface;
for (i = 0; i < level_count; ++i)
{
src_surface = (IWineD3DSurface *)surface_from_resource(wined3d_texture_get_sub_resource(
src_texture, i));
dst_surface = (IWineD3DSurface *)surface_from_resource(wined3d_texture_get_sub_resource(
dst_texture, i));
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
hr = IWineD3DDevice_UpdateSurface(iface, src_surface, NULL, dst_surface, NULL);
if (FAILED(hr))
{
@ -5180,15 +5178,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
case WINED3DRTYPE_CUBETEXTURE:
{
IWineD3DSurface *src_surface;
IWineD3DSurface *dst_surface;
struct wined3d_surface *src_surface;
struct wined3d_surface *dst_surface;
for (i = 0; i < level_count * 6; ++i)
{
src_surface = (IWineD3DSurface *)surface_from_resource(wined3d_texture_get_sub_resource(
src_texture, i));
dst_surface = (IWineD3DSurface *)surface_from_resource(wined3d_texture_get_sub_resource(
dst_texture, i));
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
hr = IWineD3DDevice_UpdateSurface(iface, src_surface, NULL, dst_surface, NULL);
if (FAILED(hr))
{
@ -5224,7 +5220,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
}
static HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *iface,
UINT swapchain_idx, IWineD3DSurface *dst_surface)
UINT swapchain_idx, struct wined3d_surface *dst_surface)
{
struct wined3d_swapchain *swapchain;
HRESULT hr;
@ -5286,8 +5282,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ValidateDevice(IWineD3DDevice *iface, D
if (state->render_states[WINED3DRS_ZENABLE] || state->render_states[WINED3DRS_ZWRITEENABLE] ||
state->render_states[WINED3DRS_STENCILENABLE])
{
IWineD3DSurfaceImpl *ds = This->depth_stencil;
IWineD3DSurfaceImpl *target = This->render_targets[0];
struct wined3d_surface *ds = This->depth_stencil;
struct wined3d_surface *target = This->render_targets[0];
if(ds && target
&& (ds->resource.width < target->resource.width || ds->resource.height < target->resource.height))
@ -5503,11 +5499,9 @@ static float WINAPI IWineD3DDeviceImpl_GetNPatchMode(IWineD3DDevice *iface)
}
static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
IWineD3DSurface *src_surface, const RECT *src_rect,
IWineD3DSurface *dst_surface, const POINT *dst_point)
struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const POINT *dst_point)
{
IWineD3DSurfaceImpl *src_impl = (IWineD3DSurfaceImpl *)src_surface;
IWineD3DSurfaceImpl *dst_impl = (IWineD3DSurfaceImpl *)dst_surface;
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
const struct wined3d_format *src_format;
const struct wined3d_format *dst_format;
@ -5525,15 +5519,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
iface, src_surface, wine_dbgstr_rect(src_rect),
dst_surface, wine_dbgstr_point(dst_point));
if (src_impl->resource.pool != WINED3DPOOL_SYSTEMMEM || dst_impl->resource.pool != WINED3DPOOL_DEFAULT)
if (src_surface->resource.pool != WINED3DPOOL_SYSTEMMEM || dst_surface->resource.pool != WINED3DPOOL_DEFAULT)
{
WARN("source %p must be SYSTEMMEM and dest %p must be DEFAULT, returning WINED3DERR_INVALIDCALL\n",
src_surface, dst_surface);
return WINED3DERR_INVALIDCALL;
}
src_format = src_impl->resource.format;
dst_format = dst_impl->resource.format;
src_format = src_surface->resource.format;
dst_format = dst_surface->resource.format;
if (src_format->id != dst_format->id)
{
@ -5548,7 +5542,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
* surface to the destination's sysmem copy. If surface conversion is
* needed, use BltFast instead to copy in sysmem and use regular surface
* loading. */
d3dfmt_get_conv(dst_impl, FALSE, TRUE, &format, &convert);
d3dfmt_get_conv(dst_surface, FALSE, TRUE, &format, &convert);
if (convert != NO_CONVERSION || format.convert)
return wined3d_surface_bltfast(dst_surface, dst_x, dst_y, src_surface, src_rect, 0);
@ -5561,15 +5555,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
LEAVE_GL();
/* Make sure the surface is loaded and up to date */
surface_internal_preload(dst_impl, SRGB_RGB);
surface_bind(dst_impl, gl_info, FALSE);
surface_internal_preload(dst_surface, SRGB_RGB);
surface_bind(dst_surface, gl_info, FALSE);
src_w = src_impl->resource.width;
src_h = src_impl->resource.height;
src_w = src_surface->resource.width;
src_h = src_surface->resource.height;
update_w = src_rect ? src_rect->right - src_rect->left : src_w;
update_h = src_rect ? src_rect->bottom - src_rect->top : src_h;
data = src_impl->resource.allocatedMemory;
data = src_surface->resource.allocatedMemory;
if (!data) ERR("Source surface has no allocated memory, but should be a sysmem surface.\n");
ENTER_GL();
@ -5587,12 +5581,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
}
TRACE("glCompressedTexSubImage2DARB, target %#x, level %d, x %d, y %d, w %d, h %d, "
"format %#x, image_size %#x, data %p.\n", dst_impl->texture_target, dst_impl->texture_level,
"format %#x, image_size %#x, data %p.\n", dst_surface->texture_target, dst_surface->texture_level,
dst_x, dst_y, update_w, update_h, dst_format->glFormat, row_count * row_length, data);
if (row_length == src_pitch)
{
GL_EXTCALL(glCompressedTexSubImage2DARB(dst_impl->texture_target, dst_impl->texture_level,
GL_EXTCALL(glCompressedTexSubImage2DARB(dst_surface->texture_target, dst_surface->texture_level,
dst_x, dst_y, update_w, update_h, dst_format->glInternal, row_count * row_length, data));
}
else
@ -5603,7 +5597,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
* can't use the unpack row length like below. */
for (row = 0, y = dst_y; row < row_count; ++row)
{
GL_EXTCALL(glCompressedTexSubImage2DARB(dst_impl->texture_target, dst_impl->texture_level,
GL_EXTCALL(glCompressedTexSubImage2DARB(dst_surface->texture_target, dst_surface->texture_level,
dst_x, y, update_w, src_format->block_height, dst_format->glInternal, row_length, data));
y += src_format->block_height;
data += src_pitch;
@ -5620,11 +5614,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
}
TRACE("glTexSubImage2D, target %#x, level %d, x %d, y %d, w %d, h %d, format %#x, type %#x, data %p.\n",
dst_impl->texture_target, dst_impl->texture_level, dst_x, dst_y,
dst_surface->texture_target, dst_surface->texture_level, dst_x, dst_y,
update_w, update_h, dst_format->glFormat, dst_format->glType, data);
glPixelStorei(GL_UNPACK_ROW_LENGTH, src_w);
glTexSubImage2D(dst_impl->texture_target, dst_impl->texture_level, dst_x, dst_y,
glTexSubImage2D(dst_surface->texture_target, dst_surface->texture_level, dst_x, dst_y,
update_w, update_h, dst_format->glFormat, dst_format->glType, data);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
checkGLcall("glTexSubImage2D");
@ -5633,7 +5627,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
LEAVE_GL();
context_release(context);
surface_modify_location(dst_impl, SFLAG_INTEXTURE, TRUE);
surface_modify_location(dst_surface, SFLAG_INTEXTURE, TRUE);
sampler = This->rev_tex_unit_map[0];
if (sampler != WINED3D_UNMAPPED_STAGE)
{
@ -5766,21 +5760,19 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DeletePatch(IWineD3DDevice *iface, UINT
/* Do not call while under the GL lock. */
static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface,
IWineD3DSurface *surface, const RECT *rect, const WINED3DCOLORVALUE *color)
struct wined3d_surface *surface, const RECT *rect, const WINED3DCOLORVALUE *color)
{
IWineD3DSurfaceImpl *s = (IWineD3DSurfaceImpl *)surface;
TRACE("iface %p, surface %p, rect %s, color {%.8e, %.8e, %.8e, %.8e}.\n",
iface, surface, wine_dbgstr_rect(rect),
color->r, color->g, color->b, color->a);
if (s->resource.pool != WINED3DPOOL_DEFAULT && s->resource.pool != WINED3DPOOL_SYSTEMMEM)
if (surface->resource.pool != WINED3DPOOL_DEFAULT && surface->resource.pool != WINED3DPOOL_SYSTEMMEM)
{
FIXME("call to colorfill with non WINED3DPOOL_DEFAULT or WINED3DPOOL_SYSTEMMEM surface\n");
return WINED3DERR_INVALIDCALL;
}
return surface_color_fill(s, rect, color);
return surface_color_fill(surface, rect, color);
}
/* Do not call while under the GL lock. */
@ -5803,7 +5795,7 @@ static void WINAPI IWineD3DDeviceImpl_ClearRendertargetView(IWineD3DDevice *ifac
/* rendertarget and depth stencil functions */
static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice *iface,
DWORD render_target_idx, IWineD3DSurface **render_target)
DWORD render_target_idx, struct wined3d_surface **render_target)
{
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
@ -5816,7 +5808,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice *iface,
return WINED3DERR_INVALIDCALL;
}
*render_target = (IWineD3DSurface *)device->render_targets[render_target_idx];
*render_target = device->render_targets[render_target_idx];
if (*render_target)
wined3d_surface_incref(*render_target);
@ -5825,13 +5817,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice *iface,
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice *iface, IWineD3DSurface **depth_stencil)
static HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice *iface,
struct wined3d_surface **depth_stencil)
{
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil);
*depth_stencil = (IWineD3DSurface *)device->depth_stencil;
*depth_stencil = device->depth_stencil;
TRACE("Returning depth/stencil surface %p.\n", *depth_stencil);
if (!*depth_stencil) return WINED3DERR_NOTFOUND;
wined3d_surface_incref(*depth_stencil);
@ -5840,10 +5833,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice *
}
static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface,
DWORD render_target_idx, IWineD3DSurface *render_target, BOOL set_viewport)
DWORD render_target_idx, struct wined3d_surface *render_target, BOOL set_viewport)
{
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
IWineD3DSurfaceImpl *prev;
struct wined3d_surface *prev;
TRACE("iface %p, render_target_idx %u, render_target %p, set_viewport %#x.\n",
iface, render_target_idx, render_target, set_viewport);
@ -5855,7 +5848,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface,
}
prev = device->render_targets[render_target_idx];
if (render_target == (IWineD3DSurface *)prev)
if (render_target == prev)
{
TRACE("Trying to do a NOP SetRenderTarget operation.\n");
return WINED3D_OK;
@ -5868,7 +5861,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface,
return WINED3DERR_INVALIDCALL;
}
if (render_target && !(((IWineD3DSurfaceImpl *)render_target)->resource.usage & WINED3DUSAGE_RENDERTARGET))
if (render_target && !(render_target->resource.usage & WINED3DUSAGE_RENDERTARGET))
{
FIXME("Surface %p doesn't have render target usage.\n", render_target);
return WINED3DERR_INVALIDCALL;
@ -5876,7 +5869,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface,
if (render_target)
wined3d_surface_incref(render_target);
device->render_targets[render_target_idx] = (IWineD3DSurfaceImpl *)render_target;
device->render_targets[render_target_idx] = render_target;
/* Release after the assignment, to prevent device_resource_released()
* from seeing the surface as still in use. */
if (prev)
@ -5906,14 +5899,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface,
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *iface, IWineD3DSurface *depth_stencil)
static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *iface,
struct wined3d_surface *depth_stencil)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DSurfaceImpl *tmp;
struct wined3d_surface *tmp;
TRACE("device %p, depth_stencil %p, old depth_stencil %p.\n", This, depth_stencil, This->depth_stencil);
if (This->depth_stencil == (IWineD3DSurfaceImpl *)depth_stencil)
if (This->depth_stencil == depth_stencil)
{
TRACE("Trying to do a NOP SetRenderTarget operation.\n");
return WINED3D_OK;
@ -5936,7 +5930,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
}
tmp = This->depth_stencil;
This->depth_stencil = (IWineD3DSurfaceImpl *)depth_stencil;
This->depth_stencil = depth_stencil;
if (This->depth_stencil)
wined3d_surface_incref(This->depth_stencil);
if (tmp)
@ -5959,10 +5953,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
}
static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *iface,
UINT XHotSpot, UINT YHotSpot, IWineD3DSurface *cursor_image)
UINT XHotSpot, UINT YHotSpot, struct wined3d_surface *cursor_image)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DSurfaceImpl *s = (IWineD3DSurfaceImpl *)cursor_image;
WINED3DLOCKED_RECT lockedRect;
TRACE("iface %p, hotspot_x %u, hotspot_y %u, cursor_image %p.\n",
@ -5979,7 +5972,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
This->cursorTexture = 0;
}
if (s->resource.width == 32 && s->resource.height == 32)
if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32)
This->haveHardwareCursor = TRUE;
else
This->haveHardwareCursor = FALSE;
@ -5989,18 +5982,19 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
WINED3DLOCKED_RECT rect;
/* MSDN: Cursor must be A8R8G8B8 */
if (s->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM)
if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM)
{
WARN("surface %p has an invalid format.\n", cursor_image);
return WINED3DERR_INVALIDCALL;
}
/* MSDN: Cursor must be smaller than the display mode */
if (s->resource.width > This->ddraw_width
|| s->resource.height > This->ddraw_height)
if (cursor_image->resource.width > This->ddraw_width
|| cursor_image->resource.height > This->ddraw_height)
{
WARN("Surface %p dimensions are %ux%u, but screen dimensions are %ux%u.\n",
s, s->resource.width, s->resource.height, This->ddraw_width, This->ddraw_height);
cursor_image, cursor_image->resource.width, cursor_image->resource.height,
This->ddraw_width, This->ddraw_height);
return WINED3DERR_INVALIDCALL;
}
@ -6011,10 +6005,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
* release it after setting the cursor image. Windows doesn't
* addref the set surface, so we can't do this either without
* creating circular refcount dependencies. Copy out the gl texture
* instead.
*/
This->cursorWidth = s->resource.width;
This->cursorHeight = s->resource.height;
* instead. */
This->cursorWidth = cursor_image->resource.width;
This->cursorHeight = cursor_image->resource.height;
if (SUCCEEDED(wined3d_surface_map(cursor_image, &rect, NULL, WINED3DLOCK_READONLY)))
{
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
@ -6090,16 +6083,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
* 32-bit cursors. 32x32 bits split into 32-bit chunks == 32
* chunks. */
DWORD *maskBits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
(s->resource.width * s->resource.height / 8));
(cursor_image->resource.width * cursor_image->resource.height / 8));
wined3d_surface_map(cursor_image, &lockedRect, NULL,
WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY);
TRACE("width: %u height: %u.\n", s->resource.width, s->resource.height);
TRACE("width: %u height: %u.\n", cursor_image->resource.width, cursor_image->resource.height);
cursorInfo.fIcon = FALSE;
cursorInfo.xHotspot = XHotSpot;
cursorInfo.yHotspot = YHotSpot;
cursorInfo.hbmMask = CreateBitmap(s->resource.width, s->resource.height, 1, 1, maskBits);
cursorInfo.hbmColor = CreateBitmap(s->resource.width, s->resource.height, 1, 32, lockedRect.pBits);
cursorInfo.hbmMask = CreateBitmap(cursor_image->resource.width, cursor_image->resource.height,
1, 1, maskBits);
cursorInfo.hbmColor = CreateBitmap(cursor_image->resource.width, cursor_image->resource.height,
1, 32, lockedRect.pBits);
wined3d_surface_unmap(cursor_image);
/* Create our cursor and clean up. */
cursor = CreateIconIndirect(&cursorInfo);
@ -6185,7 +6180,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EvictManagedResources(IWineD3DDevice *i
return WINED3D_OK;
}
static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRESENT_PARAMETERS* pPresentationParameters)
static HRESULT updateSurfaceDesc(struct wined3d_surface *surface,
const WINED3DPRESENT_PARAMETERS *pPresentationParameters)
{
IWineD3DDeviceImpl *device = surface->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@ -6325,8 +6321,8 @@ static void delete_opengl_contexts(IWineD3DDeviceImpl *device, struct wined3d_sw
static HRESULT create_primary_opengl_context(IWineD3DDeviceImpl *device, struct wined3d_swapchain *swapchain)
{
struct wined3d_context *context;
struct wined3d_surface *target;
HRESULT hr;
IWineD3DSurfaceImpl *target;
/* Recreate the primary swapchain's context */
swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context));
@ -6466,7 +6462,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice *iface,
pPresentationParameters->MultiSampleType,
pPresentationParameters->MultiSampleQuality,
FALSE,
(IWineD3DSurface **)&This->auto_depth_stencil);
&This->auto_depth_stencil);
if (FAILED(hrc))
{
ERR("Failed to create the depth stencil buffer.\n");
@ -6483,7 +6479,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice *iface,
/* Reset the depth stencil */
if (pPresentationParameters->EnableAutoDepthStencil)
IWineD3DDevice_SetDepthStencilSurface(iface, (IWineD3DSurface *)This->auto_depth_stencil);
IWineD3DDevice_SetDepthStencilSurface(iface, This->auto_depth_stencil);
else
IWineD3DDevice_SetDepthStencilSurface(iface, NULL);
@ -6721,7 +6717,7 @@ void device_resource_released(struct IWineD3DDeviceImpl *device, struct wined3d_
{
case WINED3DRTYPE_SURFACE:
{
IWineD3DSurfaceImpl *surface = surface_from_resource(resource);
struct wined3d_surface *surface = surface_from_resource(resource);
if (!device->d3d_initialized) break;
@ -6837,7 +6833,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EnumResources(IWineD3DDevice *iface,
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_GetSurfaceFromDC(IWineD3DDevice *iface, HDC dc, IWineD3DSurface **surface)
static HRESULT WINAPI IWineD3DDeviceImpl_GetSurfaceFromDC(IWineD3DDevice *iface,
HDC dc, struct wined3d_surface **surface)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
struct wined3d_resource *resource;
@ -6846,12 +6843,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSurfaceFromDC(IWineD3DDevice *iface,
{
if (resource->resourceType == WINED3DRTYPE_SURFACE)
{
IWineD3DSurfaceImpl *s = surface_from_resource(resource);
struct wined3d_surface *s = surface_from_resource(resource);
if (s->hDC == dc)
{
TRACE("Found surface %p for dc %p.\n", s, dc);
*surface = (IWineD3DSurface *)s;
*surface = s;
return WINED3D_OK;
}
}

View File

@ -571,7 +571,7 @@ void drawPrimitive(IWineD3DDeviceImpl *device, UINT index_count, UINT StartIdx,
/* Invalidate the back buffer memory so LockRect will read it the next time */
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
IWineD3DSurfaceImpl *target = device->render_targets[i];
struct wined3d_surface *target = device->render_targets[i];
if (target)
{
surface_load_location(target, SFLAG_INDRAWABLE, NULL);
@ -608,7 +608,7 @@ void drawPrimitive(IWineD3DDeviceImpl *device, UINT index_count, UINT StartIdx,
DWORD location = context->render_offscreen ? SFLAG_DS_OFFSCREEN : SFLAG_DS_ONSCREEN;
if (state->render_states[WINED3DRS_ZWRITEENABLE] || state->render_states[WINED3DRS_ZENABLE])
{
IWineD3DSurfaceImpl *ds = device->depth_stencil;
struct wined3d_surface *ds = device->depth_stencil;
RECT current_rect, draw_rect, r;
if (location == SFLAG_DS_ONSCREEN && ds != device->onscreen_depth_stencil)

View File

@ -135,7 +135,7 @@ HRESULT CDECL wined3d_palette_set_entries(struct wined3d_palette *palette,
{
if (resource->resourceType == WINED3DRTYPE_SURFACE)
{
IWineD3DSurfaceImpl *surface = surface_from_resource(resource);
struct wined3d_surface *surface = surface_from_resource(resource);
if (surface->palette == palette)
surface->surface_ops->surface_realize_palette(surface);
}

View File

@ -1872,7 +1872,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
if (state->render_states[WINED3DRS_SRGBWRITEENABLE])
{
IWineD3DSurfaceImpl *rt = device->render_targets[0];
struct wined3d_surface *rt = device->render_targets[0];
if (rt->resource.format->flags & WINED3DFMT_FLAG_SRGB_WRITE) args->srgb_correction = 1;
}

View File

@ -242,7 +242,7 @@ static void state_ambient(DWORD state, struct wined3d_stateblock *stateblock, st
static void state_blend(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{
IWineD3DSurfaceImpl *target = stateblock->device->render_targets[0];
struct wined3d_surface *target = stateblock->device->render_targets[0];
const struct wined3d_gl_info *gl_info = context->gl_info;
int srcBlend = GL_ZERO;
int dstBlend = GL_ZERO;
@ -503,7 +503,7 @@ static void state_alpha(DWORD state, struct wined3d_stateblock *stateblock, stru
if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
{
IWineD3DSurfaceImpl *surf = surface_from_resource(texture->sub_resources[0]);
struct wined3d_surface *surf = surface_from_resource(texture->sub_resources[0]);
if (surf->CKeyFlags & WINEDDSD_CKSRCBLT)
{
@ -1751,7 +1751,7 @@ static void state_depthbias(DWORD state, struct wined3d_stateblock *stateblock,
if (stateblock->state.render_states[WINED3DRS_SLOPESCALEDEPTHBIAS]
|| stateblock->state.render_states[WINED3DRS_DEPTHBIAS])
{
IWineD3DSurfaceImpl *depth = stateblock->device->depth_stencil;
struct wined3d_surface *depth = stateblock->device->depth_stencil;
float scale;
union
@ -3182,7 +3182,7 @@ void tex_alphaop(DWORD state, struct wined3d_stateblock *stateblock, struct wine
if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
{
IWineD3DSurfaceImpl *surf = surface_from_resource(texture->sub_resources[0]);
struct wined3d_surface *surf = surface_from_resource(texture->sub_resources[0]);
if (surf->CKeyFlags & WINEDDSD_CKSRCBLT && !surf->resource.format->alpha_mask)
{
@ -4718,7 +4718,7 @@ static void vertexdeclaration(DWORD state_id, struct wined3d_stateblock *statebl
static void viewport_miscpart(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{
IWineD3DSurfaceImpl *target = stateblock->device->render_targets[0];
struct wined3d_surface *target = stateblock->device->render_targets[0];
UINT width, height;
WINED3DVIEWPORT vp = stateblock->state.viewport;
@ -4874,7 +4874,7 @@ static void light(DWORD state, struct wined3d_stateblock *stateblock, struct win
static void scissorrect(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{
IWineD3DSurfaceImpl *target = stateblock->device->render_targets[0];
struct wined3d_surface *target = stateblock->device->render_targets[0];
RECT *pRect = &stateblock->state.scissor_rect;
UINT height;
UINT width;

View File

@ -1092,7 +1092,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
} tmpfloat;
unsigned int i;
struct wined3d_swapchain *swapchain;
IWineD3DSurface *backbuffer;
struct wined3d_surface *backbuffer;
HRESULT hr;
TRACE("stateblock %p.\n", stateblock);

File diff suppressed because it is too large Load Diff

View File

@ -152,7 +152,7 @@ HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain,
}
HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain,
IWineD3DSurface *dst_surface)
struct wined3d_surface *dst_surface)
{
POINT offset = {0, 0};
@ -167,7 +167,7 @@ HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapc
}
HRESULT CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain,
UINT back_buffer_idx, WINED3DBACKBUFFER_TYPE type, IWineD3DSurface **back_buffer)
UINT back_buffer_idx, WINED3DBACKBUFFER_TYPE type, struct wined3d_surface **back_buffer)
{
TRACE("swapchain %p, back_buffer_idx %u, type %#x, back_buffer %p.\n",
swapchain, back_buffer_idx, type, back_buffer);
@ -280,7 +280,7 @@ HRESULT CDECL wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *s
static void swapchain_blit(struct wined3d_swapchain *swapchain,
struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect)
{
IWineD3DSurfaceImpl *backbuffer = swapchain->back_buffers[0];
struct wined3d_surface *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;
@ -424,7 +424,7 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
/* Render the cursor onto the back buffer, using our nifty directdraw blitting code :-) */
if (swapchain->device->bCursorVisible && swapchain->device->cursorTexture)
{
IWineD3DSurfaceImpl cursor;
struct wined3d_surface cursor;
RECT destRect =
{
swapchain->device->xScreenSpace - swapchain->device->xHotSpot,
@ -581,8 +581,8 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping
*/
IWineD3DSurfaceImpl *front = swapchain->front_buffer;
IWineD3DSurfaceImpl *back = swapchain->back_buffers[0];
struct wined3d_surface *front = swapchain->front_buffer;
struct wined3d_surface *back = swapchain->back_buffers[0];
if(front->resource.size == back->resource.size) {
DWORD fbflags;
@ -643,7 +643,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(struct wined3d_swapchain *swapchain, const RECT *rect)
{
IWineD3DSurfaceImpl *front;
struct wined3d_surface *front;
POINT offset = {0, 0};
HDC src_dc, dst_dc;
RECT draw_rect;
@ -720,7 +720,7 @@ void x11_copy_to_screen(struct wined3d_swapchain *swapchain, const RECT *rect)
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;
struct wined3d_surface *front, *back;
if (!swapchain->back_buffers)
{
@ -900,7 +900,7 @@ HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surf
swapchain->presentParms.BackBufferWidth, swapchain->presentParms.BackBufferHeight,
swapchain->presentParms.BackBufferFormat, swapchain->presentParms.MultiSampleType,
swapchain->presentParms.MultiSampleQuality, TRUE /* Lockable */,
(IWineD3DSurface **)&swapchain->front_buffer);
&swapchain->front_buffer);
if (FAILED(hr))
{
WARN("Failed to create front buffer, hr %#x.\n", hr);
@ -1011,7 +1011,7 @@ HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surf
swapchain->presentParms.BackBufferWidth, swapchain->presentParms.BackBufferHeight,
swapchain->presentParms.BackBufferFormat, swapchain->presentParms.MultiSampleType,
swapchain->presentParms.MultiSampleQuality, TRUE /* Lockable */,
(IWineD3DSurface **)&swapchain->back_buffers[i]);
&swapchain->back_buffers[i]);
if (FAILED(hr))
{
WARN("Failed to create back buffer %u, hr %#x.\n", i, hr);
@ -1032,7 +1032,7 @@ HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surf
swapchain->presentParms.BackBufferWidth, swapchain->presentParms.BackBufferHeight,
swapchain->presentParms.AutoDepthStencilFormat, swapchain->presentParms.MultiSampleType,
swapchain->presentParms.MultiSampleQuality, FALSE /* FIXME: Discard */,
(IWineD3DSurface **)&device->auto_depth_stencil);
&device->auto_depth_stencil);
if (FAILED(hr))
{
WARN("Failed to create the auto depth stencil, hr %#x.\n", hr);

View File

@ -627,7 +627,7 @@ static HRESULT texture2d_bind(struct wined3d_texture *texture,
for (i = 0; i < sub_count; ++i)
{
IWineD3DSurfaceImpl *surface = surface_from_resource(texture->sub_resources[i]);
struct wined3d_surface *surface = surface_from_resource(texture->sub_resources[i]);
surface_set_texture_name(surface, gl_tex->name, srgb_tex);
}
@ -709,7 +709,7 @@ static void texture2d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
{
for (i = 0; i < sub_count; ++i)
{
IWineD3DSurfaceImpl *surface = surface_from_resource(texture->sub_resources[i]);
struct wined3d_surface *surface = surface_from_resource(texture->sub_resources[i]);
if (palette9_changed(surface))
{
@ -750,7 +750,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
{
IWineD3DSurfaceImpl *surface = surface_from_resource(sub_resource);
struct wined3d_surface *surface = surface_from_resource(sub_resource);
/* Clean out the texture name we gave to the surface so that the
* surface doesn't try and release it. */
@ -773,7 +773,7 @@ static void texture2d_unload(struct wined3d_resource *resource)
for (i = 0; i < sub_count; ++i)
{
struct wined3d_resource *sub_resource = texture->sub_resources[i];
IWineD3DSurfaceImpl *surface = surface_from_resource(sub_resource);
struct wined3d_surface *surface = surface_from_resource(sub_resource);
sub_resource->resource_ops->resource_unload(sub_resource);
surface_set_texture_name(surface, 0, FALSE); /* Delete RGB name */
@ -893,7 +893,7 @@ HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
};
UINT idx = j * texture->level_count + i;
IWineD3DSurface *surface;
struct wined3d_surface *surface;
hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w,
format_id, usage, pool, i /* Level */, j, &surface);
@ -904,9 +904,9 @@ HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT
return hr;
}
surface_set_container((IWineD3DSurfaceImpl *)surface, WINED3D_CONTAINER_TEXTURE, texture);
surface_set_texture_target((IWineD3DSurfaceImpl *)surface, cube_targets[j]);
texture->sub_resources[idx] = &((IWineD3DSurfaceImpl *)surface)->resource;
surface_set_container(surface, WINED3D_CONTAINER_TEXTURE, texture);
surface_set_texture_target(surface, cube_targets[j]);
texture->sub_resources[idx] = &surface->resource;
TRACE("Created surface level %u @ %p.\n", i, surface);
}
tmp_w = max(1, tmp_w >> 1);
@ -1048,7 +1048,7 @@ HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, U
tmp_h = height;
for (i = 0; i < texture->level_count; ++i)
{
IWineD3DSurface *surface;
struct wined3d_surface *surface;
/* Use the callback to create the texture surface. */
hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h,
@ -1060,9 +1060,9 @@ HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, U
return hr;
}
surface_set_container((IWineD3DSurfaceImpl *)surface, WINED3D_CONTAINER_TEXTURE, texture);
surface_set_texture_target((IWineD3DSurfaceImpl *)surface, texture->target);
texture->sub_resources[i] = &((IWineD3DSurfaceImpl *)surface)->resource;
surface_set_container(surface, WINED3D_CONTAINER_TEXTURE, texture);
surface_set_texture_target(surface, texture->target);
texture->sub_resources[i] = &surface->resource;
TRACE("Created surface level %u @ %p.\n", i, surface);
/* Calculate the next mipmap level. */
tmp_w = max(1, tmp_w >> 1);

View File

@ -2771,7 +2771,7 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett
DWORD ttff;
DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
IWineD3DDeviceImpl *device = stateblock->device;
IWineD3DSurfaceImpl *rt = device->render_targets[0];
struct wined3d_surface *rt = device->render_targets[0];
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
for (i = 0; i < gl_info->limits.texture_stages; ++i)
@ -2866,7 +2866,7 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett
if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
{
IWineD3DSurfaceImpl *surf = surface_from_resource(texture->sub_resources[0]);
struct wined3d_surface *surf = surface_from_resource(texture->sub_resources[0]);
if (surf->CKeyFlags & WINEDDSD_CKSRCBLT && !surf->resource.format->alpha_mask)
{

View File

@ -53,8 +53,6 @@
#define WINED3D_QUIRK_FBO_TEX_UPDATE 0x00000020
typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl;
typedef struct wined3d_surface IWineD3DSurfaceImpl;
typedef struct wined3d_surface IWineD3DSurface;
/* Texture format fixups */
@ -1048,7 +1046,7 @@ struct wined3d_context
DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */
struct wined3d_swapchain *swapchain;
IWineD3DSurfaceImpl *current_rt;
struct wined3d_surface *current_rt;
DWORD tid; /* Thread ID which owns this context at the moment */
/* Stores some information about the context state for optimization */
@ -1096,7 +1094,7 @@ struct wined3d_context
GLuint fbo_read_binding;
GLuint fbo_draw_binding;
BOOL rebind_fbo;
IWineD3DSurfaceImpl **blit_targets;
struct wined3d_surface **blit_targets;
GLenum *draw_buffers;
/* Queries */
@ -1178,14 +1176,14 @@ struct blit_shader
{
HRESULT (*alloc_private)(IWineD3DDeviceImpl *device);
void (*free_private)(IWineD3DDeviceImpl *device);
HRESULT (*set_shader)(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface);
HRESULT (*set_shader)(void *blit_priv, const struct wined3d_gl_info *gl_info, struct wined3d_surface *surface);
void (*unset_shader)(const struct wined3d_gl_info *gl_info);
BOOL (*blit_supported)(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op,
const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format *src_format,
const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format *dst_format);
HRESULT (*color_fill)(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *dst_surface,
HRESULT (*color_fill)(IWineD3DDeviceImpl *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const WINED3DCOLORVALUE *color);
HRESULT (*depth_fill)(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *surface, const RECT *rect, float depth);
HRESULT (*depth_fill)(IWineD3DDeviceImpl *device, struct wined3d_surface *surface, const RECT *rect, float depth);
};
extern const struct blit_shader ffp_blit DECLSPEC_HIDDEN;
@ -1198,26 +1196,26 @@ const struct blit_shader *wined3d_select_blitter(const struct wined3d_gl_info *g
DECLSPEC_HIDDEN;
/* Temporary blit_shader helper functions */
HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_surface, const RECT *src_rect,
IWineD3DSurfaceImpl *dst_surface, const RECT *dst_rect_in, enum wined3d_blit_op blit_op,
DWORD Filter) DECLSPEC_HIDDEN;
HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, struct wined3d_surface *src_surface,
const RECT *src_rect, struct wined3d_surface *dst_surface, const RECT *dst_rect_in,
enum wined3d_blit_op blit_op, DWORD Filter) DECLSPEC_HIDDEN;
struct wined3d_context *context_acquire(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target) DECLSPEC_HIDDEN;
struct wined3d_context *context_acquire(IWineD3DDeviceImpl *This, struct wined3d_surface *target) DECLSPEC_HIDDEN;
void context_alloc_event_query(struct wined3d_context *context,
struct wined3d_event_query *query) DECLSPEC_HIDDEN;
void context_alloc_occlusion_query(struct wined3d_context *context,
struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN;
void context_apply_blit_state(struct wined3d_context *context, IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN;
BOOL context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device,
UINT rt_count, IWineD3DSurfaceImpl **rts, IWineD3DSurfaceImpl *depth_stencil) DECLSPEC_HIDDEN;
UINT rt_count, struct wined3d_surface **rts, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN;
BOOL context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN;
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,
IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil, DWORD location) DECLSPEC_HIDDEN;
struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN;
void context_attach_depth_stencil_fbo(struct wined3d_context *context,
GLenum fbo_target, IWineD3DSurfaceImpl *depth_stencil, BOOL use_render_buffer) DECLSPEC_HIDDEN;
GLenum fbo_target, struct wined3d_surface *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(struct wined3d_swapchain *swapchain, IWineD3DSurfaceImpl *target,
struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, struct wined3d_surface *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;
@ -1232,7 +1230,7 @@ void context_resource_unloaded(struct IWineD3DDeviceImpl *device,
BOOL context_set_current(struct wined3d_context *ctx) DECLSPEC_HIDDEN;
void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer) DECLSPEC_HIDDEN;
void context_set_tls_idx(DWORD idx) DECLSPEC_HIDDEN;
void context_surface_update(struct wined3d_context *context, IWineD3DSurfaceImpl *surface) DECLSPEC_HIDDEN;
void context_surface_update(struct wined3d_context *context, struct wined3d_surface *surface) DECLSPEC_HIDDEN;
/* Macros for doing basic GPU detection based on opengl capabilities */
#define WINE_D3D6_CAPABLE(gl_info) (gl_info->supported[ARB_MULTITEXTURE])
@ -1714,10 +1712,10 @@ struct IWineD3DDeviceImpl
unsigned int highest_dirty_ps_const, highest_dirty_vs_const;
/* Render Target Support */
IWineD3DSurfaceImpl **render_targets;
IWineD3DSurfaceImpl *auto_depth_stencil;
IWineD3DSurfaceImpl *onscreen_depth_stencil;
IWineD3DSurfaceImpl *depth_stencil;
struct wined3d_surface **render_targets;
struct wined3d_surface *auto_depth_stencil;
struct wined3d_surface *onscreen_depth_stencil;
struct wined3d_surface *depth_stencil;
/* palettes texture management */
PALETTEENTRY **palettes;
@ -1740,7 +1738,7 @@ struct IWineD3DDeviceImpl
HCURSOR hardwareCursor;
/* The Wine logo surface */
IWineD3DSurface *logo_surface;
struct wined3d_surface *logo_surface;
/* Textures for when no other textures are mapped */
UINT dummyTextureName[MAX_TEXTURES];
@ -1770,8 +1768,8 @@ struct IWineD3DDeviceImpl
struct WineD3DRectPatch *currentPatch;
};
HRESULT device_clear_render_targets(IWineD3DDeviceImpl *device, UINT rt_count, IWineD3DSurfaceImpl **rts,
IWineD3DSurfaceImpl *depth_stencil, UINT rect_count, const RECT *rects, const RECT *draw_rect,
HRESULT device_clear_render_targets(IWineD3DDeviceImpl *device, UINT rt_count, struct wined3d_surface **rts,
struct wined3d_surface *depth_stencil, UINT rect_count, const RECT *rects, const RECT *draw_rect,
DWORD flags, const WINED3DCOLORVALUE *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
BOOL device_context_add(IWineD3DDeviceImpl *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
void device_context_remove(IWineD3DDeviceImpl *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
@ -1787,7 +1785,7 @@ void device_resource_released(struct IWineD3DDeviceImpl *device, struct wined3d_
void device_stream_info_from_declaration(IWineD3DDeviceImpl *This,
BOOL use_vshader, struct wined3d_stream_info *stream_info, BOOL *fixup) DECLSPEC_HIDDEN;
void device_switch_onscreen_ds(IWineD3DDeviceImpl *device, struct wined3d_context *context,
IWineD3DSurfaceImpl *depth_stencil) DECLSPEC_HIDDEN;
struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN;
void device_update_stream_info(IWineD3DDeviceImpl *device, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This) DECLSPEC_HIDDEN;
void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) DECLSPEC_HIDDEN;
@ -1985,8 +1983,8 @@ typedef struct {
struct fbo_entry
{
struct list entry;
IWineD3DSurfaceImpl **render_targets;
IWineD3DSurfaceImpl *depth_stencil;
struct wined3d_surface **render_targets;
struct wined3d_surface *depth_stencil;
DWORD location;
BOOL attached;
GLuint id;
@ -2088,56 +2086,56 @@ struct wined3d_surface
/* DirectDraw Overlay handling */
RECT overlay_srcrect;
RECT overlay_destrect;
IWineD3DSurfaceImpl *overlay_dest;
struct wined3d_surface *overlay_dest;
struct list overlays;
struct list overlay_entry;
};
static inline IWineD3DSurfaceImpl *surface_from_resource(struct wined3d_resource *resource)
static inline struct wined3d_surface *surface_from_resource(struct wined3d_resource *resource)
{
return CONTAINING_RECORD(resource, IWineD3DSurfaceImpl, resource);
return CONTAINING_RECORD(resource, struct wined3d_surface, resource);
}
static inline GLuint surface_get_texture_name(IWineD3DSurfaceImpl *surface,
static inline GLuint surface_get_texture_name(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info, BOOL srgb)
{
return srgb && !gl_info->supported[EXT_TEXTURE_SRGB_DECODE]
? surface->texture_name_srgb : surface->texture_name;
}
void surface_add_dirty_rect(IWineD3DSurfaceImpl *surface, const WINED3DBOX *dirty_rect) DECLSPEC_HIDDEN;
void surface_bind(IWineD3DSurfaceImpl *surface, const struct wined3d_gl_info *gl_info, BOOL srgb) DECLSPEC_HIDDEN;
HRESULT surface_color_fill(IWineD3DSurfaceImpl *s, const RECT *rect, const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN;
GLenum surface_get_gl_buffer(IWineD3DSurfaceImpl *surface) DECLSPEC_HIDDEN;
HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment,
void surface_add_dirty_rect(struct wined3d_surface *surface, const WINED3DBOX *dirty_rect) DECLSPEC_HIDDEN;
void surface_bind(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL srgb) DECLSPEC_HIDDEN;
HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN;
GLenum surface_get_gl_buffer(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
HRESULT surface_init(struct wined3d_surface *surface, WINED3DSURFTYPE surface_type, UINT alignment,
UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type,
UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
BOOL surface_init_sysmem(IWineD3DSurfaceImpl *surface) DECLSPEC_HIDDEN;
void surface_internal_preload(IWineD3DSurfaceImpl *surface, enum WINED3DSRGB srgb) DECLSPEC_HIDDEN;
BOOL surface_is_offscreen(IWineD3DSurfaceImpl *iface) DECLSPEC_HIDDEN;
HRESULT surface_load(IWineD3DSurfaceImpl *surface, BOOL srgb) DECLSPEC_HIDDEN;
void surface_load_ds_location(IWineD3DSurfaceImpl *surface,
BOOL surface_init_sysmem(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void surface_internal_preload(struct wined3d_surface *surface, enum WINED3DSRGB srgb) DECLSPEC_HIDDEN;
BOOL surface_is_offscreen(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
HRESULT surface_load(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN;
void surface_load_ds_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RECT *rect) DECLSPEC_HIDDEN;
void surface_modify_ds_location(IWineD3DSurfaceImpl *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL persistent) DECLSPEC_HIDDEN;
void surface_prepare_texture(IWineD3DSurfaceImpl *surface,
HRESULT surface_load_location(struct wined3d_surface *surface, DWORD flag, const RECT *rect) DECLSPEC_HIDDEN;
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
void surface_modify_location(struct wined3d_surface *surface, DWORD flag, BOOL persistent) DECLSPEC_HIDDEN;
void surface_prepare_texture(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info, BOOL srgb) DECLSPEC_HIDDEN;
void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, IWineD3DSurfaceImpl *rt) DECLSPEC_HIDDEN;
void surface_set_container(IWineD3DSurfaceImpl *surface,
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, struct wined3d_surface *rt) DECLSPEC_HIDDEN;
void surface_set_container(struct wined3d_surface *surface,
enum wined3d_container_type type, void *container) DECLSPEC_HIDDEN;
void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;
void surface_set_texture_target(IWineD3DSurfaceImpl *surface, GLenum target) DECLSPEC_HIDDEN;
void surface_translate_drawable_coords(IWineD3DSurfaceImpl *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN;
void surface_set_texture_name(struct wined3d_surface *surface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;
void surface_set_texture_target(struct wined3d_surface *surface, GLenum target) DECLSPEC_HIDDEN;
void surface_translate_drawable_coords(struct wined3d_surface *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN;
void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN;
void get_drawable_size_backbuffer(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN;
void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN;
void draw_textured_quad(IWineD3DSurfaceImpl *src_surface, const RECT *src_rect,
void draw_textured_quad(struct wined3d_surface *src_surface, const RECT *src_rect,
const RECT *dst_rect, WINED3DTEXTUREFILTERTYPE Filter) DECLSPEC_HIDDEN;
void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back) DECLSPEC_HIDDEN;
void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN;
/* Surface flags: */
#define SFLAG_CONVERTED 0x00000002 /* Converted for color keying or Palettized */
@ -2199,11 +2197,11 @@ typedef enum {
CONVERT_RGB32_888
} CONVERT_TYPES;
HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *surface, BOOL need_alpha_ck, BOOL use_texturing,
HRESULT d3dfmt_get_conv(struct wined3d_surface *surface, BOOL need_alpha_ck, BOOL use_texturing,
struct wined3d_format *format, CONVERT_TYPES *convert) DECLSPEC_HIDDEN;
void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *surface, BYTE table[256][4], BOOL colorkey) DECLSPEC_HIDDEN;
void d3dfmt_p8_init_palette(struct wined3d_surface *surface, BYTE table[256][4], BOOL colorkey) DECLSPEC_HIDDEN;
BOOL palette9_changed(IWineD3DSurfaceImpl *This) DECLSPEC_HIDDEN;
BOOL palette9_changed(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
struct wined3d_vertex_declaration_element
{
@ -2484,8 +2482,8 @@ struct wined3d_swapchain
const struct wined3d_swapchain_ops *swapchain_ops;
IWineD3DDeviceImpl *device;
IWineD3DSurfaceImpl **back_buffers;
IWineD3DSurfaceImpl *front_buffer;
struct wined3d_surface **back_buffers;
struct wined3d_surface *front_buffer;
WINED3DPRESENT_PARAMETERS presentParms;
DWORD orig_width, orig_height;
enum wined3d_format_id orig_fmt;