Henri Verbeet : d2d1: Implement d2d_bitmap_brush_SetExtendModeY().

Alexandre Julliard julliard at wine.codeweavers.com
Tue Apr 28 09:10:38 CDT 2015


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Apr 27 16:39:34 2015 +0200

d2d1: Implement d2d_bitmap_brush_SetExtendModeY().

---

 dlls/d2d1/brush.c        | 15 +++++++++++++--
 dlls/d2d1/d2d1_private.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c
index 575675e..309d234 100644
--- a/dlls/d2d1/brush.c
+++ b/dlls/d2d1/brush.c
@@ -569,7 +569,16 @@ static void STDMETHODCALLTYPE d2d_bitmap_brush_SetExtendModeX(ID2D1BitmapBrush *
 
 static void STDMETHODCALLTYPE d2d_bitmap_brush_SetExtendModeY(ID2D1BitmapBrush *iface, D2D1_EXTEND_MODE mode)
 {
-    FIXME("iface %p, mode %#x stub!\n", iface, mode);
+    struct d2d_brush *brush = impl_from_ID2D1BitmapBrush(iface);
+
+    TRACE("iface %p, mode %#x.\n", iface, mode);
+
+    brush->u.bitmap.extend_mode_y = mode;
+    if (brush->u.bitmap.sampler_state)
+    {
+        ID3D10SamplerState_Release(brush->u.bitmap.sampler_state);
+        brush->u.bitmap.sampler_state = NULL;
+    }
 }
 
 static void STDMETHODCALLTYPE d2d_bitmap_brush_SetInterpolationMode(ID2D1BitmapBrush *iface,
@@ -659,11 +668,13 @@ HRESULT d2d_bitmap_brush_init(struct d2d_brush *brush, struct d2d_d3d_render_tar
     if (bitmap_brush_desc)
     {
         brush->u.bitmap.extend_mode_x = bitmap_brush_desc->extendModeX;
+        brush->u.bitmap.extend_mode_y = bitmap_brush_desc->extendModeY;
         brush->u.bitmap.interpolation_mode = bitmap_brush_desc->interpolationMode;
     }
     else
     {
         brush->u.bitmap.extend_mode_x = D2D1_EXTEND_MODE_CLAMP;
+        brush->u.bitmap.extend_mode_y = D2D1_EXTEND_MODE_CLAMP;
         brush->u.bitmap.interpolation_mode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR;
     }
 
@@ -712,7 +723,7 @@ void d2d_brush_bind_resources(struct d2d_brush *brush, ID3D10Device *device)
             else
                 sampler_desc.Filter = D3D10_FILTER_MIN_MAG_MIP_LINEAR;
             sampler_desc.AddressU = texture_addres_mode_from_extend_mode(brush->u.bitmap.extend_mode_x);
-            sampler_desc.AddressV = D3D10_TEXTURE_ADDRESS_CLAMP;
+            sampler_desc.AddressV = texture_addres_mode_from_extend_mode(brush->u.bitmap.extend_mode_y);
             sampler_desc.AddressW = D3D10_TEXTURE_ADDRESS_CLAMP;
             sampler_desc.MipLODBias = 0.0f;
             sampler_desc.MaxAnisotropy = 0;
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index b5820d0..447a136 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -126,6 +126,7 @@ struct d2d_brush
         {
             struct d2d_bitmap *bitmap;
             D2D1_EXTEND_MODE extend_mode_x;
+            D2D1_EXTEND_MODE extend_mode_y;
             D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode;
             ID3D10SamplerState *sampler_state;
         } bitmap;




More information about the wine-cvs mailing list