[3/5] windowscodecs: Implement IWICBitmap::GetSize.
Vincent Povirk
madewokherd at gmail.com
Thu Aug 16 10:49:14 CDT 2012
-------------- next part --------------
From e0efcec27c888ec9ff794ceba5f12287974c65be Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Tue, 14 Aug 2012 15:49:02 -0500
Subject: [PATCH 3/7] windowscodecs: Implement IWICBitmap::GetSize.
---
dlls/windowscodecs/bitmap.c | 11 +++++++++--
dlls/windowscodecs/tests/bitmap.c | 2 +-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/windowscodecs/bitmap.c b/dlls/windowscodecs/bitmap.c
index 0a7ecf5..22a4876 100644
--- a/dlls/windowscodecs/bitmap.c
+++ b/dlls/windowscodecs/bitmap.c
@@ -266,9 +266,16 @@ static ULONG WINAPI BitmapImpl_Release(IWICBitmap *iface)
static HRESULT WINAPI BitmapImpl_GetSize(IWICBitmap *iface,
UINT *puiWidth, UINT *puiHeight)
{
- FIXME("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
+ BitmapImpl *This = impl_from_IWICBitmap(iface);
+ TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
- return E_NOTIMPL;
+ if (!puiWidth || !puiHeight)
+ return E_INVALIDARG;
+
+ *puiWidth = This->width;
+ *puiHeight = This->height;
+
+ return S_OK;
}
static HRESULT WINAPI BitmapImpl_GetPixelFormat(IWICBitmap *iface,
diff --git a/dlls/windowscodecs/tests/bitmap.c b/dlls/windowscodecs/tests/bitmap.c
index fc45375..a0926ab 100644
--- a/dlls/windowscodecs/tests/bitmap.c
+++ b/dlls/windowscodecs/tests/bitmap.c
@@ -256,12 +256,12 @@ todo_wine {
ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr);
ok(dpix == 12.0, "got %f, expected 12.0\n", dpix);
ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy);
+}
hr = IWICBitmap_GetSize(bitmap, &width, &height);
ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr);
ok(width == 3, "got %d, expected 3\n", width);
ok(height == 3, "got %d, expected 3\n", height);
-}
IWICBitmap_Release(bitmap);
}
--
1.7.9.5
More information about the wine-patches
mailing list