[PATCH 2/5] d2d1: Implement d2d_bitmap_GetPixelFormat().

Henri Verbeet hverbeet at codeweavers.com
Wed Jul 29 04:36:19 CDT 2015


---
 dlls/d2d1/bitmap.c       | 8 +++++---
 dlls/d2d1/d2d1_private.h | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
index 2439d79..be03b66 100644
--- a/dlls/d2d1/bitmap.c
+++ b/dlls/d2d1/bitmap.c
@@ -103,10 +103,11 @@ static D2D1_SIZE_U * STDMETHODCALLTYPE d2d_bitmap_GetPixelSize(ID2D1Bitmap *ifac
 
 static D2D1_PIXEL_FORMAT * STDMETHODCALLTYPE d2d_bitmap_GetPixelFormat(ID2D1Bitmap *iface, D2D1_PIXEL_FORMAT *format)
 {
-    FIXME("iface %p stub!\n", iface);
+    struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface);
+
+    TRACE("iface %p, format %p.\n", iface, format);
 
-    format->format = DXGI_FORMAT_UNKNOWN;
-    format->alphaMode = D2D1_ALPHA_MODE_UNKNOWN;
+    *format = bitmap->format;
     return format;
 }
 
@@ -242,6 +243,7 @@ HRESULT d2d_bitmap_init(struct d2d_bitmap *bitmap, struct d2d_d3d_render_target
     }
 
     bitmap->pixel_size = size;
+    bitmap->format = desc->pixelFormat;
     bitmap->dpi_x = desc->dpiX;
     bitmap->dpi_y = desc->dpiY;
 
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index 0c564fa..96a0bb8 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -184,6 +184,7 @@ struct d2d_bitmap
 
     ID3D10ShaderResourceView *view;
     D2D1_SIZE_U pixel_size;
+    D2D1_PIXEL_FORMAT format;
     float dpi_x;
     float dpi_y;
 };
-- 
2.1.4




More information about the wine-patches mailing list