Henri Verbeet : wined3d: Explicitly pass blit_priv and gl_info to set_shader().

Alexandre Julliard julliard at winehq.org
Fri Dec 10 11:56:58 CST 2010


Module: wine
Branch: master
Commit: ae7a20af2fc5e4c9e762b8f0e74fd6a487472cee
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ae7a20af2fc5e4c9e762b8f0e74fd6a487472cee

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Dec  9 23:41:18 2010 +0100

wined3d: Explicitly pass blit_priv and gl_info to set_shader().

---

 dlls/wined3d/arb_program_shader.c |    8 +++-----
 dlls/wined3d/surface.c            |    8 +++-----
 dlls/wined3d/swapchain.c          |    2 +-
 dlls/wined3d/wined3d_private.h    |    2 +-
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 2b4004a..cf684e8 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7027,13 +7027,11 @@ 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(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface)
+static HRESULT arbfp_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface)
 {
     GLenum shader;
-    IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
-    const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
     float size[4] = {(float) surface->pow2Width, (float) surface->pow2Height, 1.0f, 1.0f};
-    struct arbfp_blit_priv *priv = device->blit_priv;
+    struct arbfp_blit_priv *priv = blit_priv;
     enum complex_fixup fixup;
     GLenum textype = surface->texture_target;
 
@@ -7190,7 +7188,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
     if (!surface_is_offscreen(dst_surface))
         surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect);
 
-    arbfp_blit_set((IWineD3DDevice *)device, src_surface);
+    arbfp_blit_set(device->blit_priv, context->gl_info, src_surface);
 
     ENTER_GL();
 
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 994f3bc..02b07b9 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3358,7 +3358,7 @@ static void surface_blt_to_drawable(IWineD3DDeviceImpl *device,
     if (!surface_is_offscreen(dst_surface))
         surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect);
 
-    device->blitter->set_shader((IWineD3DDevice *)device, src_surface);
+    device->blitter->set_shader(device->blit_priv, context->gl_info, src_surface);
 
     ENTER_GL();
 
@@ -4752,10 +4752,8 @@ static void ffp_blit_p8_upload_palette(IWineD3DSurfaceImpl *surface, const struc
 }
 
 /* Context activation is done by the caller. */
-static HRESULT ffp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface)
+static HRESULT ffp_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface)
 {
-    IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
-    const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
     enum complex_fixup fixup = get_complex_fixup(surface->resource.format->color_fixup);
 
     /* When EXT_PALETTED_TEXTURE is around, palette conversion is done by the GPU
@@ -4876,7 +4874,7 @@ static void cpu_blit_free(IWineD3DDeviceImpl *device)
 }
 
 /* Context activation is done by the caller. */
-static HRESULT cpu_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface)
+static HRESULT cpu_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface)
 {
     return WINED3D_OK;
 }
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index d0934ba..7e1f031 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -171,7 +171,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
         /* Set up the texture. The surface is not in a IWineD3D*Texture container,
          * so there are no d3d texture settings to dirtify
          */
-        device->blitter->set_shader((IWineD3DDevice *) device, backbuffer);
+        device->blitter->set_shader(device->blit_priv, context2->gl_info, backbuffer);
         glTexParameteri(backbuffer->texture_target, GL_TEXTURE_MIN_FILTER, gl_filter);
         glTexParameteri(backbuffer->texture_target, GL_TEXTURE_MAG_FILTER, gl_filter);
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index bb7b1f5..bbed40c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1177,7 +1177,7 @@ struct blit_shader
 {
     HRESULT (*alloc_private)(IWineD3DDeviceImpl *device);
     void (*free_private)(IWineD3DDeviceImpl *device);
-    HRESULT (*set_shader)(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface);
+    HRESULT (*set_shader)(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface);
     void (*unset_shader)(IWineD3DDevice *iface);
     BOOL (*blit_supported)(const struct wined3d_gl_info *gl_info, enum blit_operation blit_op,
             const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format *src_format,




More information about the wine-cvs mailing list