Commit 4b0f47cd authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d2d1: Implement d2d_bitmap_GetDpi().

parent b270384d
......@@ -107,10 +107,12 @@ static D2D1_PIXEL_FORMAT * STDMETHODCALLTYPE d2d_bitmap_GetPixelFormat(ID2D1Bitm
static void STDMETHODCALLTYPE d2d_bitmap_GetDpi(ID2D1Bitmap *iface, float *dpi_x, float *dpi_y)
{
FIXME("iface %p, dpi_x %p, dpi_y %p stub!\n", iface, dpi_x, dpi_y);
struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface);
TRACE("iface %p, dpi_x %p, dpi_y %p.\n", iface, dpi_x, dpi_y);
*dpi_x = 96.0f;
*dpi_y = 96.0f;
*dpi_x = bitmap->dpi_x;
*dpi_y = bitmap->dpi_y;
}
static HRESULT STDMETHODCALLTYPE d2d_bitmap_CopyFromBitmap(ID2D1Bitmap *iface,
......@@ -161,4 +163,12 @@ void d2d_bitmap_init(struct d2d_bitmap *bitmap, D2D1_SIZE_U size, const void *sr
bitmap->refcount = 1;
bitmap->pixel_size = size;
bitmap->dpi_x = desc->dpiX;
bitmap->dpi_y = desc->dpiY;
if (bitmap->dpi_x == 0.0f && bitmap->dpi_y == 0.0f)
{
bitmap->dpi_x = 96.0f;
bitmap->dpi_y = 96.0f;
}
}
......@@ -154,6 +154,8 @@ struct d2d_bitmap
LONG refcount;
D2D1_SIZE_U pixel_size;
float dpi_x;
float dpi_y;
};
void d2d_bitmap_init(struct d2d_bitmap *bitmap, D2D1_SIZE_U size, const void *src_data,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment