Henri Verbeet : wined3d: Pass a format instead of a surface to wined3d_format_convert_from_float() .

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 22 08:57:37 CST 2016


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Feb 19 17:28:43 2016 +0100

wined3d: Pass a format instead of a surface to wined3d_format_convert_from_float().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 88acca5..86cedb0 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4685,7 +4685,7 @@ static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d
     static const RECT src_rect;
     struct wined3d_blt_fx fx;
 
-    fx.fill_color = wined3d_format_convert_from_float(surface, color);
+    fx.fill_color = wined3d_format_convert_from_float(view->format, color);
     return surface_cpu_blt(surface, rect, NULL, &src_rect,
             WINED3D_BLT_COLOR_FILL, &fx, WINED3D_TEXF_POINT);
 }
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index b52b967..734b265 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4393,7 +4393,7 @@ void get_fog_start_end(const struct wined3d_context *context, const struct wined
 /* Note: It's the caller's responsibility to ensure values can be expressed
  * in the requested format. UNORM formats for example can only express values
  * in the range 0.0f -> 1.0f. */
-DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, const struct wined3d_color *color)
+DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, const struct wined3d_color *color)
 {
     static const struct
     {
@@ -4426,7 +4426,6 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, c
         {WINED3DFMT_R10G10B10A2_UNORM, 1023.0f, 1023.0f, 1023.0f,    3.0f,  0, 10, 20, 30},
         {WINED3DFMT_P8_UINT,              0.0f,    0.0f,    0.0f,  255.0f,  0,  0,  0,  0},
     };
-    const struct wined3d_format *format = surface->resource.format;
     unsigned int i;
 
     TRACE("Converting color {%.8e %.8e %.8e %.8e} to format %s.\n",
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 35ece12..4e3d779 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3354,7 +3354,7 @@ void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigne
         unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch) DECLSPEC_HIDDEN;
 UINT wined3d_format_calculate_size(const struct wined3d_format *format,
         UINT alignment, UINT width, UINT height, UINT depth) DECLSPEC_HIDDEN;
-DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface,
+DWORD wined3d_format_convert_from_float(const struct wined3d_format *format,
         const struct wined3d_color *color) DECLSPEC_HIDDEN;
 BOOL wined3d_format_convert_color_to_float(const struct wined3d_format *format,
         const struct wined3d_palette *palette, DWORD color, struct wined3d_color *float_color) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list