Roderick Colenbrander : wined3d: Remove paletteOverride from BltOverride offscreen->render_target blit.

Alexandre Julliard julliard at winehq.org
Thu Apr 15 11:37:39 CDT 2010


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

Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date:   Thu Apr 15 12:42:00 2010 +0200

wined3d: Remove paletteOverride from BltOverride offscreen->render_target blit.

This code was needed when the destination uses 8-bit and the source lacked a palette.
Since we don't allow destination fixups, this code doesn't do anything. At a later
stage something like this should perhaps be readded to specific backends.

---

 dlls/wined3d/surface.c |   33 +--------------------------------
 1 files changed, 1 insertions(+), 32 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index bb77ef5..fc24bb4 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3575,21 +3575,9 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
         DWORD oldCKeyFlags = Src->CKeyFlags;
         WINEDDCOLORKEY oldBltCKey = Src->SrcBltCKey;
         struct wined3d_context *context;
-        BOOL paletteOverride = FALSE;
 
         TRACE("Blt from surface %p to rendertarget %p\n", Src, This);
 
-        /* When blitting from an offscreen surface to a rendertarget, the source
-         * surface is not required to have a palette. Our rendering / conversion
-         * code further down the road retrieves the palette from the surface, so
-         * it must have a palette set. */
-        if (Src->resource.format_desc->format == WINED3DFMT_P8_UINT && !Src->palette)
-        {
-            paletteOverride = TRUE;
-            TRACE("Source surface (%p) lacks palette, overriding palette with palette %p of destination surface (%p)\n", Src, This->palette, This);
-            Src->palette = This->palette;
-        }
-
         if (!(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE))
             && fbo_blit_supported(&myDevice->adapter->gl_info, BLIT_OP_BLIT,
                                   &src_rect, Src->resource.usage, Src->resource.pool, Src->resource.format_desc,
@@ -3601,10 +3589,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
              */
             stretch_rect_fbo((IWineD3DDevice *)myDevice, SrcSurface, &src_rect,
                               (IWineD3DSurface *)This, &dst_rect, Filter);
-
-            /* Clear the palette as the surface didn't have a palette attached, it would confuse GetPalette and other calls */
-            if(paletteOverride)
-                Src->palette = NULL;
             return WINED3D_OK;
         }
 
@@ -3613,13 +3597,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
                                          &src_rect, Src->resource.usage, Src->resource.pool, Src->resource.format_desc,
                                          &dst_rect, This->resource.usage, This->resource.pool, This->resource.format_desc))
         {
-            HRESULT hr = arbfp_blit_surface(myDevice, Src, &src_rect, This, &dst_rect, BLIT_OP_BLIT, Filter);
-
-            /* Clear the palette as the surface didn't have a palette attached, it would confuse GetPalette and other calls */
-            if(paletteOverride)
-                Src->palette = NULL;
-
-            return hr;
+            return arbfp_blit_surface(myDevice, Src, &src_rect, This, &dst_rect, BLIT_OP_BLIT, Filter);
         }
 
         /* Color keying: Check if we have to do a color keyed blt,
@@ -3669,11 +3647,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
                                                &dst_rect, This->resource.usage, This->resource.pool, This->resource.format_desc))
         {
             FIXME("Unsupported blit operation falling back to software\n");
-
-            /* Clear the palette as the surface didn't have a palette attached, it would confuse GetPalette and other calls */
-            if(paletteOverride)
-                Src->palette = NULL;
-
             return WINED3DERR_INVALIDCALL;
         }
 
@@ -3712,10 +3685,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
         Src->CKeyFlags = oldCKeyFlags;
         Src->SrcBltCKey = oldBltCKey;
 
-        /* Clear the palette as the surface didn't have a palette attached, it would confuse GetPalette and other calls */
-        if(paletteOverride)
-            Src->palette = NULL;
-
         LEAVE_GL();
 
         /* Leave the opengl state valid for blitting */




More information about the wine-cvs mailing list