wined3d: Get rid of surface_internal_preload().

This commit is contained in:
Henri Verbeet 2013-11-22 10:45:03 +01:00 committed by Alexandre Julliard
parent e0beab8b81
commit 7427b72250
4 changed files with 12 additions and 26 deletions

View File

@ -7469,7 +7469,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
src_rect.bottom = src_surface->resource.height - src_rect.bottom;
}
else
surface_internal_preload(src_surface, context, SRGB_RGB);
wined3d_texture_load(src_surface->container, context, SRGB_RGB);
context_apply_blit_state(context, device);

View File

@ -2124,7 +2124,7 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wine
if (context->render_offscreen)
{
surface_internal_preload(rt, context, SRGB_RGB);
wined3d_texture_load(rt->container, context, SRGB_RGB);
context_apply_fbo_state_blit(context, GL_FRAMEBUFFER, rt, NULL, rt->draw_binding);
if (rt->resource.format->id != WINED3DFMT_NULL)
@ -2938,10 +2938,12 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& old_render_offscreen && context->current_rt != target)
{
struct wined3d_texture *texture = context->current_rt->container;
/* Read the back buffer of the old drawable into the destination texture. */
if (context->current_rt->container->texture_srgb.name)
surface_internal_preload(context->current_rt, context, SRGB_SRGB);
surface_internal_preload(context->current_rt, context, SRGB_RGB);
if (texture->texture_srgb.name)
wined3d_texture_load(texture, context, SRGB_SRGB);
wined3d_texture_load(texture, context, SRGB_RGB);
surface_invalidate_location(context->current_rt, SFLAG_INDRAWABLE);
}
}

View File

@ -2419,7 +2419,6 @@ DWORD CDECL wined3d_surface_get_priority(const struct wined3d_surface *surface)
void CDECL wined3d_surface_preload(struct wined3d_surface *surface)
{
struct wined3d_context *context;
TRACE("surface %p.\n", surface);
if (!surface->resource.device->d3d_initialized)
@ -2428,9 +2427,7 @@ void CDECL wined3d_surface_preload(struct wined3d_surface *surface)
return;
}
context = context_acquire(surface->resource.device, NULL);
surface_internal_preload(surface, context, SRGB_ANY);
context_release(context);
wined3d_texture_preload(surface->container);
}
void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface)
@ -3447,17 +3444,6 @@ HRESULT CDECL wined3d_surface_flip(struct wined3d_surface *surface, struct wined
return WINED3D_OK;
}
/* Context activation is done by the caller */
void surface_internal_preload(struct wined3d_surface *surface,
struct wined3d_context *context, enum WINED3DSRGB srgb)
{
struct wined3d_texture *texture = surface->container;
TRACE("iface %p, srgb %#x.\n", surface, srgb);
wined3d_texture_load(texture, context, srgb);
}
/* Read the framebuffer back into the surface */
static void read_from_framebuffer(struct wined3d_surface *surface, void *dest, UINT pitch)
{
@ -4099,7 +4085,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
context = context_acquire(device, src_surface);
gl_info = context->gl_info;
context_apply_blit_state(context, device);
surface_internal_preload(dst_surface, context, SRGB_RGB);
wined3d_texture_load(dst_surface->container, context, SRGB_RGB);
/* Bind the target texture */
context_bind_texture(context, dst_surface->container->target, dst_surface->container->texture_rgb.name);
@ -4207,14 +4193,14 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
context = context_acquire(device, src_surface);
gl_info = context->gl_info;
context_apply_blit_state(context, device);
surface_internal_preload(dst_surface, context, SRGB_RGB);
wined3d_texture_load(dst_surface->container, context, SRGB_RGB);
src_offscreen = surface_is_offscreen(src_surface);
noBackBufferBackup = src_offscreen && wined3d_settings.offscreen_rendering_mode == ORM_FBO;
if (!noBackBufferBackup && !src_surface->container->texture_rgb.name)
{
/* Get it a description */
surface_internal_preload(src_surface, context, SRGB_RGB);
wined3d_texture_load(src_surface->container, context, SRGB_RGB);
}
/* Try to use an aux buffer for drawing the rectangle. This way it doesn't need restoring.
@ -4503,7 +4489,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
/* Make sure the surface is up-to-date. This should probably use
* surface_load_location() and worry about the destination surface too,
* unless we're overwriting it completely. */
surface_internal_preload(src_surface, context, SRGB_RGB);
wined3d_texture_load(src_surface->container, context, SRGB_RGB);
/* Activate the destination context, set it up for blitting */
context_apply_blit_state(context, device);

View File

@ -2249,8 +2249,6 @@ void surface_set_dirty(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
HRESULT surface_color_fill(struct wined3d_surface *s,
const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN;
GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void surface_internal_preload(struct wined3d_surface *surface,
struct wined3d_context *context, enum WINED3DSRGB srgb) DECLSPEC_HIDDEN;
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN;
BOOL surface_is_offscreen(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void surface_load(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN;