Commit 147f24dd authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Remove ModifyLocation() from the public wined3d surface interface.

parent ab418fc2
......@@ -7166,7 +7166,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
context_release(context);
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)dst_surface, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(dst_surface, SFLAG_INDRAWABLE, TRUE);
return WINED3D_OK;
}
......
......@@ -2224,7 +2224,7 @@ static void context_setup_target(IWineD3DDeviceImpl *device,
surface_internal_preload(context->current_rt, SRGB_RGB);
}
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)context->current_rt, SFLAG_INDRAWABLE, FALSE);
surface_modify_location(context->current_rt, SFLAG_INDRAWABLE, FALSE);
device->isInDraw = oldInDraw;
}
......
......@@ -84,7 +84,7 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3
IWineD3DSurface_LoadLocation((IWineD3DSurface *)surface, SFLAG_INSYSMEM, NULL);
/* Make sure the texture is reloaded because of the palette change,
* this kills performance though :( */
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)surface, SFLAG_INTEXTURE, FALSE);
surface_modify_location(surface, SFLAG_INTEXTURE, FALSE);
}
}
}
......
......@@ -4485,7 +4485,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
if (location == SFLAG_DS_ONSCREEN && depth_stencil != This->onscreen_depth_stencil)
device_switch_onscreen_ds(This, context, depth_stencil);
prepare_ds_clear(depth_stencil, context, location, &draw_rect, Count, clear_rect);
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)depth_stencil, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(depth_stencil, SFLAG_INDRAWABLE, TRUE);
glDepthMask(GL_TRUE);
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_ZWRITEENABLE));
......@@ -4496,7 +4496,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
if (Flags & WINED3DCLEAR_TARGET)
{
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)target, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(target, SFLAG_INDRAWABLE, TRUE);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_COLORWRITEENABLE));
......@@ -5353,7 +5353,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
LEAVE_GL();
context_release(context);
IWineD3DSurface_ModifyLocation(dst_surface, SFLAG_INTEXTURE, TRUE);
surface_modify_location(dst_impl, SFLAG_INTEXTURE, TRUE);
sampler = This->rev_tex_unit_map[0];
if (sampler != WINED3D_UNMAPPED_STAGE)
{
......@@ -5490,7 +5490,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface,
struct wined3d_context *context;
if (rect) IWineD3DSurface_LoadLocation((IWineD3DSurface *)surface, SFLAG_INDRAWABLE, NULL);
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)surface, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(surface, SFLAG_INDRAWABLE, TRUE);
context = context_acquire(This, surface);
context_apply_clear_state(context, This, surface, NULL);
......@@ -5848,7 +5848,7 @@ void stretch_rect_fbo(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_surfa
context_release(context);
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)dst_surface, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(dst_surface, SFLAG_INDRAWABLE, TRUE);
}
static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, DWORD RenderTargetIndex, IWineD3DSurface *pRenderTarget,
......
......@@ -583,11 +583,11 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
/* Invalidate the back buffer memory so LockRect will read it the next time */
for (i = 0; i < This->adapter->gl_info.limits.buffers; ++i)
{
IWineD3DSurface *target = (IWineD3DSurface *)This->render_targets[i];
IWineD3DSurfaceImpl *target = This->render_targets[i];
if (target)
{
IWineD3DSurface_LoadLocation(target, SFLAG_INDRAWABLE, NULL);
IWineD3DSurface_ModifyLocation(target, SFLAG_INDRAWABLE, TRUE);
IWineD3DSurface_LoadLocation((IWineD3DSurface *)target, SFLAG_INDRAWABLE, NULL);
surface_modify_location(target, SFLAG_INDRAWABLE, TRUE);
}
}
}
......@@ -639,7 +639,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
surface_modify_ds_location(This->depth_stencil, location,
This->depth_stencil->ds_current_size.cx,
This->depth_stencil->ds_current_size.cy);
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)This->depth_stencil, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(This->depth_stencil, SFLAG_INDRAWABLE, TRUE);
}
}
}
......
......@@ -477,16 +477,6 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
/***************************
*
***************************/
static void WINAPI IWineGDISurfaceImpl_ModifyLocation(IWineD3DSurface *iface, DWORD flag, BOOL persistent) {
TRACE("(%p)->(%s, %s)\n", iface,
flag == SFLAG_INSYSMEM ? "SFLAG_INSYSMEM" : flag == SFLAG_INDRAWABLE ? "SFLAG_INDRAWABLE" : "SFLAG_INTEXTURE",
persistent ? "TRUE" : "FALSE");
/* GDI surfaces can be in system memory only */
if(flag != SFLAG_INSYSMEM) {
ERR("GDI Surface requested in gl %s memory\n", flag == SFLAG_INDRAWABLE ? "drawable" : "texture");
}
}
static HRESULT WINAPI IWineGDISurfaceImpl_LoadLocation(IWineD3DSurface *iface, DWORD flag, const RECT *rect) {
if(flag != SFLAG_INSYSMEM) {
ERR("GDI Surface requested to be copied to gl %s\n", flag == SFLAG_INTEXTURE ? "texture" : "drawable");
......@@ -557,7 +547,6 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineD3DBaseSurfaceImpl_GetData,
IWineD3DBaseSurfaceImpl_SetFormat,
IWineGDISurfaceImpl_PrivateSetup,
IWineGDISurfaceImpl_ModifyLocation,
IWineGDISurfaceImpl_LoadLocation,
IWineGDISurfaceImpl_GetImplType,
IWineGDISurfaceImpl_DrawOverlay
......
......@@ -326,7 +326,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
if (!This->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{
IWineD3DSurface_LoadLocation((IWineD3DSurface *)This->back_buffers[0], SFLAG_INTEXTURE, NULL);
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)This->back_buffers[0], SFLAG_INDRAWABLE, FALSE);
surface_modify_location(This->back_buffers[0], SFLAG_INDRAWABLE, FALSE);
This->render_to_fbo = TRUE;
/* Force the context manager to update the render target configuration next draw. */
......@@ -408,16 +408,18 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
* This serves to update the emulated overlay, if any
*/
fbflags = front->Flags;
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)front, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(front, SFLAG_INDRAWABLE, TRUE);
front->Flags = fbflags;
} else {
IWineD3DSurface_ModifyLocation((IWineD3DSurface *) front, SFLAG_INDRAWABLE, TRUE);
IWineD3DSurface_ModifyLocation((IWineD3DSurface *) back, SFLAG_INDRAWABLE, TRUE);
}
else
{
surface_modify_location(front, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(back, SFLAG_INDRAWABLE, TRUE);
}
}
else
{
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)This->front_buffer, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(This->front_buffer, SFLAG_INDRAWABLE, TRUE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
* If the swapeffect is COPY, the content remains the same. If it is FLIP however,
......@@ -425,7 +427,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
*/
if (This->presentParms.SwapEffect == WINED3DSWAPEFFECT_FLIP)
{
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)This->back_buffers[0], SFLAG_INDRAWABLE, TRUE);
surface_modify_location(This->back_buffers[0], SFLAG_INDRAWABLE, TRUE);
}
}
......@@ -730,7 +732,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
swapchain->front_buffer->Flags |= SFLAG_SWAPCHAIN;
if (surface_type == SURFACE_OPENGL)
{
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)swapchain->front_buffer, SFLAG_INDRAWABLE, TRUE);
surface_modify_location(swapchain->front_buffer, SFLAG_INDRAWABLE, TRUE);
}
/* MSDN says we're only allowed a single fullscreen swapchain per device,
......
......@@ -78,7 +78,7 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG
/* TODO: This is not necessarily needed with hw palettized texture support. */
IWineD3DSurface_LoadLocation((IWineD3DSurface *)surface, SFLAG_INSYSMEM, NULL);
/* Make sure the texture is reloaded because of the palette change, this kills performance though :( */
IWineD3DSurface_ModifyLocation((IWineD3DSurface *)surface, SFLAG_INTEXTURE, FALSE);
surface_modify_location(surface, SFLAG_INTEXTURE, FALSE);
}
}
}
......
......@@ -2077,6 +2077,7 @@ BOOL surface_is_offscreen(IWineD3DSurfaceImpl *iface) DECLSPEC_HIDDEN;
void surface_load_ds_location(IWineD3DSurfaceImpl *surface,
struct wined3d_context *context, DWORD location) 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,
const struct wined3d_gl_info *gl_info, BOOL srgb) DECLSPEC_HIDDEN;
void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface,
......
......@@ -2491,10 +2491,6 @@ interface IWineD3DSurface : IWineD3DResource
);
HRESULT PrivateSetup(
);
void ModifyLocation(
[in] DWORD location,
[in] BOOL persistent
);
HRESULT LoadLocation(
[in] DWORD location,
[in] const RECT *rect
......
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