Henri Verbeet : wined3d: Use surface_color_fill() in IWineD3DDeviceImpl_ColorFill().

Alexandre Julliard julliard at winehq.org
Mon Aug 30 13:00:39 CDT 2010


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun Aug 29 21:57:43 2010 +0200

wined3d: Use surface_color_fill() in IWineD3DDeviceImpl_ColorFill().

---

 dlls/wined3d/device.c          |   18 +-----------------
 dlls/wined3d/surface.c         |    2 +-
 dlls/wined3d/wined3d_private.h |    1 +
 3 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 6deb552..cac6830 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5500,7 +5500,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface,
         IWineD3DSurface *surface, const WINED3DRECT *pRect, const WINED3DCOLORVALUE *color)
 {
     IWineD3DSurfaceImpl *s = (IWineD3DSurfaceImpl *)surface;
-    WINEDDBLTFX BltFx;
 
     TRACE("iface %p, surface %p, rect %s, color {%.8e, %.8e, %.8e, %.8e}.\n",
             iface, surface, wine_dbgstr_rect((const RECT *)pRect),
@@ -5512,22 +5511,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface,
         return WINED3DERR_INVALIDCALL;
     }
 
-    if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
-    {
-        const RECT draw_rect = {0, 0, s->currentDesc.Width, s->currentDesc.Height};
-
-        return device_clear_render_targets((IWineD3DDeviceImpl *)iface, 1, &s,
-                !!pRect, (const RECT *)pRect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
-    }
-    else
-    {
-        /* Just forward this to the DirectDraw blitting engine */
-        memset(&BltFx, 0, sizeof(BltFx));
-        BltFx.dwSize = sizeof(BltFx);
-        BltFx.u5.dwFillColor = wined3d_format_convert_from_float(s->resource.format_desc, color);
-        return IWineD3DSurface_Blt(surface, (const RECT *)pRect, NULL, NULL,
-                WINEDDBLT_COLORFILL, &BltFx, WINED3DTEXF_POINT);
-    }
+    return surface_color_fill(s, (const RECT *)pRect, color);
 }
 
 static void WINAPI IWineD3DDeviceImpl_ClearRendertargetView(IWineD3DDevice *iface,
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 6dcd590..9e4fc7c 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3354,7 +3354,7 @@ static void surface_blt_fbo(IWineD3DDeviceImpl *device, const WINED3DTEXTUREFILT
     context_release(context);
 }
 
-static HRESULT surface_color_fill(IWineD3DSurfaceImpl *s, const RECT *rect, const WINED3DCOLORVALUE *color)
+HRESULT surface_color_fill(IWineD3DSurfaceImpl *s, const RECT *rect, const WINED3DCOLORVALUE *color)
 {
     IWineD3DDeviceImpl *device = s->resource.device;
     const struct blit_shader *blitter;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index cb743ae..e0a4dd4 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2092,6 +2092,7 @@ extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl DECLSPEC_HIDDEN;
 extern const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl DECLSPEC_HIDDEN;
 
 void surface_add_dirty_rect(IWineD3DSurfaceImpl *surface, const RECT *dirty_rect) DECLSPEC_HIDDEN;
+HRESULT surface_color_fill(IWineD3DSurfaceImpl *s, const RECT *rect, const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN;
 void surface_gdi_cleanup(IWineD3DSurfaceImpl *This) DECLSPEC_HIDDEN;
 GLenum surface_get_gl_buffer(IWineD3DSurfaceImpl *surface) DECLSPEC_HIDDEN;
 HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment,




More information about the wine-cvs mailing list