[PATCH 3/4] dwrite: Implement another CreateFontFace() variant
Nikolay Sivov
nsivov at codeweavers.com
Tue Jul 5 04:55:55 CDT 2016
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/dwrite/font.c | 24 ++++++++++++------------
dlls/dwrite/tests/font.c | 9 +++++----
2 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index d635c15..d477ac0 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -1496,18 +1496,11 @@ static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont3 *iface, UINT32 value,
return S_OK;
}
-static HRESULT WINAPI dwritefont_CreateFontFace(IDWriteFont3 *iface, IDWriteFontFace **face)
+static HRESULT WINAPI dwritefont_CreateFontFace(IDWriteFont3 *iface, IDWriteFontFace **fontface)
{
struct dwrite_font *This = impl_from_IDWriteFont3(iface);
- HRESULT hr;
-
- TRACE("(%p)->(%p)\n", This, face);
-
- hr = get_fontface_from_font(This, (IDWriteFontFace3**)face);
- if (hr == S_OK)
- IDWriteFontFace_AddRef(*face);
-
- return hr;
+ TRACE("(%p)->(%p)\n", This, fontface);
+ return IDWriteFont3_CreateFontFace(iface, (IDWriteFontFace3**)fontface);
}
static void WINAPI dwritefont1_GetMetrics(IDWriteFont3 *iface, DWRITE_FONT_METRICS1 *metrics)
@@ -1572,8 +1565,15 @@ static BOOL WINAPI dwritefont2_IsColorFont(IDWriteFont3 *iface)
static HRESULT WINAPI dwritefont3_CreateFontFace(IDWriteFont3 *iface, IDWriteFontFace3 **fontface)
{
struct dwrite_font *This = impl_from_IDWriteFont3(iface);
- FIXME("(%p)->(%p): stub\n", This, fontface);
- return E_NOTIMPL;
+ HRESULT hr;
+
+ TRACE("(%p)->(%p)\n", This, fontface);
+
+ hr = get_fontface_from_font(This, fontface);
+ if (hr == S_OK)
+ IDWriteFontFace3_AddRef(*fontface);
+
+ return hr;
}
static BOOL WINAPI dwritefont3_Equals(IDWriteFont3 *iface, IDWriteFont *font)
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index 4fe494a..a1ef3d4 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -6177,17 +6177,19 @@ todo_wine
/* references returned from IDWriteFontFace3 */
hr = IDWriteFont3_CreateFontFace(font3, &fontface);
-todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
-if (hr == S_OK) {
hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref);
+todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref1);
+todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
+if (hr == S_OK)
ok(ref == ref1, "got %p, %p\n", ref1, ref);
+if (hr == S_OK) {
hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface1);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(fontface1 == fontface, "got %p, %p\n", fontface1, fontface);
@@ -6195,9 +6197,8 @@ if (hr == S_OK) {
IDWriteFontFaceReference_Release(ref);
IDWriteFontFaceReference_Release(ref1);
-
- IDWriteFontFace3_Release(fontface);
}
+ IDWriteFontFace3_Release(fontface);
IDWriteFont3_Release(font3);
IDWriteFactory3_Release(factory3);
--
2.8.1
More information about the wine-patches
mailing list