Module: wine Branch: master Commit: b60961ae5573990432b0ba04826db6d7d950074d URL: http://source.winehq.org/git/wine.git/?a=commit;h=b60961ae5573990432b0ba0482...
Author: Roderick Colenbrander thunderbird2k@gmail.com Date: Mon May 10 15:36:31 2010 +0200
wined3d: Use surface_prepare_texture for surface allocation in read_from_framebuffer_texture.
---
dlls/wined3d/surface.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index bb18b95..db4a58b 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1495,7 +1495,6 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb) const struct wined3d_gl_info *gl_info; struct wined3d_context *context; GLint prevRead; - BOOL alloc_flag = srgb ? SFLAG_SRGBALLOCATED : SFLAG_ALLOCATED;
/* Activate the surface to read from. In some situations it isn't the currently active target(e.g. backbuffer * locking during offscreen rendering). RESOURCELOAD is ok because glCopyTexSubImage2D isn't affected by any @@ -1504,6 +1503,7 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb) context = context_acquire(device, This); gl_info = context->gl_info;
+ surface_prepare_texture(This, gl_info, srgb); surface_bind_and_dirtify(This, srgb);
ENTER_GL(); @@ -1536,12 +1536,6 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb) LEAVE_GL(); }
- if (!(This->Flags & alloc_flag)) - { - surface_allocate_surface(This, gl_info, This->resource.format_desc, srgb); - This->Flags |= alloc_flag; - } - ENTER_GL(); /* If !SrcIsUpsideDown we should flip the surface. * This can be done using glCopyTexSubImage2D but this