Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
December 2019
- 73 participants
- 634 discussions
[PATCH 1/2] wined3d: Support stretching compressed format surfaces in surface_cpu_blt().
by Paul Gofman 02 Dec '19
by Paul Gofman 02 Dec '19
02 Dec '19
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com>
---
dlls/wined3d/surface.c | 79 +++++++++++++++++++++++++++++++-----------
1 file changed, 58 insertions(+), 21 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 6c8d9eaf1c..48eeccdb0d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1653,6 +1653,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
unsigned int texture_level;
HRESULT hr = WINED3D_OK;
BOOL same_sub_resource;
+ BOOL upload = FALSE;
DWORD map_binding;
const BYTE *sbase;
const BYTE *sbuf;
@@ -1673,6 +1674,11 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
if (wined3d_format_is_typeless(dst_format) && dst_format->id == src_format->typeless_id)
dst_format = src_format;
+ src_height = src_box->bottom - src_box->top;
+ src_width = src_box->right - src_box->left;
+ dst_height = dst_box->bottom - dst_box->top;
+ dst_width = dst_box->right - dst_box->left;
+
dst_range.offset = 0;
dst_range.size = dst_texture->sub_resources[dst_sub_resource_idx].size;
if (src_texture == dst_texture && src_sub_resource_idx == dst_sub_resource_idx)
@@ -1694,6 +1700,15 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
else
{
same_sub_resource = FALSE;
+ upload = dst_format->flags[dst_texture->resource.gl_type] & WINED3DFMT_FLAG_BLOCKS
+ && (dst_width != src_width || dst_height != src_height);
+
+ if (upload)
+ {
+ dst_format = src_format->flags[dst_texture->resource.gl_type] & WINED3DFMT_FLAG_BLOCKS
+ ? wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, 0) : src_format;
+ }
+
if (!(flags & WINED3D_BLT_RAW) && dst_format->id != src_format->id)
{
if (!(converted_texture = surface_convert_format(src_texture, src_sub_resource_idx, dst_format)))
@@ -1717,25 +1732,31 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
src_map.data = wined3d_context_map_bo_address(context, &src_data,
src_texture->sub_resources[src_sub_resource_idx].size, 0, WINED3D_MAP_READ);
- map_binding = dst_texture->resource.map_binding;
- texture_level = dst_sub_resource_idx % dst_texture->level_count;
- if (!wined3d_texture_load_location(dst_texture, dst_sub_resource_idx, context, map_binding))
- ERR("Failed to load the destination sub-resource into %s.\n", wined3d_debug_location(map_binding));
- wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~map_binding);
- wined3d_texture_get_pitch(dst_texture, texture_level, &dst_map.row_pitch, &dst_map.slice_pitch);
- wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_data, map_binding);
- dst_map.data = wined3d_context_map_bo_address(context, &dst_data,
- dst_texture->sub_resources[dst_sub_resource_idx].size, 0, WINED3D_MAP_WRITE);
+ if (upload)
+ {
+ wined3d_format_calculate_pitch(dst_format, 1, dst_box->right, dst_box->bottom,
+ &dst_map.row_pitch, &dst_map.slice_pitch);
+ dst_map.data = heap_alloc(dst_map.slice_pitch);
+ }
+ else
+ {
+ map_binding = dst_texture->resource.map_binding;
+ texture_level = dst_sub_resource_idx % dst_texture->level_count;
+ if (!wined3d_texture_load_location(dst_texture, dst_sub_resource_idx, context, map_binding))
+ ERR("Failed to load the destination sub-resource into %s.\n", wined3d_debug_location(map_binding));
+
+ wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~map_binding);
+ wined3d_texture_get_pitch(dst_texture, texture_level, &dst_map.row_pitch, &dst_map.slice_pitch);
+ wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_data, map_binding);
+ dst_map.data = wined3d_context_map_bo_address(context, &dst_data,
+ dst_texture->sub_resources[dst_sub_resource_idx].size, 0, WINED3D_MAP_WRITE);
+ }
}
src_fmt_flags = src_format->flags[src_texture->resource.gl_type];
dst_fmt_flags = dst_format->flags[dst_texture->resource.gl_type];
flags &= ~WINED3D_BLT_RAW;
bpp = dst_format->byte_count;
- src_height = src_box->bottom - src_box->top;
- src_width = src_box->right - src_box->left;
- dst_height = dst_box->bottom - dst_box->top;
- dst_width = dst_box->right - dst_box->left;
row_byte_count = dst_width * bpp;
sbase = (BYTE *)src_map.data
@@ -1756,13 +1777,6 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
goto release;
}
- if (src_height != dst_height || src_width != dst_width)
- {
- WARN("Stretching not supported on compressed surfaces.\n");
- hr = WINED3DERR_INVALIDCALL;
- goto release;
- }
-
hr = surface_cpu_blt_compressed(sbase, dbuf,
src_map.row_pitch, dst_map.row_pitch, dst_width, dst_height,
src_format, flags, fx);
@@ -2103,7 +2117,30 @@ error:
FIXME(" Unsupported flags %#x.\n", flags);
release:
- wined3d_context_unmap_bo_address(context, &dst_data, 0, 1, &dst_range);
+ if (upload)
+ {
+ struct wined3d_bo_address data;
+
+ data.buffer_object = 0;
+ data.addr = dst_map.data;
+
+ texture_level = dst_sub_resource_idx % dst_texture->level_count;
+
+ wined3d_texture_prepare_location(dst_texture, texture_level, context, WINED3D_LOCATION_TEXTURE_RGB);
+ dst_texture->texture_ops->texture_upload_data(context, wined3d_const_bo_address(&data), dst_format,
+ dst_box, dst_map.row_pitch, dst_map.slice_pitch, dst_texture, texture_level,
+ WINED3D_LOCATION_TEXTURE_RGB, dst_box->left, dst_box->top, 0);
+
+ wined3d_texture_validate_location(dst_texture, texture_level, WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_texture_invalidate_location(dst_texture, texture_level, ~WINED3D_LOCATION_TEXTURE_RGB);
+
+ heap_free(dst_map.data);
+ }
+ else
+ {
+ wined3d_context_unmap_bo_address(context, &dst_data, 0, 1, &dst_range);
+ }
+
if (!same_sub_resource)
wined3d_context_unmap_bo_address(context, &src_data, 0, 0, NULL);
if (SUCCEEDED(hr) && dst_texture->swapchain && dst_texture->swapchain->front_buffer == dst_texture)
--
2.23.0
3
3
[PATCH v3 1/2] wined3d: Move the wined3d_light_state structure to the wined3d_stateblock structure.
by Zebediah Figura 02 Dec '19
by Zebediah Figura 02 Dec '19
02 Dec '19
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wined3d/stateblock.c | 37 +++++++++++++++++-----------------
dlls/wined3d/wined3d_private.h | 4 +++-
2 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 1c3704c10a5..24017490e67 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -575,7 +575,7 @@ void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state)
for (i = 0; i < LIGHTMAP_SIZE; ++i)
{
- LIST_FOR_EACH_ENTRY_SAFE(light, cursor, &state->light_state.light_map[i], struct wined3d_light_info, entry)
+ LIST_FOR_EACH_ENTRY_SAFE(light, cursor, &state->light_state->light_map[i], struct wined3d_light_info, entry)
{
list_remove(&light->entry);
heap_free(light);
@@ -1025,7 +1025,7 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
stateblock->stateblock_state.ps = state->ps;
}
- wined3d_state_record_lights(&stateblock->stateblock_state.light_state, &state->light_state);
+ wined3d_state_record_lights(stateblock->stateblock_state.light_state, state->light_state);
TRACE("Capture done.\n");
}
@@ -1073,17 +1073,17 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
wined3d_device_set_vs_consts_b(device, idx, 1, &stateblock->stateblock_state.vs_consts_b[idx]);
}
- for (i = 0; i < ARRAY_SIZE(stateblock->stateblock_state.light_state.light_map); ++i)
+ for (i = 0; i < ARRAY_SIZE(stateblock->stateblock_state.light_state->light_map); ++i)
{
const struct wined3d_light_info *light;
struct wined3d_light_info *new_light;
- LIST_FOR_EACH_ENTRY(light, &stateblock->stateblock_state.light_state.light_map[i], struct wined3d_light_info, entry)
+ LIST_FOR_EACH_ENTRY(light, &stateblock->stateblock_state.light_state->light_map[i], struct wined3d_light_info, entry)
{
- if (SUCCEEDED(wined3d_light_state_set_light(&state->light_state, light->OriginalIndex,
+ if (SUCCEEDED(wined3d_light_state_set_light(state->light_state, light->OriginalIndex,
&light->OriginalParms, &new_light)))
{
- wined3d_light_state_enable_light(&state->light_state, &device->adapter->d3d_info, new_light, light->glIndex != -1);
+ wined3d_light_state_enable_light(state->light_state, &device->adapter->d3d_info, new_light, light->glIndex != -1);
}
wined3d_device_set_light(device, light->OriginalIndex, &light->OriginalParms);
wined3d_device_set_light_enable(device, light->OriginalIndex, light->glIndex != -1);
@@ -1678,24 +1678,23 @@ HRESULT CDECL wined3d_stateblock_set_light(struct wined3d_stateblock *stateblock
return WINED3DERR_INVALIDCALL;
}
- return wined3d_light_state_set_light(&stateblock->stateblock_state.light_state, light_idx, light, &object);
+ return wined3d_light_state_set_light(stateblock->stateblock_state.light_state, light_idx, light, &object);
}
HRESULT CDECL wined3d_stateblock_set_light_enable(struct wined3d_stateblock *stateblock, UINT light_idx, BOOL enable)
{
+ struct wined3d_light_state *light_state = stateblock->stateblock_state.light_state;
struct wined3d_light_info *light_info;
HRESULT hr;
TRACE("stateblock %p, light_idx %u, enable %#x.\n", stateblock, light_idx, enable);
- if (!(light_info = wined3d_light_state_get_light(&stateblock->stateblock_state.light_state, light_idx)))
+ if (!(light_info = wined3d_light_state_get_light(light_state, light_idx)))
{
- if (FAILED(hr = wined3d_light_state_set_light(&stateblock->stateblock_state.light_state, light_idx,
- &WINED3D_default_light, &light_info)))
+ if (FAILED(hr = wined3d_light_state_set_light(light_state, light_idx, &WINED3D_default_light, &light_info)))
return hr;
}
- wined3d_light_state_enable_light(&stateblock->stateblock_state.light_state,
- &stateblock->device->adapter->d3d_info, light_info, enable);
+ wined3d_light_state_enable_light(light_state, &stateblock->device->adapter->d3d_info, light_info, enable);
return S_OK;
}
@@ -1981,9 +1980,9 @@ void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state,
{
unsigned int i;
- for (i = 0; i < ARRAY_SIZE(state->light_state.light_map); i++)
+ for (i = 0; i < ARRAY_SIZE(state->light_state->light_map); i++)
{
- list_init(&state->light_state.light_map[i]);
+ list_init(&state->light_state->light_map[i]);
}
if (flags & WINED3D_STATE_INIT_DEFAULT)
@@ -1998,6 +1997,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
stateblock->ref = 1;
stateblock->device = device;
+ stateblock->stateblock_state.light_state = &stateblock->light_state;
wined3d_stateblock_state_init(&stateblock->stateblock_state, device,
type == WINED3D_SBT_PRIMARY ? WINED3D_STATE_INIT_DEFAULT : 0);
@@ -2011,8 +2011,8 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
switch (type)
{
case WINED3D_SBT_ALL:
- stateblock_init_lights(stateblock->stateblock_state.light_state.light_map,
- device_state->stateblock_state.light_state.light_map);
+ stateblock_init_lights(stateblock->stateblock_state.light_state->light_map,
+ device_state->stateblock_state.light_state->light_map);
stateblock_savedstates_set_all(&stateblock->changed,
d3d_info->limits.vs_uniform_count, d3d_info->limits.ps_uniform_count);
break;
@@ -2023,8 +2023,8 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru
break;
case WINED3D_SBT_VERTEX_STATE:
- stateblock_init_lights(stateblock->stateblock_state.light_state.light_map,
- device_state->stateblock_state.light_state.light_map);
+ stateblock_init_lights(stateblock->stateblock_state.light_state->light_map,
+ device_state->stateblock_state.light_state->light_map);
stateblock_savedstates_set_vertex(&stateblock->changed,
d3d_info->limits.vs_uniform_count);
break;
@@ -2078,5 +2078,6 @@ void CDECL wined3d_stateblock_reset(struct wined3d_stateblock *stateblock)
wined3d_stateblock_state_cleanup(&stateblock->stateblock_state);
memset(&stateblock->stateblock_state, 0, sizeof(stateblock->stateblock_state));
+ stateblock->stateblock_state.light_state = &stateblock->light_state;
wined3d_stateblock_state_init(&stateblock->stateblock_state, stateblock->device, WINED3D_STATE_INIT_DEFAULT);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3ae7dab858e..5f779f041f0 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3247,7 +3247,7 @@ struct wined3d_stateblock_state
struct wined3d_viewport viewport;
RECT scissor_rect;
- struct wined3d_light_state light_state;
+ struct wined3d_light_state *light_state;
};
struct wined3d_device
@@ -3946,7 +3946,9 @@ struct wined3d_stateblock
/* Array indicating whether things have been set or changed */
struct wined3d_saved_states changed;
+
struct wined3d_stateblock_state stateblock_state;
+ struct wined3d_light_state light_state;
/* Contained state management */
DWORD contained_render_states[WINEHIGHEST_RENDER_STATE + 1];
--
2.23.0
2
3
[PATCH] wined3d: Add Intel HD 615 PCI id and device description.
by eleeï¼ codeweavers.com 02 Dec '19
by eleeï¼ codeweavers.com 02 Dec '19
02 Dec '19
From: Ethan Lee <elee(a)codeweavers.com>
Signed-off-by: Ethan Lee <elee(a)codeweavers.com>
---
dlls/wined3d/directx.c | 1 +
dlls/wined3d/wined3d_private.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 902cc444ce..12b53f7577 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -565,6 +565,7 @@ static const struct wined3d_gpu_description gpu_description_table[] =
{HW_VENDOR_INTEL, CARD_INTEL_IPP580_2, "Intel(R) Iris(TM) Pro Graphics P580", DRIVER_INTEL_HD4000, 2048},
{HW_VENDOR_INTEL, CARD_INTEL_UHD617, "Intel(R) UHD Graphics 617", DRIVER_INTEL_HD4000, 2048},
{HW_VENDOR_INTEL, CARD_INTEL_UHD620, "Intel(R) UHD Graphics 620", DRIVER_INTEL_HD4000, 3072},
+ {HW_VENDOR_INTEL, CARD_INTEL_HD615, "Intel(R) HD Graphics 615", DRIVER_INTEL_HD4000, 2048},
{HW_VENDOR_INTEL, CARD_INTEL_HD620, "Intel(R) HD Graphics 620", DRIVER_INTEL_HD4000, 3072},
{HW_VENDOR_INTEL, CARD_INTEL_HD630_1, "Intel(R) HD Graphics 630", DRIVER_INTEL_HD4000, 3072},
{HW_VENDOR_INTEL, CARD_INTEL_HD630_2, "Intel(R) HD Graphics 630", DRIVER_INTEL_HD4000, 3072},
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f86853e9c9..b08a843f7f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2640,6 +2640,7 @@ enum wined3d_pci_device
CARD_INTEL_IPP580_2 = 0x193d,
CARD_INTEL_UHD617 = 0x87c0,
CARD_INTEL_UHD620 = 0x3ea0,
+ CARD_INTEL_HD615 = 0x591e,
CARD_INTEL_HD620 = 0x5916,
CARD_INTEL_HD630_1 = 0x5912,
CARD_INTEL_HD630_2 = 0x591b,
--
2.21.0
2
1
02 Dec '19
Fixes ddraw7 test crashes in Testbow(w10).
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com>
---
The test was already mostly marked broken on WARP due to Win8 WARP failures.
dlls/ddraw/tests/ddraw7.c | 111 +++++++++++++++++++-------------------
1 file changed, 56 insertions(+), 55 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index be59c7d3ac..ee77474f74 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -11040,21 +11040,7 @@ static void test_colorkey_precision(void)
{{ 1.0f, -1.0f, 0.0f}, {1.0f, 1.0f}},
{{ 1.0f, 1.0f, 0.0f}, {1.0f, 0.0f}},
};
- IDirect3DDevice7 *device;
- IDirect3D7 *d3d;
- IDirectDraw7 *ddraw;
- IDirectDrawSurface7 *rt;
- HWND window;
- HRESULT hr;
- IDirectDrawSurface7 *src, *dst, *texture;
- DDSURFACEDESC2 surface_desc, lock_desc;
- ULONG refcount;
- D3DCOLOR color;
- unsigned int t, c;
- DDCOLORKEY ckey;
- DDBLTFX fx;
- DWORD data[4] = {0}, color_mask;
- BOOL is_nvidia, is_warp;
+
static const struct
{
unsigned int max, shift, bpp, clear;
@@ -11097,6 +11083,22 @@ static void test_colorkey_precision(void)
},
};
+ IDirectDrawSurface7 *src, *dst, *texture;
+ DDSURFACEDESC2 surface_desc, lock_desc;
+ DWORD data[4] = {0}, color_mask;
+ IDirect3DDevice7 *device;
+ IDirectDrawSurface7 *rt;
+ IDirectDraw7 *ddraw;
+ unsigned int t, c;
+ DDCOLORKEY ckey;
+ IDirect3D7 *d3d;
+ BOOL is_nvidia;
+ ULONG refcount;
+ D3DCOLOR color;
+ HWND window;
+ HRESULT hr;
+ DDBLTFX fx;
+
window = create_window();
if (!(device = create_device(window, DDSCL_NORMAL)))
{
@@ -11106,40 +11108,43 @@ static void test_colorkey_precision(void)
}
hr = IDirect3DDevice7_GetDirect3D(device, &d3d);
- ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw);
- ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
IDirect3D7_Release(d3d);
hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
- ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
is_nvidia = ddraw_is_nvidia(ddraw);
/* The Windows 8 WARP driver has plenty of false negatives in X8R8G8B8
* (color key doesn't match although the values are equal), and a false
* positive when the color key is 0 and the texture contains the value 1.
- * I don't want to mark this broken unconditionally since this would
- * essentially disable the test on Windows. Also on random occasions
- * 254 == 255 and 255 != 255.*/
- is_warp = ddraw_is_warp(ddraw);
+ * Also on random occasions 254 == 255 and 255 != 255.
+ * Crashes on Windows 10 WARP. */
+ if (ddraw_is_warp(ddraw))
+ {
+ win_skip("Skipping test on WARP driver.\n");
+ goto done;
+ }
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE);
- ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE);
- ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, TRUE);
- ok(SUCCEEDED(hr), "Failed to enable color keying, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
/* Multiply the texture read result with 0, that way the result color if the key doesn't
* match is constant. In theory color keying works without reading the texture result
* (meaning we could just op=arg1, arg1=tfactor), but the Geforce7 Windows driver begs
* to differ. */
hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE);
- ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
- ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_TFACTOR);
- ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x00000000);
- ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
@@ -11164,9 +11169,9 @@ static void test_colorkey_precision(void)
/* Windows XP (at least with the r200 driver, other drivers untested) produces
* garbage when doing color keyed texture->texture blits. */
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &src, NULL);
- ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &dst, NULL);
- ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
U5(fx).dwFillColor = tests[t].clear;
/* On the w8 testbot (WARP driver) the blit result has different values in the
@@ -11184,15 +11189,15 @@ static void test_colorkey_precision(void)
surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = c << tests[t].shift;
surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = c << tests[t].shift;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &texture, NULL);
- ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetTexture(device, 0, texture);
- ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_Blt(dst, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
- ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_Lock(src, NULL, &lock_desc, DDLOCK_WAIT, NULL);
- ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
switch (tests[t].bpp)
{
case 4:
@@ -11210,21 +11215,21 @@ static void test_colorkey_precision(void)
break;
}
hr = IDirectDrawSurface7_Unlock(src, 0);
- ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_Blt(texture, NULL, src, NULL, DDBLT_WAIT, NULL);
- ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
ckey.dwColorSpaceLowValue = c << tests[t].shift;
ckey.dwColorSpaceHighValue = c << tests[t].shift;
hr = IDirectDrawSurface7_SetColorKey(src, DDCKEY_SRCBLT, &ckey);
- ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL);
- ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
/* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */
hr = IDirectDrawSurface7_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL);
- ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
switch (tests[t].bpp)
{
case 4:
@@ -11242,7 +11247,7 @@ static void test_colorkey_precision(void)
break;
}
hr = IDirectDrawSurface7_Unlock(dst, 0);
- ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
if (!c)
{
@@ -11284,38 +11289,34 @@ static void test_colorkey_precision(void)
(c + 1) << tests[t].shift, data[2], tests[t].name, c);
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x0000ff00, 1.0f, 0);
- ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_BeginScene(device);
- ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0);
- ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_EndScene(device);
- ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
color = get_surface_color(rt, 80, 240);
+
if (!c)
- ok(compare_color(color, 0x0000ff00, 1) || broken(is_warp && compare_color(color, 0x00000000, 1)),
- "Got unexpected color 0x%08x, format %s, c=%u.\n",
+ ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x, format %s, c=%u.\n",
color, tests[t].name, c);
else
- ok(compare_color(color, 0x00000000, 1) || broken(is_warp && compare_color(color, 0x0000ff00, 1)),
- "Got unexpected color 0x%08x, format %s, c=%u.\n",
+ ok(compare_color(color, 0x00000000, 1), "Got unexpected color 0x%08x, format %s, c=%u.\n",
color, tests[t].name, c);
color = get_surface_color(rt, 240, 240);
- ok(compare_color(color, 0x0000ff00, 1) || broken(is_warp && compare_color(color, 0x00000000, 1)),
- "Got unexpected color 0x%08x, format %s, c=%u.\n",
+ ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x, format %s, c=%u.\n",
color, tests[t].name, c);
color = get_surface_color(rt, 400, 240);
if (c == tests[t].max)
- ok(compare_color(color, 0x0000ff00, 1) || broken(is_warp && compare_color(color, 0x00000000, 1)),
- "Got unexpected color 0x%08x, format %s, c=%u.\n",
+ ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x, format %s, c=%u.\n",
color, tests[t].name, c);
else
- ok(compare_color(color, 0x00000000, 1) || broken(is_warp && compare_color(color, 0x0000ff00, 1)),
- "Got unexpected color 0x%08x, format %s, c=%u.\n",
+ ok(compare_color(color, 0x00000000, 1), "Got unexpected color 0x%08x, format %s, c=%u.\n",
color, tests[t].name, c);
IDirectDrawSurface7_Release(texture);
--
2.23.0
3
2
Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com>
---
dlls/dxgi/tests/dxgi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c
index 874c39b88e..b2b53f7a4c 100644
--- a/dlls/dxgi/tests/dxgi.c
+++ b/dlls/dxgi/tests/dxgi.c
@@ -2151,7 +2151,7 @@ static void test_get_containing_output(void)
{
ret = SetWindowPos(swapchain_desc.OutputWindow, 0, points[i].x, points[i].y,
0, 0, SWP_NOSIZE | SWP_NOZORDER);
- ok(ret, "Faled to set window position.\n");
+ ok(ret, "Failed to set window position.\n");
monitor = MonitorFromWindow(swapchain_desc.OutputWindow, MONITOR_DEFAULTTONEAREST);
ok(!!monitor, "Failed to get monitor from window.\n");
--
2.23.0
3
2
This prevents discrepencies between the VM creation interface and
LibvirtTool's validation of VM names.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/LibvirtTool.pl | 23 +++++++++++++----------
testbot/lib/WineTestBot/VMs.pm | 17 +++++++++++++++++
2 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index bc45533d2..e5dc8372e 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -118,20 +118,23 @@ if (!defined $Usage)
Error "you must specify the VM name\n";
$Usage = 2;
}
- elsif ($VMKey =~ /^([a-zA-Z0-9_]+)$/)
+ else
{
- $VMKey = $1; # untaint
- $VM = CreateVMs()->GetItem($VMKey);
- if (!defined $VM)
+ $VMKey = WineTestBot::VM::UntaintName($VMKey);
+ if (!defined $VMKey)
{
- Error "VM $VMKey does not exist\n";
+ Error "'$VMKey' is not a valid VM name\n";
$Usage = 2;
}
- }
- else
- {
- Error "'$VMKey' is not a valid VM name\n";
- $Usage = 2;
+ else
+ {
+ $VM = CreateVMs()->GetItem($VMKey);
+ if (!defined $VM)
+ {
+ Error "VM $VMKey does not exist\n";
+ $Usage = 2;
+ }
+ }
}
}
if (defined $Usage)
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index 279b7bccd..2f4b70362 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -320,10 +320,27 @@ my $_SupportedMissions = {
"wine" => { "win32" => 1, "wow32" => 1, "wow64" => 1 },
};
+sub UntaintName($)
+{
+ my ($VMName) = @_;
+
+ return undef if (!defined $VMName);
+ $VMName =~ /^([a-zA-Z0-9_]+)$/;
+ return $1;
+}
+
sub Validate($)
{
my ($self) = @_;
+ if (!defined $self->Name)
+ {
+ return ("Name", "The name must be set");
+ }
+ if (!defined UntaintName($self->Name))
+ {
+ return ("Name", "The name '". $self->Name ."' contains invalid characters");
+ }
if ($self->Type !~ /^(?:win32|win64|wine)$/ and
$self->Role =~ /^(?:extra|winetest)$/)
{
--
2.20.1
1
0
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/dwrite/dwrite_private.h | 40 +-
dlls/dwrite/font.c | 732 +++++++++++++++++++----------------
dlls/dwrite/freetype.c | 40 +-
dlls/dwrite/main.c | 15 +-
dlls/dwrite/opentype.c | 24 +-
5 files changed, 470 insertions(+), 381 deletions(-)
diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h
index d3d74e0709..7898403dd9 100644
--- a/dlls/dwrite/dwrite_private.h
+++ b/dlls/dwrite/dwrite_private.h
@@ -175,7 +175,7 @@ struct dwrite_fonttable
struct fontfacecached
{
struct list entry;
- IDWriteFontFace4 *fontface;
+ IDWriteFontFace5 *fontface;
};
#define GLYPH_BLOCK_SHIFT 8
@@ -185,8 +185,8 @@ struct fontfacecached
struct dwrite_fontface
{
- IDWriteFontFace4 IDWriteFontFace4_iface;
- LONG ref;
+ IDWriteFontFace5 IDWriteFontFace5_iface;
+ LONG refcount;
IDWriteFontFileStream *stream;
IDWriteFontFile **files;
@@ -244,7 +244,8 @@ extern IDWriteTextAnalyzer *get_text_analyzer(void) DECLSPEC_HIDDEN;
extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_key, UINT32 key_size, IDWriteFontFile **font_file) DECLSPEC_HIDDEN;
extern void init_local_fontfile_loader(void) DECLSPEC_HIDDEN;
extern IDWriteFontFileLoader *get_local_fontfile_loader(void) DECLSPEC_HIDDEN;
-extern HRESULT create_fontface(const struct fontface_desc*,struct list*,IDWriteFontFace4**) DECLSPEC_HIDDEN;
+extern HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_list,
+ IDWriteFontFace5 **fontface) DECLSPEC_HIDDEN;
extern HRESULT create_font_collection(IDWriteFactory5 *factory, IDWriteFontFileEnumerator *enumerator, BOOL is_system,
IDWriteFontCollection3 **collection) DECLSPEC_HIDDEN;
extern HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc*,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN;
@@ -267,13 +268,14 @@ extern HRESULT factory_get_cached_fontface(IDWriteFactory5*,IDWriteFontFile*cons
struct list**,REFIID,void**) DECLSPEC_HIDDEN;
extern void factory_detach_fontcollection(IDWriteFactory5 *factory, IDWriteFontCollection3 *collection) DECLSPEC_HIDDEN;
extern void factory_detach_gdiinterop(IDWriteFactory5*,IDWriteGdiInterop1*) DECLSPEC_HIDDEN;
-extern struct fontfacecached *factory_cache_fontface(IDWriteFactory5*,struct list*,IDWriteFontFace4*) DECLSPEC_HIDDEN;
+extern struct fontfacecached *factory_cache_fontface(IDWriteFactory5 *factory, struct list *fontfaces,
+ IDWriteFontFace5 *fontface) DECLSPEC_HIDDEN;
extern void get_logfont_from_font(IDWriteFont*,LOGFONTW*) DECLSPEC_HIDDEN;
extern void get_logfont_from_fontface(IDWriteFontFace*,LOGFONTW*) DECLSPEC_HIDDEN;
extern HRESULT get_fontsig_from_font(IDWriteFont*,FONTSIGNATURE*) DECLSPEC_HIDDEN;
extern HRESULT get_fontsig_from_fontface(IDWriteFontFace*,FONTSIGNATURE*) DECLSPEC_HIDDEN;
extern HRESULT create_gdiinterop(IDWriteFactory5*,IDWriteGdiInterop1**) DECLSPEC_HIDDEN;
-extern void fontface_detach_from_cache(IDWriteFontFace4*) DECLSPEC_HIDDEN;
+extern void fontface_detach_from_cache(IDWriteFontFace5 *fontface) DECLSPEC_HIDDEN;
extern void factory_lock(IDWriteFactory5*) DECLSPEC_HIDDEN;
extern void factory_unlock(IDWriteFactory5*) DECLSPEC_HIDDEN;
extern HRESULT create_inmemory_fileloader(IDWriteFontFileLoader**) DECLSPEC_HIDDEN;
@@ -300,7 +302,7 @@ struct file_stream_desc {
UINT32 face_index;
};
-extern const void* get_fontface_table(IDWriteFontFace4 *fontface, UINT32 tag,
+extern const void* get_fontface_table(IDWriteFontFace5 *fontface, UINT32 tag,
struct dwrite_fonttable *table) DECLSPEC_HIDDEN;
extern HRESULT opentype_analyze_font(IDWriteFontFileStream*,BOOL*,DWRITE_FONT_FILE_TYPE*,DWRITE_FONT_FACE_TYPE*,UINT32*) DECLSPEC_HIDDEN;
@@ -321,8 +323,8 @@ extern unsigned int opentype_get_cpal_palettecount(const struct dwrite_fonttable
extern unsigned int opentype_get_cpal_paletteentrycount(const struct dwrite_fonttable *table) DECLSPEC_HIDDEN;
extern HRESULT opentype_get_cpal_entries(const struct dwrite_fonttable *table, unsigned int palette,
unsigned int first_entry_index, unsigned int entry_count, DWRITE_COLOR_F *entries) DECLSPEC_HIDDEN;
-extern BOOL opentype_has_vertical_variants(IDWriteFontFace4*) DECLSPEC_HIDDEN;
-extern UINT32 opentype_get_glyph_image_formats(IDWriteFontFace4*) DECLSPEC_HIDDEN;
+extern BOOL opentype_has_vertical_variants(IDWriteFontFace5 *fontface) DECLSPEC_HIDDEN;
+extern UINT32 opentype_get_glyph_image_formats(IDWriteFontFace5 *fontface) DECLSPEC_HIDDEN;
extern DWRITE_CONTAINER_TYPE opentype_analyze_container_type(void const *, UINT32) DECLSPEC_HIDDEN;
struct dwrite_colorglyph {
@@ -373,19 +375,21 @@ extern void release_freetype(void) DECLSPEC_HIDDEN;
extern HRESULT freetype_get_design_glyph_metrics(struct dwrite_fontface *fontface, UINT16 glyph,
DWRITE_GLYPH_METRICS *metrics) DECLSPEC_HIDDEN;
-extern void freetype_notify_cacheremove(IDWriteFontFace4*) DECLSPEC_HIDDEN;
-extern BOOL freetype_is_monospaced(IDWriteFontFace4*) DECLSPEC_HIDDEN;
-extern HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, float emsize, UINT16 const *glyphs,
+extern void freetype_notify_cacheremove(IDWriteFontFace5 *fontface) DECLSPEC_HIDDEN;
+extern BOOL freetype_is_monospaced(IDWriteFontFace5 *fontface) DECLSPEC_HIDDEN;
+extern HRESULT freetype_get_glyphrun_outline(IDWriteFontFace5 *fontface, float emsize, UINT16 const *glyphs,
float const *advances, DWRITE_GLYPH_OFFSET const *offsets, unsigned int count, BOOL is_rtl,
IDWriteGeometrySink *sink) DECLSPEC_HIDDEN;
-extern UINT16 freetype_get_glyphcount(IDWriteFontFace4*) DECLSPEC_HIDDEN;
-extern void freetype_get_glyphs(IDWriteFontFace4*,INT,UINT32 const*,UINT32,UINT16*) DECLSPEC_HIDDEN;
-extern BOOL freetype_has_kerning_pairs(IDWriteFontFace4*) DECLSPEC_HIDDEN;
-extern INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace4*,UINT16,UINT16) DECLSPEC_HIDDEN;
+extern UINT16 freetype_get_glyphcount(IDWriteFontFace5 *fontface) DECLSPEC_HIDDEN;
+extern void freetype_get_glyphs(IDWriteFontFace5 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
+ UINT16 *glyphs) DECLSPEC_HIDDEN;
+extern BOOL freetype_has_kerning_pairs(IDWriteFontFace5 *fontface) DECLSPEC_HIDDEN;
+extern INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace5 *fontface, UINT16 left, UINT16 right) DECLSPEC_HIDDEN;
extern void freetype_get_glyph_bbox(struct dwrite_glyphbitmap *bitmap_desc) DECLSPEC_HIDDEN;
extern BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap*) DECLSPEC_HIDDEN;
-extern INT freetype_get_charmap_index(IDWriteFontFace4*,BOOL*) DECLSPEC_HIDDEN;
-extern INT32 freetype_get_glyph_advance(IDWriteFontFace4*,FLOAT,UINT16,DWRITE_MEASURING_MODE,BOOL*) DECLSPEC_HIDDEN;
+extern INT freetype_get_charmap_index(IDWriteFontFace5 *fontface, BOOL *is_symbol) DECLSPEC_HIDDEN;
+extern INT32 freetype_get_glyph_advance(IDWriteFontFace5 *fontface, FLOAT emsize, UINT16 index,
+ DWRITE_MEASURING_MODE measuring_mode, BOOL *has_contours) DECLSPEC_HIDDEN;
extern void freetype_get_design_glyph_bbox(IDWriteFontFace4*,UINT16,UINT16,RECT*) DECLSPEC_HIDDEN;
/* Glyph shaping */
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 306f431d65..1bf88d6b17 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -185,7 +185,7 @@ struct dwrite_colorglyphenum
FLOAT origin_x; /* original run origin */
FLOAT origin_y;
- IDWriteFontFace4 *fontface; /* for convenience */
+ IDWriteFontFace5 *fontface; /* for convenience */
DWRITE_COLOR_GLYPH_RUN1 colorrun; /* returned with GetCurrentRun() */
DWRITE_GLYPH_RUN run; /* base run */
UINT32 palette; /* palette index to get layer color from */
@@ -239,7 +239,7 @@ static void dwrite_grab_font_table(void *context, UINT32 table, const BYTE **dat
struct dwrite_fontface *fontface = context;
BOOL exists = FALSE;
- if (FAILED(IDWriteFontFace4_TryGetFontTable(&fontface->IDWriteFontFace4_iface, table, (const void **)data,
+ if (FAILED(IDWriteFontFace5_TryGetFontTable(&fontface->IDWriteFontFace5_iface, table, (const void **)data,
size, data_context, &exists)) || !exists)
{
*data = NULL;
@@ -251,7 +251,7 @@ static void dwrite_grab_font_table(void *context, UINT32 table, const BYTE **dat
static void dwrite_release_font_table(void *context, void *data_context)
{
struct dwrite_fontface *fontface = context;
- IDWriteFontFace4_ReleaseFontTable(&fontface->IDWriteFontFace4_iface, data_context);
+ IDWriteFontFace5_ReleaseFontTable(&fontface->IDWriteFontFace5_iface, data_context);
}
static UINT16 dwrite_get_font_upem(void *context)
@@ -275,9 +275,9 @@ struct scriptshaping_cache *fontface_get_shaping_cache(struct dwrite_fontface *f
return fontface->shaping_cache = create_scriptshaping_cache(fontface, &dwrite_font_ops);
}
-static inline struct dwrite_fontface *impl_from_IDWriteFontFace4(IDWriteFontFace4 *iface)
+static inline struct dwrite_fontface *impl_from_IDWriteFontFace5(IDWriteFontFace5 *iface)
{
- return CONTAINING_RECORD(iface, struct dwrite_fontface, IDWriteFontFace4_iface);
+ return CONTAINING_RECORD(iface, struct dwrite_fontface, IDWriteFontFace5_iface);
}
static inline struct dwrite_font *impl_from_IDWriteFont3(IDWriteFont3 *iface)
@@ -350,7 +350,7 @@ static HRESULT set_cached_glyph_metrics(struct dwrite_fontface *fontface, UINT16
return S_OK;
}
-const void* get_fontface_table(IDWriteFontFace4 *fontface, UINT32 tag, struct dwrite_fonttable *table)
+const void* get_fontface_table(IDWriteFontFace5 *fontface, UINT32 tag, struct dwrite_fonttable *table)
{
HRESULT hr;
@@ -358,7 +358,7 @@ const void* get_fontface_table(IDWriteFontFace4 *fontface, UINT32 tag, struct dw
return table->data;
table->exists = FALSE;
- hr = IDWriteFontFace4_TryGetFontTable(fontface, tag, (const void**)&table->data, &table->size, &table->context,
+ hr = IDWriteFontFace5_TryGetFontTable(fontface, tag, (const void **)&table->data, &table->size, &table->context,
&table->exists);
if (FAILED(hr) || !table->exists) {
TRACE("Font does not have %s table\n", debugstr_tag(tag));
@@ -388,25 +388,25 @@ static FLOAT get_font_prop_vec_dotproduct(const struct dwrite_font_propvec *left
static const struct dwrite_fonttable *get_fontface_vdmx(struct dwrite_fontface *fontface)
{
- get_fontface_table(&fontface->IDWriteFontFace4_iface, MS_VDMX_TAG, &fontface->vdmx);
+ get_fontface_table(&fontface->IDWriteFontFace5_iface, MS_VDMX_TAG, &fontface->vdmx);
return &fontface->vdmx;
}
static const struct dwrite_fonttable *get_fontface_gasp(struct dwrite_fontface *fontface)
{
- get_fontface_table(&fontface->IDWriteFontFace4_iface, MS_GASP_TAG, &fontface->gasp);
+ get_fontface_table(&fontface->IDWriteFontFace5_iface, MS_GASP_TAG, &fontface->gasp);
return &fontface->gasp;
}
static const struct dwrite_fonttable *get_fontface_cpal(struct dwrite_fontface *fontface)
{
- get_fontface_table(&fontface->IDWriteFontFace4_iface, MS_CPAL_TAG, &fontface->cpal);
+ get_fontface_table(&fontface->IDWriteFontFace5_iface, MS_CPAL_TAG, &fontface->cpal);
return &fontface->cpal;
}
static const void* get_fontface_colr(struct dwrite_fontface *fontface)
{
- return get_fontface_table(&fontface->IDWriteFontFace4_iface, MS_COLR_TAG, &fontface->colr);
+ return get_fontface_table(&fontface->IDWriteFontFace5_iface, MS_COLR_TAG, &fontface->colr);
}
static void addref_font_data(struct dwrite_font_data *data)
@@ -447,17 +447,17 @@ static void release_fontfamily_data(struct dwrite_fontfamily_data *data)
heap_free(data);
}
-void fontface_detach_from_cache(IDWriteFontFace4 *iface)
+void fontface_detach_from_cache(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *fontface = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
fontface->cached = NULL;
}
-static HRESULT WINAPI dwritefontface_QueryInterface(IDWriteFontFace4 *iface, REFIID riid, void **obj)
+static HRESULT WINAPI dwritefontface_QueryInterface(IDWriteFontFace5 *iface, REFIID riid, void **obj)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
- TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
if (IsEqualIID(riid, &IID_IDWriteFontFace4) ||
IsEqualIID(riid, &IID_IDWriteFontFace3) ||
@@ -467,8 +467,9 @@ static HRESULT WINAPI dwritefontface_QueryInterface(IDWriteFontFace4 *iface, REF
IsEqualIID(riid, &IID_IUnknown))
{
*obj = iface;
- if (InterlockedIncrement(&This->ref) == 1) {
- InterlockedDecrement(&This->ref);
+ if (InterlockedIncrement(&fontface->refcount) == 1)
+ {
+ InterlockedDecrement(&fontface->refcount);
*obj = NULL;
return E_FAIL;
}
@@ -481,131 +482,148 @@ static HRESULT WINAPI dwritefontface_QueryInterface(IDWriteFontFace4 *iface, REF
return E_NOINTERFACE;
}
-static ULONG WINAPI dwritefontface_AddRef(IDWriteFontFace4 *iface)
+static ULONG WINAPI dwritefontface_AddRef(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p)->(%d)\n", This, ref);
- return ref;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+ ULONG refcount = InterlockedIncrement(&fontface->refcount);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ return refcount;
}
-static ULONG WINAPI dwritefontface_Release(IDWriteFontFace4 *iface)
+static ULONG WINAPI dwritefontface_Release(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- ULONG ref = InterlockedDecrement(&This->ref);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+ ULONG refcount = InterlockedDecrement(&fontface->refcount);
- TRACE("(%p)->(%d)\n", This, ref);
+ TRACE("%p, refcount %u.\n", iface, refcount);
- if (!ref) {
+ if (!refcount)
+ {
UINT32 i;
- if (This->cached) {
- factory_lock(This->factory);
- list_remove(&This->cached->entry);
- factory_unlock(This->factory);
- heap_free(This->cached);
+ if (fontface->cached)
+ {
+ factory_lock(fontface->factory);
+ list_remove(&fontface->cached->entry);
+ factory_unlock(fontface->factory);
+ heap_free(fontface->cached);
}
- release_scriptshaping_cache(This->shaping_cache);
- if (This->cmap.context)
- IDWriteFontFace4_ReleaseFontTable(iface, This->cmap.context);
- if (This->vdmx.context)
- IDWriteFontFace4_ReleaseFontTable(iface, This->vdmx.context);
- if (This->gasp.context)
- IDWriteFontFace4_ReleaseFontTable(iface, This->gasp.context);
- if (This->cpal.context)
- IDWriteFontFace4_ReleaseFontTable(iface, This->cpal.context);
- if (This->colr.context)
- IDWriteFontFace4_ReleaseFontTable(iface, This->colr.context);
- for (i = 0; i < This->file_count; i++) {
- if (This->files[i])
- IDWriteFontFile_Release(This->files[i]);
+ release_scriptshaping_cache(fontface->shaping_cache);
+ if (fontface->cmap.context)
+ IDWriteFontFace5_ReleaseFontTable(iface, fontface->cmap.context);
+ if (fontface->vdmx.context)
+ IDWriteFontFace5_ReleaseFontTable(iface, fontface->vdmx.context);
+ if (fontface->gasp.context)
+ IDWriteFontFace5_ReleaseFontTable(iface, fontface->gasp.context);
+ if (fontface->cpal.context)
+ IDWriteFontFace5_ReleaseFontTable(iface, fontface->cpal.context);
+ if (fontface->colr.context)
+ IDWriteFontFace5_ReleaseFontTable(iface, fontface->colr.context);
+ for (i = 0; i < fontface->file_count; i++)
+ {
+ if (fontface->files[i])
+ IDWriteFontFile_Release(fontface->files[i]);
}
- if (This->stream)
- IDWriteFontFileStream_Release(This->stream);
- heap_free(This->files);
+ if (fontface->stream)
+ IDWriteFontFileStream_Release(fontface->stream);
+ heap_free(fontface->files);
- for (i = 0; i < ARRAY_SIZE(This->glyphs); i++)
- heap_free(This->glyphs[i]);
+ for (i = 0; i < ARRAY_SIZE(fontface->glyphs); i++)
+ heap_free(fontface->glyphs[i]);
freetype_notify_cacheremove(iface);
- IDWriteFactory5_Release(This->factory);
- heap_free(This);
+ IDWriteFactory5_Release(fontface->factory);
+ heap_free(fontface);
}
- return ref;
+ return refcount;
}
-static DWRITE_FONT_FACE_TYPE WINAPI dwritefontface_GetType(IDWriteFontFace4 *iface)
+static DWRITE_FONT_FACE_TYPE WINAPI dwritefontface_GetType(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return This->type;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return fontface->type;
}
-static HRESULT WINAPI dwritefontface_GetFiles(IDWriteFontFace4 *iface, UINT32 *number_of_files,
+static HRESULT WINAPI dwritefontface_GetFiles(IDWriteFontFace5 *iface, UINT32 *number_of_files,
IDWriteFontFile **fontfiles)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
int i;
- TRACE("(%p)->(%p %p)\n", This, number_of_files, fontfiles);
+ TRACE("%p, %p, %p.\n", iface, number_of_files, fontfiles);
+
if (fontfiles == NULL)
{
- *number_of_files = This->file_count;
+ *number_of_files = fontface->file_count;
return S_OK;
}
- if (*number_of_files < This->file_count)
+
+ if (*number_of_files < fontface->file_count)
return E_INVALIDARG;
- for (i = 0; i < This->file_count; i++)
+ for (i = 0; i < fontface->file_count; i++)
{
- IDWriteFontFile_AddRef(This->files[i]);
- fontfiles[i] = This->files[i];
+ IDWriteFontFile_AddRef(fontface->files[i]);
+ fontfiles[i] = fontface->files[i];
}
return S_OK;
}
-static UINT32 WINAPI dwritefontface_GetIndex(IDWriteFontFace4 *iface)
+static UINT32 WINAPI dwritefontface_GetIndex(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return This->index;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return fontface->index;
}
-static DWRITE_FONT_SIMULATIONS WINAPI dwritefontface_GetSimulations(IDWriteFontFace4 *iface)
+static DWRITE_FONT_SIMULATIONS WINAPI dwritefontface_GetSimulations(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return This->simulations;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return fontface->simulations;
}
-static BOOL WINAPI dwritefontface_IsSymbolFont(IDWriteFontFace4 *iface)
+static BOOL WINAPI dwritefontface_IsSymbolFont(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return !!(This->flags & FONTFACE_IS_SYMBOL);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return !!(fontface->flags & FONTFACE_IS_SYMBOL);
}
-static void WINAPI dwritefontface_GetMetrics(IDWriteFontFace4 *iface, DWRITE_FONT_METRICS *metrics)
+static void WINAPI dwritefontface_GetMetrics(IDWriteFontFace5 *iface, DWRITE_FONT_METRICS *metrics)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)->(%p)\n", This, metrics);
- memcpy(metrics, &This->metrics, sizeof(*metrics));
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p, %p.\n", iface, metrics);
+
+ memcpy(metrics, &fontface->metrics, sizeof(*metrics));
}
-static UINT16 WINAPI dwritefontface_GetGlyphCount(IDWriteFontFace4 *iface)
+static UINT16 WINAPI dwritefontface_GetGlyphCount(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
+ TRACE("%p.\n", iface);
+
return freetype_get_glyphcount(iface);
}
-static HRESULT WINAPI dwritefontface_GetDesignGlyphMetrics(IDWriteFontFace4 *iface,
+static HRESULT WINAPI dwritefontface_GetDesignGlyphMetrics(IDWriteFontFace5 *iface,
UINT16 const *glyphs, UINT32 glyph_count, DWRITE_GLYPH_METRICS *ret, BOOL is_sideways)
{
- struct dwrite_fontface *fontface = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
unsigned int i;
HRESULT hr;
@@ -644,50 +662,48 @@ static HRESULT fontface_get_glyphs(struct dwrite_fontface *fontface, UINT32 cons
return E_INVALIDARG;
}
- freetype_get_glyphs(&fontface->IDWriteFontFace4_iface, fontface->charmap, codepoints, count, glyphs);
+ freetype_get_glyphs(&fontface->IDWriteFontFace5_iface, fontface->charmap, codepoints, count, glyphs);
return S_OK;
}
-static HRESULT WINAPI dwritefontface_GetGlyphIndices(IDWriteFontFace4 *iface, UINT32 const *codepoints,
+static HRESULT WINAPI dwritefontface_GetGlyphIndices(IDWriteFontFace5 *iface, UINT32 const *codepoints,
UINT32 count, UINT16 *glyphs)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
- TRACE("(%p)->(%p %u %p)\n", This, codepoints, count, glyphs);
+ TRACE("%p, %p, %u, %p.\n", iface, codepoints, count, glyphs);
- return fontface_get_glyphs(This, codepoints, count, glyphs);
+ return fontface_get_glyphs(fontface, codepoints, count, glyphs);
}
-static HRESULT WINAPI dwritefontface_TryGetFontTable(IDWriteFontFace4 *iface, UINT32 table_tag,
+static HRESULT WINAPI dwritefontface_TryGetFontTable(IDWriteFontFace5 *iface, UINT32 table_tag,
const void **table_data, UINT32 *table_size, void **context, BOOL *exists)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
struct file_stream_desc stream_desc;
- TRACE("(%p)->(%s %p %p %p %p)\n", This, debugstr_tag(table_tag), table_data, table_size, context, exists);
+ TRACE("%p, %s, %p, %p, %p, %p.\n", iface, debugstr_tag(table_tag), table_data, table_size, context, exists);
- stream_desc.stream = This->stream;
- stream_desc.face_type = This->type;
- stream_desc.face_index = This->index;
+ stream_desc.stream = fontface->stream;
+ stream_desc.face_type = fontface->type;
+ stream_desc.face_index = fontface->index;
return opentype_get_font_table(&stream_desc, table_tag, table_data, context, table_size, exists);
}
-static void WINAPI dwritefontface_ReleaseFontTable(IDWriteFontFace4 *iface, void *table_context)
+static void WINAPI dwritefontface_ReleaseFontTable(IDWriteFontFace5 *iface, void *table_context)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
- TRACE("(%p)->(%p)\n", This, table_context);
+ TRACE("%p, %p.\n", iface, table_context);
- IDWriteFontFileStream_ReleaseFileFragment(This->stream, table_context);
+ IDWriteFontFileStream_ReleaseFileFragment(fontface->stream, table_context);
}
-static HRESULT WINAPI dwritefontface_GetGlyphRunOutline(IDWriteFontFace4 *iface, FLOAT emSize,
+static HRESULT WINAPI dwritefontface_GetGlyphRunOutline(IDWriteFontFace5 *iface, FLOAT emSize,
UINT16 const *glyphs, FLOAT const* advances, DWRITE_GLYPH_OFFSET const *offsets,
UINT32 count, BOOL is_sideways, BOOL is_rtl, IDWriteGeometrySink *sink)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
-
- TRACE("(%p)->(%.2f %p %p %p %u %d %d %p)\n", This, emSize, glyphs, advances, offsets,
+ TRACE("%p, %.8e, %p, %p, %p, %u, %d, %d, %p.\n", iface, emSize, glyphs, advances, offsets,
count, is_sideways, is_rtl, sink);
if (!glyphs || !sink)
@@ -727,14 +743,14 @@ static DWRITE_RENDERING_MODE fontface_renderingmode_from_measuringmode(DWRITE_ME
return mode;
}
-static HRESULT WINAPI dwritefontface_GetRecommendedRenderingMode(IDWriteFontFace4 *iface, FLOAT emSize,
+static HRESULT WINAPI dwritefontface_GetRecommendedRenderingMode(IDWriteFontFace5 *iface, FLOAT emSize,
FLOAT ppdip, DWRITE_MEASURING_MODE measuring, IDWriteRenderingParams *params, DWRITE_RENDERING_MODE *mode)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
unsigned int flags;
FLOAT ppem;
- TRACE("(%p)->(%.2f %.2f %d %p %p)\n", This, emSize, ppdip, measuring, params, mode);
+ TRACE("%p, %.8e, %.8e, %d, %p, %p.\n", iface, emSize, ppdip, measuring, params, mode);
if (!params) {
*mode = DWRITE_RENDERING_MODE_DEFAULT;
@@ -752,16 +768,16 @@ static HRESULT WINAPI dwritefontface_GetRecommendedRenderingMode(IDWriteFontFace
return S_OK;
}
- flags = opentype_get_gasp_flags(get_fontface_gasp(This), ppem);
+ flags = opentype_get_gasp_flags(get_fontface_gasp(fontface), ppem);
*mode = fontface_renderingmode_from_measuringmode(measuring, ppem, flags);
return S_OK;
}
-static HRESULT WINAPI dwritefontface_GetGdiCompatibleMetrics(IDWriteFontFace4 *iface, FLOAT emSize, FLOAT pixels_per_dip,
+static HRESULT WINAPI dwritefontface_GetGdiCompatibleMetrics(IDWriteFontFace5 *iface, FLOAT emSize, FLOAT pixels_per_dip,
DWRITE_MATRIX const *transform, DWRITE_FONT_METRICS *metrics)
{
DWRITE_FONT_METRICS1 metrics1;
- HRESULT hr = IDWriteFontFace4_GetGdiCompatibleMetrics(iface, emSize, pixels_per_dip, transform, &metrics1);
+ HRESULT hr = IDWriteFontFace5_GetGdiCompatibleMetrics(iface, emSize, pixels_per_dip, transform, &metrics1);
memcpy(metrics, &metrics1, sizeof(*metrics));
return hr;
}
@@ -779,25 +795,25 @@ static UINT32 fontface_get_horz_metric_adjustment(const struct dwrite_fontface *
return (fontface->metrics.designUnitsPerEm + 49) / 50;
}
-static HRESULT WINAPI dwritefontface_GetGdiCompatibleGlyphMetrics(IDWriteFontFace4 *iface, FLOAT emSize, FLOAT ppdip,
+static HRESULT WINAPI dwritefontface_GetGdiCompatibleGlyphMetrics(IDWriteFontFace5 *iface, FLOAT emSize, FLOAT ppdip,
DWRITE_MATRIX const *m, BOOL use_gdi_natural, UINT16 const *glyphs, UINT32 glyph_count,
DWRITE_GLYPH_METRICS *metrics, BOOL is_sideways)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- UINT32 adjustment = fontface_get_horz_metric_adjustment(This);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+ UINT32 adjustment = fontface_get_horz_metric_adjustment(fontface);
DWRITE_MEASURING_MODE mode;
FLOAT scale, size;
HRESULT hr;
UINT32 i;
- TRACE("(%p)->(%.2f %.2f %p %d %p %u %p %d)\n", This, emSize, ppdip, m, use_gdi_natural, glyphs,
+ TRACE("%p, %.8e, %.8e, %p, %d, %p, %u, %p, %d.\n", iface, emSize, ppdip, m, use_gdi_natural, glyphs,
glyph_count, metrics, is_sideways);
if (m && memcmp(m, &identity, sizeof(*m)))
FIXME("transform is not supported, %s\n", debugstr_matrix(m));
size = emSize * ppdip;
- scale = size / This->metrics.designUnitsPerEm;
+ scale = size / fontface->metrics.designUnitsPerEm;
mode = use_gdi_natural ? DWRITE_MEASURING_MODE_GDI_NATURAL : DWRITE_MEASURING_MODE_GDI_CLASSIC;
for (i = 0; i < glyph_count; i++) {
@@ -805,15 +821,15 @@ static HRESULT WINAPI dwritefontface_GetGdiCompatibleGlyphMetrics(IDWriteFontFac
DWRITE_GLYPH_METRICS design;
BOOL has_contours;
- hr = IDWriteFontFace4_GetDesignGlyphMetrics(iface, glyphs + i, 1, &design, is_sideways);
+ hr = IDWriteFontFace5_GetDesignGlyphMetrics(iface, glyphs + i, 1, &design, is_sideways);
if (FAILED(hr))
return hr;
ret->advanceWidth = freetype_get_glyph_advance(iface, size, glyphs[i], mode, &has_contours);
if (has_contours)
- ret->advanceWidth = round_metric(ret->advanceWidth * This->metrics.designUnitsPerEm / size + adjustment);
+ ret->advanceWidth = round_metric(ret->advanceWidth * fontface->metrics.designUnitsPerEm / size + adjustment);
else
- ret->advanceWidth = round_metric(ret->advanceWidth * This->metrics.designUnitsPerEm / size);
+ ret->advanceWidth = round_metric(ret->advanceWidth * fontface->metrics.designUnitsPerEm / size);
#define SCALE_METRIC(x) ret->x = round_metric(round_metric((design.x) * scale) / scale)
SCALE_METRIC(leftSideBearing);
@@ -828,22 +844,24 @@ static HRESULT WINAPI dwritefontface_GetGdiCompatibleGlyphMetrics(IDWriteFontFac
return S_OK;
}
-static void WINAPI dwritefontface1_GetMetrics(IDWriteFontFace4 *iface, DWRITE_FONT_METRICS1 *metrics)
+static void WINAPI dwritefontface1_GetMetrics(IDWriteFontFace5 *iface, DWRITE_FONT_METRICS1 *metrics)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)->(%p)\n", This, metrics);
- *metrics = This->metrics;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p, %p.\n", iface, metrics);
+
+ *metrics = fontface->metrics;
}
-static HRESULT WINAPI dwritefontface1_GetGdiCompatibleMetrics(IDWriteFontFace4 *iface, FLOAT em_size, FLOAT pixels_per_dip,
- const DWRITE_MATRIX *m, DWRITE_FONT_METRICS1 *metrics)
+static HRESULT WINAPI dwritefontface1_GetGdiCompatibleMetrics(IDWriteFontFace5 *iface, FLOAT em_size,
+ FLOAT pixels_per_dip, const DWRITE_MATRIX *m, DWRITE_FONT_METRICS1 *metrics)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- const DWRITE_FONT_METRICS1 *design = &This->metrics;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+ const DWRITE_FONT_METRICS1 *design = &fontface->metrics;
UINT16 ascent, descent;
FLOAT scale;
- TRACE("(%p)->(%.2f %.2f %p %p)\n", This, em_size, pixels_per_dip, m, metrics);
+ TRACE("%p, %.8e, %.8e, %p, %p.\n", iface, em_size, pixels_per_dip, m, metrics);
if (em_size <= 0.0f || pixels_per_dip <= 0.0f) {
memset(metrics, 0, sizeof(*metrics));
@@ -855,7 +873,8 @@ static HRESULT WINAPI dwritefontface1_GetGdiCompatibleMetrics(IDWriteFontFace4 *
em_size *= fabs(m->m22);
scale = em_size / design->designUnitsPerEm;
- if (!opentype_get_vdmx_size(get_fontface_vdmx(This), em_size, &ascent, &descent)) {
+ if (!opentype_get_vdmx_size(get_fontface_vdmx(fontface), em_size, &ascent, &descent))
+ {
ascent = round_metric(design->ascent * scale);
descent = round_metric(design->descent * scale);
}
@@ -891,33 +910,37 @@ static HRESULT WINAPI dwritefontface1_GetGdiCompatibleMetrics(IDWriteFontFace4 *
return S_OK;
}
-static void WINAPI dwritefontface1_GetCaretMetrics(IDWriteFontFace4 *iface, DWRITE_CARET_METRICS *metrics)
+static void WINAPI dwritefontface1_GetCaretMetrics(IDWriteFontFace5 *iface, DWRITE_CARET_METRICS *metrics)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)->(%p)\n", This, metrics);
- *metrics = This->caret;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p, %p.\n", iface, metrics);
+
+ *metrics = fontface->caret;
}
-static HRESULT WINAPI dwritefontface1_GetUnicodeRanges(IDWriteFontFace4 *iface, UINT32 max_count,
+static HRESULT WINAPI dwritefontface1_GetUnicodeRanges(IDWriteFontFace5 *iface, UINT32 max_count,
DWRITE_UNICODE_RANGE *ranges, UINT32 *count)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
- TRACE("(%p)->(%u %p %p)\n", This, max_count, ranges, count);
+ TRACE("%p, %u, %p, %p.\n", iface, max_count, ranges, count);
*count = 0;
if (max_count && !ranges)
return E_INVALIDARG;
- get_fontface_table(iface, MS_CMAP_TAG, &This->cmap);
- return opentype_cmap_get_unicode_ranges(&This->cmap, max_count, ranges, count);
+ get_fontface_table(iface, MS_CMAP_TAG, &fontface->cmap);
+ return opentype_cmap_get_unicode_ranges(&fontface->cmap, max_count, ranges, count);
}
-static BOOL WINAPI dwritefontface1_IsMonospacedFont(IDWriteFontFace4 *iface)
+static BOOL WINAPI dwritefontface1_IsMonospacedFont(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return !!(This->flags & FONTFACE_IS_MONOSPACED);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return !!(fontface->flags & FONTFACE_IS_MONOSPACED);
}
static int fontface_get_design_advance(struct dwrite_fontface *fontface, DWRITE_MEASURING_MODE measuring_mode,
@@ -933,7 +956,7 @@ static int fontface_get_design_advance(struct dwrite_fontface *fontface, DWRITE_
switch (measuring_mode)
{
case DWRITE_MEASURING_MODE_NATURAL:
- advance = freetype_get_glyph_advance(&fontface->IDWriteFontFace4_iface, fontface->metrics.designUnitsPerEm,
+ advance = freetype_get_glyph_advance(&fontface->IDWriteFontFace5_iface, fontface->metrics.designUnitsPerEm,
glyph, measuring_mode, &has_contours);
if (has_contours)
advance += adjustment;
@@ -948,7 +971,7 @@ static int fontface_get_design_advance(struct dwrite_fontface *fontface, DWRITE_
if (transform && memcmp(transform, &identity, sizeof(*transform)))
FIXME("Transform is not supported.\n");
- advance = freetype_get_glyph_advance(&fontface->IDWriteFontFace4_iface, emsize, glyph, measuring_mode,
+ advance = freetype_get_glyph_advance(&fontface->IDWriteFontFace5_iface, emsize, glyph, measuring_mode,
&has_contours);
if (has_contours)
advance = round_metric(advance * fontface->metrics.designUnitsPerEm / emsize + adjustment);
@@ -962,35 +985,35 @@ static int fontface_get_design_advance(struct dwrite_fontface *fontface, DWRITE_
}
}
-static HRESULT WINAPI dwritefontface1_GetDesignGlyphAdvances(IDWriteFontFace4 *iface,
+static HRESULT WINAPI dwritefontface1_GetDesignGlyphAdvances(IDWriteFontFace5 *iface,
UINT32 glyph_count, UINT16 const *glyphs, INT32 *advances, BOOL is_sideways)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
unsigned int i;
- TRACE("(%p)->(%u %p %p %d)\n", This, glyph_count, glyphs, advances, is_sideways);
+ TRACE("%p, %u, %p, %p, %d.\n", iface, glyph_count, glyphs, advances, is_sideways);
if (is_sideways)
FIXME("sideways mode not supported\n");
for (i = 0; i < glyph_count; ++i)
{
- advances[i] = fontface_get_design_advance(This, DWRITE_MEASURING_MODE_NATURAL, This->metrics.designUnitsPerEm,
- 1.0f, NULL, glyphs[i], is_sideways);
+ advances[i] = fontface_get_design_advance(fontface, DWRITE_MEASURING_MODE_NATURAL,
+ fontface->metrics.designUnitsPerEm, 1.0f, NULL, glyphs[i], is_sideways);
}
return S_OK;
}
-static HRESULT WINAPI dwritefontface1_GetGdiCompatibleGlyphAdvances(IDWriteFontFace4 *iface,
+static HRESULT WINAPI dwritefontface1_GetGdiCompatibleGlyphAdvances(IDWriteFontFace5 *iface,
float em_size, float ppdip, const DWRITE_MATRIX *transform, BOOL use_gdi_natural,
BOOL is_sideways, UINT32 glyph_count, UINT16 const *glyphs, INT32 *advances)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
DWRITE_MEASURING_MODE measuring_mode;
UINT32 i;
- TRACE("(%p)->(%.2f %.2f %p %d %d %u %p %p)\n", This, em_size, ppdip, transform,
+ TRACE("%p, %.8e, %.8e, %p, %d, %d, %u, %p, %p.\n", iface, em_size, ppdip, transform,
use_gdi_natural, is_sideways, glyph_count, glyphs, advances);
if (em_size < 0.0f || ppdip <= 0.0f) {
@@ -1006,20 +1029,20 @@ static HRESULT WINAPI dwritefontface1_GetGdiCompatibleGlyphAdvances(IDWriteFontF
measuring_mode = use_gdi_natural ? DWRITE_MEASURING_MODE_GDI_NATURAL : DWRITE_MEASURING_MODE_GDI_CLASSIC;
for (i = 0; i < glyph_count; ++i)
{
- advances[i] = fontface_get_design_advance(This, measuring_mode, em_size, ppdip, transform,
+ advances[i] = fontface_get_design_advance(fontface, measuring_mode, em_size, ppdip, transform,
glyphs[i], is_sideways);
}
return S_OK;
}
-static HRESULT WINAPI dwritefontface1_GetKerningPairAdjustments(IDWriteFontFace4 *iface, UINT32 count,
+static HRESULT WINAPI dwritefontface1_GetKerningPairAdjustments(IDWriteFontFace5 *iface, UINT32 count,
const UINT16 *indices, INT32 *adjustments)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
UINT32 i;
- TRACE("(%p)->(%u %p %p)\n", This, count, indices, adjustments);
+ TRACE("%p, %u, %p, %p.\n", iface, count, indices, adjustments);
if (!(indices || adjustments) || !count)
return E_INVALIDARG;
@@ -1029,7 +1052,8 @@ static HRESULT WINAPI dwritefontface1_GetKerningPairAdjustments(IDWriteFontFace4
return E_INVALIDARG;
}
- if (!(This->flags & FONTFACE_HAS_KERNING_PAIRS)) {
+ if (!(fontface->flags & FONTFACE_HAS_KERNING_PAIRS))
+ {
memset(adjustments, 0, count*sizeof(INT32));
return S_OK;
}
@@ -1041,76 +1065,88 @@ static HRESULT WINAPI dwritefontface1_GetKerningPairAdjustments(IDWriteFontFace4
return S_OK;
}
-static BOOL WINAPI dwritefontface1_HasKerningPairs(IDWriteFontFace4 *iface)
+static BOOL WINAPI dwritefontface1_HasKerningPairs(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return !!(This->flags & FONTFACE_HAS_KERNING_PAIRS);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return !!(fontface->flags & FONTFACE_HAS_KERNING_PAIRS);
}
-static HRESULT WINAPI dwritefontface1_GetRecommendedRenderingMode(IDWriteFontFace4 *iface,
+static HRESULT WINAPI dwritefontface1_GetRecommendedRenderingMode(IDWriteFontFace5 *iface,
FLOAT font_emsize, FLOAT dpiX, FLOAT dpiY, const DWRITE_MATRIX *transform, BOOL is_sideways,
DWRITE_OUTLINE_THRESHOLD threshold, DWRITE_MEASURING_MODE measuring_mode, DWRITE_RENDERING_MODE *rendering_mode)
{
DWRITE_GRID_FIT_MODE gridfitmode;
- return IDWriteFontFace2_GetRecommendedRenderingMode((IDWriteFontFace2*)iface, font_emsize, dpiX, dpiY, transform, is_sideways,
- threshold, measuring_mode, NULL, rendering_mode, &gridfitmode);
+ return IDWriteFontFace2_GetRecommendedRenderingMode((IDWriteFontFace2 *)iface, font_emsize, dpiX, dpiY, transform,
+ is_sideways, threshold, measuring_mode, NULL, rendering_mode, &gridfitmode);
}
-static HRESULT WINAPI dwritefontface1_GetVerticalGlyphVariants(IDWriteFontFace4 *iface, UINT32 glyph_count,
+static HRESULT WINAPI dwritefontface1_GetVerticalGlyphVariants(IDWriteFontFace5 *iface, UINT32 glyph_count,
const UINT16 *nominal_indices, UINT16 *vertical_indices)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%u %p %p): stub\n", This, glyph_count, nominal_indices, vertical_indices);
+ FIXME("%p, %u, %p, %p: stub\n", iface, glyph_count, nominal_indices, vertical_indices);
+
return E_NOTIMPL;
}
-static BOOL WINAPI dwritefontface1_HasVerticalGlyphVariants(IDWriteFontFace4 *iface)
+static BOOL WINAPI dwritefontface1_HasVerticalGlyphVariants(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return !!(This->flags & FONTFACE_HAS_VERTICAL_VARIANTS);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return !!(fontface->flags & FONTFACE_HAS_VERTICAL_VARIANTS);
}
-static BOOL WINAPI dwritefontface2_IsColorFont(IDWriteFontFace4 *iface)
+static BOOL WINAPI dwritefontface2_IsColorFont(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return get_fontface_cpal(This) && get_fontface_colr(This);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return get_fontface_cpal(fontface) && get_fontface_colr(fontface);
}
-static UINT32 WINAPI dwritefontface2_GetColorPaletteCount(IDWriteFontFace4 *iface)
+static UINT32 WINAPI dwritefontface2_GetColorPaletteCount(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return opentype_get_cpal_palettecount(get_fontface_cpal(This));
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return opentype_get_cpal_palettecount(get_fontface_cpal(fontface));
}
-static UINT32 WINAPI dwritefontface2_GetPaletteEntryCount(IDWriteFontFace4 *iface)
+static UINT32 WINAPI dwritefontface2_GetPaletteEntryCount(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return opentype_get_cpal_paletteentrycount(get_fontface_cpal(This));
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return opentype_get_cpal_paletteentrycount(get_fontface_cpal(fontface));
}
-static HRESULT WINAPI dwritefontface2_GetPaletteEntries(IDWriteFontFace4 *iface, UINT32 palette_index,
+static HRESULT WINAPI dwritefontface2_GetPaletteEntries(IDWriteFontFace5 *iface, UINT32 palette_index,
UINT32 first_entry_index, UINT32 entry_count, DWRITE_COLOR_F *entries)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)->(%u %u %u %p)\n", This, palette_index, first_entry_index, entry_count, entries);
- return opentype_get_cpal_entries(get_fontface_cpal(This), palette_index, first_entry_index, entry_count, entries);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p, %u, %u, %u, %p.\n", iface, palette_index, first_entry_index, entry_count, entries);
+
+ return opentype_get_cpal_entries(get_fontface_cpal(fontface), palette_index, first_entry_index, entry_count, entries);
}
-static HRESULT WINAPI dwritefontface2_GetRecommendedRenderingMode(IDWriteFontFace4 *iface, FLOAT emSize,
+static HRESULT WINAPI dwritefontface2_GetRecommendedRenderingMode(IDWriteFontFace5 *iface, FLOAT emSize,
FLOAT dpiX, FLOAT dpiY, DWRITE_MATRIX const *m, BOOL is_sideways, DWRITE_OUTLINE_THRESHOLD threshold,
DWRITE_MEASURING_MODE measuringmode, IDWriteRenderingParams *params, DWRITE_RENDERING_MODE *renderingmode,
DWRITE_GRID_FIT_MODE *gridfitmode)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
unsigned int flags;
FLOAT emthreshold;
- TRACE("(%p)->(%.2f %.2f %.2f %p %d %d %d %p %p %p)\n", This, emSize, dpiX, dpiY, m, is_sideways, threshold,
+ TRACE("%p, %.8e, %.8e, %.8e, %p, %d, %d, %d, %p, %p, %p.\n", iface, emSize, dpiX, dpiY, m, is_sideways, threshold,
measuringmode, params, renderingmode, gridfitmode);
if (m)
@@ -1139,7 +1175,7 @@ static HRESULT WINAPI dwritefontface2_GetRecommendedRenderingMode(IDWriteFontFac
emthreshold = threshold == DWRITE_OUTLINE_THRESHOLD_ANTIALIASED ? RECOMMENDED_OUTLINE_AA_THRESHOLD : RECOMMENDED_OUTLINE_A_THRESHOLD;
- flags = opentype_get_gasp_flags(get_fontface_gasp(This), emSize);
+ flags = opentype_get_gasp_flags(get_fontface_gasp(fontface), emSize);
if (*renderingmode == DWRITE_RENDERING_MODE_DEFAULT) {
if (emSize >= emthreshold)
@@ -1161,86 +1197,94 @@ static HRESULT WINAPI dwritefontface2_GetRecommendedRenderingMode(IDWriteFontFac
return S_OK;
}
-static HRESULT WINAPI dwritefontface3_GetFontFaceReference(IDWriteFontFace4 *iface, IDWriteFontFaceReference **ref)
+static HRESULT WINAPI dwritefontface3_GetFontFaceReference(IDWriteFontFace5 *iface, IDWriteFontFaceReference **ref)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%p): stub\n", This, ref);
+ FIXME("%p, %p: stub\n", iface, ref);
+
return E_NOTIMPL;
}
-static void WINAPI dwritefontface3_GetPanose(IDWriteFontFace4 *iface, DWRITE_PANOSE *panose)
+static void WINAPI dwritefontface3_GetPanose(IDWriteFontFace5 *iface, DWRITE_PANOSE *panose)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)->(%p)\n", This, panose);
- *panose = This->panose;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p, %p.\n", iface, panose);
+
+ *panose = fontface->panose;
}
-static DWRITE_FONT_WEIGHT WINAPI dwritefontface3_GetWeight(IDWriteFontFace4 *iface)
+static DWRITE_FONT_WEIGHT WINAPI dwritefontface3_GetWeight(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return This->weight;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return fontface->weight;
}
-static DWRITE_FONT_STRETCH WINAPI dwritefontface3_GetStretch(IDWriteFontFace4 *iface)
+static DWRITE_FONT_STRETCH WINAPI dwritefontface3_GetStretch(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return This->stretch;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return fontface->stretch;
}
-static DWRITE_FONT_STYLE WINAPI dwritefontface3_GetStyle(IDWriteFontFace4 *iface)
+static DWRITE_FONT_STYLE WINAPI dwritefontface3_GetStyle(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- TRACE("(%p)\n", This);
- return This->style;
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
+
+ TRACE("%p.\n", iface);
+
+ return fontface->style;
}
-static HRESULT WINAPI dwritefontface3_GetFamilyNames(IDWriteFontFace4 *iface, IDWriteLocalizedStrings **names)
+static HRESULT WINAPI dwritefontface3_GetFamilyNames(IDWriteFontFace5 *iface, IDWriteLocalizedStrings **names)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%p): stub\n", This, names);
+ FIXME("%p, %p: stub\n", iface, names);
+
return E_NOTIMPL;
}
-static HRESULT WINAPI dwritefontface3_GetFaceNames(IDWriteFontFace4 *iface, IDWriteLocalizedStrings **names)
+static HRESULT WINAPI dwritefontface3_GetFaceNames(IDWriteFontFace5 *iface, IDWriteLocalizedStrings **names)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%p): stub\n", This, names);
+ FIXME("%p, %p: stub\n", iface, names);
+
return E_NOTIMPL;
}
-static HRESULT WINAPI dwritefontface3_GetInformationalStrings(IDWriteFontFace4 *iface, DWRITE_INFORMATIONAL_STRING_ID stringid,
- IDWriteLocalizedStrings **strings, BOOL *exists)
+static HRESULT WINAPI dwritefontface3_GetInformationalStrings(IDWriteFontFace5 *iface,
+ DWRITE_INFORMATIONAL_STRING_ID stringid, IDWriteLocalizedStrings **strings, BOOL *exists)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%u %p %p): stub\n", This, stringid, strings, exists);
+ FIXME("%p, %u, %p, %p: stub\n", iface, stringid, strings, exists);
+
return E_NOTIMPL;
}
-static BOOL WINAPI dwritefontface3_HasCharacter(IDWriteFontFace4 *iface, UINT32 ch)
+static BOOL WINAPI dwritefontface3_HasCharacter(IDWriteFontFace5 *iface, UINT32 ch)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
UINT16 index;
- TRACE("(%p)->(%#x)\n", This, ch);
+ TRACE("%p, %#x.\n", iface, ch);
index = 0;
- if (FAILED(fontface_get_glyphs(This, &ch, 1, &index)))
+ if (FAILED(fontface_get_glyphs(fontface, &ch, 1, &index)))
return FALSE;
return index != 0;
}
-static HRESULT WINAPI dwritefontface3_GetRecommendedRenderingMode(IDWriteFontFace4 *iface, FLOAT emSize, FLOAT dpiX, FLOAT dpiY,
+static HRESULT WINAPI dwritefontface3_GetRecommendedRenderingMode(IDWriteFontFace5 *iface, FLOAT emSize, FLOAT dpiX, FLOAT dpiY,
DWRITE_MATRIX const *m, BOOL is_sideways, DWRITE_OUTLINE_THRESHOLD threshold, DWRITE_MEASURING_MODE measuring_mode,
IDWriteRenderingParams *params, DWRITE_RENDERING_MODE1 *rendering_mode, DWRITE_GRID_FIT_MODE *gridfit_mode)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
unsigned int flags;
FLOAT emthreshold;
- TRACE("(%p)->(%.2f %.2f %.2f %p %d %d %d %p %p %p)\n", This, emSize, dpiX, dpiY, m, is_sideways, threshold,
+ TRACE("%p, %.8e, %.8e, %.8e, %p, %d, %d, %d, %p, %p, %p.\n", iface, emSize, dpiX, dpiY, m, is_sideways, threshold,
measuring_mode, params, rendering_mode, gridfit_mode);
if (m)
@@ -1269,7 +1313,7 @@ static HRESULT WINAPI dwritefontface3_GetRecommendedRenderingMode(IDWriteFontFac
emthreshold = threshold == DWRITE_OUTLINE_THRESHOLD_ANTIALIASED ? RECOMMENDED_OUTLINE_AA_THRESHOLD : RECOMMENDED_OUTLINE_A_THRESHOLD;
- flags = opentype_get_gasp_flags(get_fontface_gasp(This), emSize);
+ flags = opentype_get_gasp_flags(get_fontface_gasp(fontface), emSize);
if (*rendering_mode == DWRITE_RENDERING_MODE1_DEFAULT) {
if (emSize >= emthreshold)
@@ -1291,68 +1335,97 @@ static HRESULT WINAPI dwritefontface3_GetRecommendedRenderingMode(IDWriteFontFac
return S_OK;
}
-static BOOL WINAPI dwritefontface3_IsCharacterLocal(IDWriteFontFace4 *iface, UINT32 ch)
+static BOOL WINAPI dwritefontface3_IsCharacterLocal(IDWriteFontFace5 *iface, UINT32 ch)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(0x%x): stub\n", This, ch);
+ FIXME("%p, %#x: stub\n", iface, ch);
+
return FALSE;
}
-static BOOL WINAPI dwritefontface3_IsGlyphLocal(IDWriteFontFace4 *iface, UINT16 glyph)
+static BOOL WINAPI dwritefontface3_IsGlyphLocal(IDWriteFontFace5 *iface, UINT16 glyph)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%u): stub\n", This, glyph);
+ FIXME("%p, %u: stub\n", iface, glyph);
+
return FALSE;
}
-static HRESULT WINAPI dwritefontface3_AreCharactersLocal(IDWriteFontFace4 *iface, WCHAR const *text,
+static HRESULT WINAPI dwritefontface3_AreCharactersLocal(IDWriteFontFace5 *iface, WCHAR const *text,
UINT32 count, BOOL enqueue_if_not, BOOL *are_local)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%s:%u %d %p): stub\n", This, debugstr_wn(text, count), count, enqueue_if_not, are_local);
+ FIXME("%p, %s:%u, %d %p: stub\n", iface, debugstr_wn(text, count), count, enqueue_if_not, are_local);
+
return E_NOTIMPL;
}
-static HRESULT WINAPI dwritefontface3_AreGlyphsLocal(IDWriteFontFace4 *iface, UINT16 const *glyphs,
+static HRESULT WINAPI dwritefontface3_AreGlyphsLocal(IDWriteFontFace5 *iface, UINT16 const *glyphs,
UINT32 count, BOOL enqueue_if_not, BOOL *are_local)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%p %u %d %p): stub\n", This, glyphs, count, enqueue_if_not, are_local);
+ FIXME("%p, %p, %u, %d, %p: stub\n", iface, glyphs, count, enqueue_if_not, are_local);
+
return E_NOTIMPL;
}
-static HRESULT WINAPI dwritefontface4_GetGlyphImageFormats_(IDWriteFontFace4 *iface, UINT16 glyph,
+static HRESULT WINAPI dwritefontface4_GetGlyphImageFormats_(IDWriteFontFace5 *iface, UINT16 glyph,
UINT32 ppem_first, UINT32 ppem_last, DWRITE_GLYPH_IMAGE_FORMATS *formats)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%u %u %u %p): stub\n", This, glyph, ppem_first, ppem_last, formats);
+ FIXME("%p, %u, %u, %u, %p: stub\n", iface, glyph, ppem_first, ppem_last, formats);
+
return E_NOTIMPL;
}
-static DWRITE_GLYPH_IMAGE_FORMATS WINAPI dwritefontface4_GetGlyphImageFormats(IDWriteFontFace4 *iface)
+static DWRITE_GLYPH_IMAGE_FORMATS WINAPI dwritefontface4_GetGlyphImageFormats(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
+ struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
- TRACE("(%p)\n", This);
+ TRACE("%p.\n", iface);
- return This->glyph_image_formats;
+ return fontface->glyph_image_formats;
}
-static HRESULT WINAPI dwritefontface4_GetGlyphImageData(IDWriteFontFace4 *iface, UINT16 glyph,
+static HRESULT WINAPI dwritefontface4_GetGlyphImageData(IDWriteFontFace5 *iface, UINT16 glyph,
UINT32 ppem, DWRITE_GLYPH_IMAGE_FORMATS format, DWRITE_GLYPH_IMAGE_DATA *data, void **context)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%u %u %d %p %p): stub\n", This, glyph, ppem, format, data, context);
+ FIXME("%p, %u, %u, %d, %p, %p: stub\n", iface, glyph, ppem, format, data, context);
+
+ return E_NOTIMPL;
+}
+
+static void WINAPI dwritefontface4_ReleaseGlyphImageData(IDWriteFontFace5 *iface, void *context)
+{
+ FIXME("%p, %p: stub\n", iface, context);
+}
+
+static UINT32 WINAPI dwritefontface5_GetFontAxisValueCount(IDWriteFontFace5 *iface)
+{
+ FIXME("%p: stub\n", iface);
+
+ return 0;
+}
+
+static HRESULT WINAPI dwritefontface5_GetFontAxisValues(IDWriteFontFace5 *iface, DWRITE_FONT_AXIS_VALUE *axis_values,
+ UINT32 value_count)
+{
+ FIXME("%p, %p, %u: stub\n", iface, axis_values, value_count);
+
return E_NOTIMPL;
}
-static void WINAPI dwritefontface4_ReleaseGlyphImageData(IDWriteFontFace4 *iface, void *context)
+static BOOL WINAPI dwritefontface5_HasVariantions(IDWriteFontFace5 *iface)
{
- struct dwrite_fontface *This = impl_from_IDWriteFontFace4(iface);
- FIXME("(%p)->(%p): stub\n", This, context);
+ FIXME("%p: stub\n", iface);
+
+ return FALSE;
}
-static const IDWriteFontFace4Vtbl dwritefontfacevtbl = {
+static HRESULT WINAPI dwritefontface5_GetFontResource(IDWriteFontFace5 *iface, IDWriteFontResource **resource)
+{
+ FIXME("%p, %p: stub\n", iface, resource);
+
+ return E_NOTIMPL;
+}
+
+static const IDWriteFontFace5Vtbl dwritefontfacevtbl =
+{
dwritefontface_QueryInterface,
dwritefontface_AddRef,
dwritefontface_Release,
@@ -1405,10 +1478,14 @@ static const IDWriteFontFace4Vtbl dwritefontfacevtbl = {
dwritefontface4_GetGlyphImageFormats_,
dwritefontface4_GetGlyphImageFormats,
dwritefontface4_GetGlyphImageData,
- dwritefontface4_ReleaseGlyphImageData
+ dwritefontface4_ReleaseGlyphImageData,
+ dwritefontface5_GetFontAxisValueCount,
+ dwritefontface5_GetFontAxisValues,
+ dwritefontface5_HasVariantions,
+ dwritefontface5_GetFontResource,
};
-static HRESULT get_fontface_from_font(struct dwrite_font *font, IDWriteFontFace4 **fontface)
+static HRESULT get_fontface_from_font(struct dwrite_font *font, IDWriteFontFace5 **fontface)
{
struct dwrite_font_data *data = font->data;
struct fontface_desc desc;
@@ -1518,19 +1595,19 @@ static DWRITE_FONT_STYLE WINAPI dwritefont_GetStyle(IDWriteFont3 *iface)
static BOOL WINAPI dwritefont_IsSymbolFont(IDWriteFont3 *iface)
{
- struct dwrite_font *This = impl_from_IDWriteFont3(iface);
- IDWriteFontFace4 *fontface;
+ struct dwrite_font *font = impl_from_IDWriteFont3(iface);
+ IDWriteFontFace5 *fontface;
HRESULT hr;
BOOL ret;
- TRACE("(%p)\n", This);
+ TRACE("%p.\n", iface);
- hr = get_fontface_from_font(This, &fontface);
+ hr = get_fontface_from_font(font, &fontface);
if (FAILED(hr))
return FALSE;
- ret = IDWriteFontFace4_IsSymbolFont(fontface);
- IDWriteFontFace4_Release(fontface);
+ ret = IDWriteFontFace5_IsSymbolFont(fontface);
+ IDWriteFontFace5_Release(fontface);
return ret;
}
@@ -1544,11 +1621,11 @@ static HRESULT WINAPI dwritefont_GetFaceNames(IDWriteFont3 *iface, IDWriteLocali
static HRESULT WINAPI dwritefont_GetInformationalStrings(IDWriteFont3 *iface,
DWRITE_INFORMATIONAL_STRING_ID stringid, IDWriteLocalizedStrings **strings, BOOL *exists)
{
- struct dwrite_font *This = impl_from_IDWriteFont3(iface);
- struct dwrite_font_data *data = This->data;
+ struct dwrite_font *font = impl_from_IDWriteFont3(iface);
+ struct dwrite_font_data *data = font->data;
HRESULT hr;
- TRACE("(%p)->(%d %p %p)\n", This, stringid, strings, exists);
+ TRACE("%p, %d, %p, %p.\n", iface, stringid, strings, exists);
*exists = FALSE;
*strings = NULL;
@@ -1556,29 +1633,31 @@ static HRESULT WINAPI dwritefont_GetInformationalStrings(IDWriteFont3 *iface,
if (stringid > DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME || stringid == DWRITE_INFORMATIONAL_STRING_NONE)
return S_OK;
- if (!data->info_strings[stringid]) {
- IDWriteFontFace4 *fontface;
+ if (!data->info_strings[stringid])
+ {
+ IDWriteFontFace5 *fontface;
const void *table_data;
BOOL table_exists;
void *context;
UINT32 size;
- hr = get_fontface_from_font(This, &fontface);
+ hr = get_fontface_from_font(font, &fontface);
if (FAILED(hr))
return hr;
table_exists = FALSE;
- hr = IDWriteFontFace4_TryGetFontTable(fontface, MS_NAME_TAG, &table_data, &size, &context, &table_exists);
+ hr = IDWriteFontFace5_TryGetFontTable(fontface, MS_NAME_TAG, &table_data, &size, &context, &table_exists);
if (FAILED(hr) || !table_exists)
WARN("no NAME table found.\n");
- if (table_exists) {
+ if (table_exists)
+ {
hr = opentype_get_font_info_strings(table_data, stringid, &data->info_strings[stringid]);
- IDWriteFontFace4_ReleaseFontTable(fontface, context);
+ IDWriteFontFace5_ReleaseFontTable(fontface, context);
if (FAILED(hr) || !data->info_strings[stringid])
return hr;
}
- IDWriteFontFace4_Release(fontface);
+ IDWriteFontFace5_Release(fontface);
}
hr = clone_localizedstring(data->info_strings[stringid], strings);
@@ -1606,7 +1685,7 @@ static void WINAPI dwritefont_GetMetrics(IDWriteFont3 *iface, DWRITE_FONT_METRIC
static HRESULT font_has_character(struct dwrite_font *font, UINT32 ch, BOOL *exists)
{
- IDWriteFontFace4 *fontface;
+ IDWriteFontFace5 *fontface;
UINT16 index;
HRESULT hr;
@@ -1617,8 +1696,8 @@ static HRESULT font_has_character(struct dwrite_font *font, UINT32 ch, BOOL *exi
return hr;
index = 0;
- hr = IDWriteFontFace4_GetGlyphIndices(fontface, &ch, 1, &index);
- IDWriteFontFace4_Release(fontface);
+ hr = IDWriteFontFace5_GetGlyphIndices(fontface, &ch, 1, &index);
+ IDWriteFontFace5_Release(fontface);
if (FAILED(hr))
return hr;
@@ -1637,9 +1716,11 @@ static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont3 *iface, UINT32 ch, BO
static HRESULT WINAPI dwritefont_CreateFontFace(IDWriteFont3 *iface, IDWriteFontFace **fontface)
{
- struct dwrite_font *This = impl_from_IDWriteFont3(iface);
- TRACE("(%p)->(%p)\n", This, fontface);
- return get_fontface_from_font(This, (IDWriteFontFace4 **)fontface);
+ struct dwrite_font *font = impl_from_IDWriteFont3(iface);
+
+ TRACE("%p, %p.\n", iface, fontface);
+
+ return get_fontface_from_font(font, (IDWriteFontFace5 **)fontface);
}
static void WINAPI dwritefont1_GetMetrics(IDWriteFont3 *iface, DWRITE_FONT_METRICS1 *metrics)
@@ -1658,64 +1739,64 @@ static void WINAPI dwritefont1_GetPanose(IDWriteFont3 *iface, DWRITE_PANOSE *pan
static HRESULT WINAPI dwritefont1_GetUnicodeRanges(IDWriteFont3 *iface, UINT32 max_count, DWRITE_UNICODE_RANGE *ranges, UINT32 *count)
{
- struct dwrite_font *This = impl_from_IDWriteFont3(iface);
- IDWriteFontFace4 *fontface;
+ struct dwrite_font *font = impl_from_IDWriteFont3(iface);
+ IDWriteFontFace5 *fontface;
HRESULT hr;
- TRACE("(%p)->(%u %p %p)\n", This, max_count, ranges, count);
+ TRACE("%p, %u, %p, %p.\n", iface, max_count, ranges, count);
- hr = get_fontface_from_font(This, &fontface);
+ hr = get_fontface_from_font(font, &fontface);
if (FAILED(hr))
return hr;
- hr = IDWriteFontFace4_GetUnicodeRanges(fontface, max_count, ranges, count);
- IDWriteFontFace4_Release(fontface);
+ hr = IDWriteFontFace5_GetUnicodeRanges(fontface, max_count, ranges, count);
+ IDWriteFontFace5_Release(fontface);
return hr;
}
static BOOL WINAPI dwritefont1_IsMonospacedFont(IDWriteFont3 *iface)
{
- struct dwrite_font *This = impl_from_IDWriteFont3(iface);
- IDWriteFontFace4 *fontface;
+ struct dwrite_font *font = impl_from_IDWriteFont3(iface);
+ IDWriteFontFace5 *fontface;
HRESULT hr;
BOOL ret;
- TRACE("(%p)\n", This);
+ TRACE("%p.\n", iface);
- hr = get_fontface_from_font(This, &fontface);
+ hr = get_fontface_from_font(font, &fontface);
if (FAILED(hr))
return FALSE;
- ret = IDWriteFontFace4_IsMonospacedFont(fontface);
- IDWriteFontFace4_Release(fontface);
+ ret = IDWriteFontFace5_IsMonospacedFont(fontface);
+ IDWriteFontFace5_Release(fontface);
return ret;
}
static BOOL WINAPI dwritefont2_IsColorFont(IDWriteFont3 *iface)
{
- struct dwrite_font *This = impl_from_IDWriteFont3(iface);
- IDWriteFontFace4 *fontface;
+ struct dwrite_font *font = impl_from_IDWriteFont3(iface);
+ IDWriteFontFace5 *fontface;
HRESULT hr;
BOOL ret;
- TRACE("(%p)\n", This);
+ TRACE("%p.\n", iface);
- hr = get_fontface_from_font(This, &fontface);
+ hr = get_fontface_from_font(font, &fontface);
if (FAILED(hr))
return FALSE;
- ret = IDWriteFontFace4_IsColorFont(fontface);
- IDWriteFontFace4_Release(fontface);
+ ret = IDWriteFontFace5_IsColorFont(fontface);
+ IDWriteFontFace5_Release(fontface);
return ret;
}
static HRESULT WINAPI dwritefont3_CreateFontFace(IDWriteFont3 *iface, IDWriteFontFace3 **fontface)
{
- struct dwrite_font *This = impl_from_IDWriteFont3(iface);
+ struct dwrite_font *font = impl_from_IDWriteFont3(iface);
- TRACE("(%p)->(%p)\n", This, fontface);
+ TRACE("%p, %p.\n", iface, fontface);
- return get_fontface_from_font(This, (IDWriteFontFace4 **)fontface);
+ return get_fontface_from_font(font, (IDWriteFontFace5 **)fontface);
}
static BOOL WINAPI dwritefont3_Equals(IDWriteFont3 *iface, IDWriteFont *font)
@@ -1792,7 +1873,7 @@ struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
if (!iface)
return NULL;
assert(iface->lpVtbl == (IDWriteFontFaceVtbl*)&dwritefontfacevtbl);
- return CONTAINING_RECORD(iface, struct dwrite_fontface, IDWriteFontFace4_iface);
+ return CONTAINING_RECORD(iface, struct dwrite_fontface, IDWriteFontFace5_iface);
}
void get_logfont_from_font(IDWriteFont *iface, LOGFONTW *lf)
@@ -4532,7 +4613,7 @@ HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_ke
return S_OK;
}
-HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_list, IDWriteFontFace4 **ret)
+HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_list, IDWriteFontFace5 **ret)
{
struct file_stream_desc stream_desc;
struct dwrite_fontface *fontface;
@@ -4552,8 +4633,8 @@ HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_li
return E_OUTOFMEMORY;
}
- fontface->IDWriteFontFace4_iface.lpVtbl = &dwritefontfacevtbl;
- fontface->ref = 1;
+ fontface->IDWriteFontFace5_iface.lpVtbl = &dwritefontfacevtbl;
+ fontface->refcount = 1;
fontface->type = desc->face_type;
fontface->file_count = desc->files_number;
fontface->cmap.exists = TRUE;
@@ -4585,16 +4666,16 @@ HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_li
}
}
- fontface->charmap = freetype_get_charmap_index(&fontface->IDWriteFontFace4_iface, &is_symbol);
+ fontface->charmap = freetype_get_charmap_index(&fontface->IDWriteFontFace5_iface, &is_symbol);
if (is_symbol)
fontface->flags |= FONTFACE_IS_SYMBOL;
- if (freetype_has_kerning_pairs(&fontface->IDWriteFontFace4_iface))
+ if (freetype_has_kerning_pairs(&fontface->IDWriteFontFace5_iface))
fontface->flags |= FONTFACE_HAS_KERNING_PAIRS;
- if (freetype_is_monospaced(&fontface->IDWriteFontFace4_iface))
+ if (freetype_is_monospaced(&fontface->IDWriteFontFace5_iface))
fontface->flags |= FONTFACE_IS_MONOSPACED;
- if (opentype_has_vertical_variants(&fontface->IDWriteFontFace4_iface))
+ if (opentype_has_vertical_variants(&fontface->IDWriteFontFace5_iface))
fontface->flags |= FONTFACE_HAS_VERTICAL_VARIANTS;
- fontface->glyph_image_formats = opentype_get_glyph_image_formats(&fontface->IDWriteFontFace4_iface);
+ fontface->glyph_image_formats = opentype_get_glyph_image_formats(&fontface->IDWriteFontFace5_iface);
/* Font properties are reused from font object when 'normal' face creation path is used:
collection -> family -> matching font -> fontface.
@@ -4614,8 +4695,9 @@ HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_li
struct dwrite_font_data *data;
hr = init_font_data(desc, &names, &data);
- if (FAILED(hr)) {
- IDWriteFontFace4_Release(&fontface->IDWriteFontFace4_iface);
+ if (FAILED(hr))
+ {
+ IDWriteFontFace5_Release(&fontface->IDWriteFontFace5_iface);
return hr;
}
@@ -4630,9 +4712,10 @@ HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_li
release_font_data(data);
}
- fontface->cached = factory_cache_fontface(fontface->factory, cached_list, &fontface->IDWriteFontFace4_iface);
+ fontface->cached = factory_cache_fontface(fontface->factory, cached_list, &fontface->IDWriteFontFace5_iface);
+
+ *ret = &fontface->IDWriteFontFace5_iface;
- *ret = &fontface->IDWriteFontFace4_iface;
return S_OK;
}
@@ -5670,8 +5753,8 @@ static ULONG WINAPI colorglyphenum_Release(IDWriteColorGlyphRunEnumerator1 *ifac
heap_free(glyphenum->glyphindices);
heap_free(glyphenum->glyphs);
if (glyphenum->colr.context)
- IDWriteFontFace4_ReleaseFontTable(glyphenum->fontface, glyphenum->colr.context);
- IDWriteFontFace4_Release(glyphenum->fontface);
+ IDWriteFontFace5_ReleaseFontTable(glyphenum->fontface, glyphenum->colr.context);
+ IDWriteFontFace5_Release(glyphenum->fontface);
heap_free(glyphenum);
}
@@ -5744,9 +5827,10 @@ static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphen
colorrun->paletteIndex = glyphenum->glyphs[g].palette_index;
/* use foreground color or request one from the font */
memset(&colorrun->runColor, 0, sizeof(colorrun->runColor));
- if (colorrun->paletteIndex != 0xffff) {
- HRESULT hr = IDWriteFontFace4_GetPaletteEntries(glyphenum->fontface, glyphenum->palette, colorrun->paletteIndex,
- 1, &colorrun->runColor);
+ if (colorrun->paletteIndex != 0xffff)
+ {
+ HRESULT hr = IDWriteFontFace5_GetPaletteEntries(glyphenum->fontface, glyphenum->palette,
+ colorrun->paletteIndex, 1, &colorrun->runColor);
if (FAILED(hr))
WARN("failed to get palette entry, fontface %p, palette %u, index %u, 0x%08x\n", glyphenum->fontface,
glyphenum->palette, colorrun->paletteIndex, hr);
@@ -5857,8 +5941,8 @@ HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_R
fontface = unsafe_impl_from_IDWriteFontFace(run->fontFace);
- colorfont = IDWriteFontFace4_IsColorFont(&fontface->IDWriteFontFace4_iface) &&
- IDWriteFontFace4_GetColorPaletteCount(&fontface->IDWriteFontFace4_iface) > palette;
+ colorfont = IDWriteFontFace5_IsColorFont(&fontface->IDWriteFontFace5_iface) &&
+ IDWriteFontFace5_GetColorPaletteCount(&fontface->IDWriteFontFace5_iface) > palette;
if (!colorfont)
return DWRITE_E_NOCOLOR;
@@ -5870,8 +5954,8 @@ HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_R
colorglyphenum->refcount = 1;
colorglyphenum->origin_x = originX;
colorglyphenum->origin_y = originY;
- colorglyphenum->fontface = &fontface->IDWriteFontFace4_iface;
- IDWriteFontFace4_AddRef(colorglyphenum->fontface);
+ colorglyphenum->fontface = &fontface->IDWriteFontFace5_iface;
+ IDWriteFontFace5_AddRef(colorglyphenum->fontface);
colorglyphenum->glyphs = NULL;
colorglyphenum->run = *run;
colorglyphenum->run.glyphIndices = NULL;
@@ -5880,7 +5964,7 @@ HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_R
colorglyphenum->palette = palette;
memset(&colorglyphenum->colr, 0, sizeof(colorglyphenum->colr));
colorglyphenum->colr.exists = TRUE;
- get_fontface_table(&fontface->IDWriteFontFace4_iface, MS_COLR_TAG, &colorglyphenum->colr);
+ get_fontface_table(&fontface->IDWriteFontFace5_iface, MS_COLR_TAG, &colorglyphenum->colr);
colorglyphenum->current_layer = 0;
colorglyphenum->max_layer_num = 0;
diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c
index 16317036e3..ffc97f1d8a 100644
--- a/dlls/dwrite/freetype.c
+++ b/dlls/dwrite/freetype.c
@@ -256,7 +256,7 @@ void release_freetype(void)
pFT_Done_FreeType(library);
}
-void freetype_notify_cacheremove(IDWriteFontFace4 *fontface)
+void freetype_notify_cacheremove(IDWriteFontFace5 *fontface)
{
EnterCriticalSection(&freetype_cs);
pFTC_Manager_RemoveFaceID(cache_manager, fontface);
@@ -268,7 +268,7 @@ HRESULT freetype_get_design_glyph_metrics(struct dwrite_fontface *fontface, UINT
FTC_ScalerRec scaler;
FT_Size size;
- scaler.face_id = &fontface->IDWriteFontFace4_iface;
+ scaler.face_id = &fontface->IDWriteFontFace5_iface;
scaler.width = fontface->metrics.designUnitsPerEm;
scaler.height = fontface->metrics.designUnitsPerEm;
scaler.pixel = 1;
@@ -303,7 +303,7 @@ HRESULT freetype_get_design_glyph_metrics(struct dwrite_fontface *fontface, UINT
return S_OK;
}
-BOOL freetype_is_monospaced(IDWriteFontFace4 *fontface)
+BOOL freetype_is_monospaced(IDWriteFontFace5 *fontface)
{
BOOL is_monospaced = FALSE;
FT_Face face;
@@ -484,7 +484,7 @@ static void embolden_glyph(FT_Glyph glyph, FLOAT emsize)
embolden_glyph_outline(&outline_glyph->outline, emsize);
}
-HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, float emSize, UINT16 const *glyphs,
+HRESULT freetype_get_glyphrun_outline(IDWriteFontFace5 *fontface, float emSize, UINT16 const *glyphs,
float const *advances, DWRITE_GLYPH_OFFSET const *offsets, unsigned int count, BOOL is_rtl,
IDWriteGeometrySink *sink)
{
@@ -498,7 +498,7 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, float emSize,
ID2D1SimplifiedGeometrySink_SetFillMode(sink, D2D1_FILL_MODE_WINDING);
- simulations = IDWriteFontFace4_GetSimulations(fontface);
+ simulations = IDWriteFontFace5_GetSimulations(fontface);
scaler.face_id = fontface;
scaler.width = emSize;
@@ -563,7 +563,7 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, float emSize,
return hr;
}
-UINT16 freetype_get_glyphcount(IDWriteFontFace4 *fontface)
+UINT16 freetype_get_glyphcount(IDWriteFontFace5 *fontface)
{
UINT16 count = 0;
FT_Face face;
@@ -576,7 +576,7 @@ UINT16 freetype_get_glyphcount(IDWriteFontFace4 *fontface)
return count;
}
-void freetype_get_glyphs(IDWriteFontFace4 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
+void freetype_get_glyphs(IDWriteFontFace5 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
UINT16 *glyphs)
{
UINT32 i;
@@ -597,7 +597,7 @@ void freetype_get_glyphs(IDWriteFontFace4 *fontface, INT charmap, UINT32 const *
LeaveCriticalSection(&freetype_cs);
}
-BOOL freetype_has_kerning_pairs(IDWriteFontFace4 *fontface)
+BOOL freetype_has_kerning_pairs(IDWriteFontFace5 *fontface)
{
BOOL has_kerning_pairs = FALSE;
FT_Face face;
@@ -610,7 +610,7 @@ BOOL freetype_has_kerning_pairs(IDWriteFontFace4 *fontface)
return has_kerning_pairs;
}
-INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace4 *fontface, UINT16 left, UINT16 right)
+INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace5 *fontface, UINT16 left, UINT16 right)
{
INT32 adjustment = 0;
FT_Face face;
@@ -855,7 +855,7 @@ BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
return ret;
}
-INT freetype_get_charmap_index(IDWriteFontFace4 *fontface, BOOL *is_symbol)
+INT freetype_get_charmap_index(IDWriteFontFace5 *fontface, BOOL *is_symbol)
{
INT charmap_index = -1;
FT_Face face;
@@ -887,7 +887,7 @@ INT freetype_get_charmap_index(IDWriteFontFace4 *fontface, BOOL *is_symbol)
return charmap_index;
}
-INT32 freetype_get_glyph_advance(IDWriteFontFace4 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode,
+INT32 freetype_get_glyph_advance(IDWriteFontFace5 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode,
BOOL *has_contours)
{
FTC_ImageTypeRec imagetype;
@@ -926,7 +926,7 @@ void release_freetype(void)
{
}
-void freetype_notify_cacheremove(IDWriteFontFace4 *fontface)
+void freetype_notify_cacheremove(IDWriteFontFace5 *fontface)
{
}
@@ -935,35 +935,35 @@ HRESULT freetype_get_design_glyph_metrics(struct dwrite_fontface *fontface, UINT
return E_NOTIMPL;
}
-BOOL freetype_is_monospaced(IDWriteFontFace4 *fontface)
+BOOL freetype_is_monospaced(IDWriteFontFace5 *fontface)
{
return FALSE;
}
-HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, float emSize, UINT16 const *glyphs,
+HRESULT freetype_get_glyphrun_outline(IDWriteFontFace5 *fontface, float emSize, UINT16 const *glyphs,
float const *advances, DWRITE_GLYPH_OFFSET const *offsets, unsigned int count, BOOL is_rtl,
IDWriteGeometrySink *sink)
{
return E_NOTIMPL;
}
-UINT16 freetype_get_glyphcount(IDWriteFontFace4 *fontface)
+UINT16 freetype_get_glyphcount(IDWriteFontFace5 *fontface)
{
return 0;
}
-void freetype_get_glyphs(IDWriteFontFace4 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
+void freetype_get_glyphs(IDWriteFontFace5 *fontface, INT charmap, UINT32 const *codepoints, UINT32 count,
UINT16 *glyphs)
{
memset(glyphs, 0, count * sizeof(*glyphs));
}
-BOOL freetype_has_kerning_pairs(IDWriteFontFace4 *fontface)
+BOOL freetype_has_kerning_pairs(IDWriteFontFace5 *fontface)
{
return FALSE;
}
-INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace4 *fontface, UINT16 left, UINT16 right)
+INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace5 *fontface, UINT16 left, UINT16 right)
{
return 0;
}
@@ -978,13 +978,13 @@ BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
return FALSE;
}
-INT freetype_get_charmap_index(IDWriteFontFace4 *fontface, BOOL *is_symbol)
+INT freetype_get_charmap_index(IDWriteFontFace5 *fontface, BOOL *is_symbol)
{
*is_symbol = FALSE;
return -1;
}
-INT32 freetype_get_glyph_advance(IDWriteFontFace4 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode,
+INT32 freetype_get_glyph_advance(IDWriteFontFace5 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode,
BOOL *has_contours)
{
*has_contours = FALSE;
diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c
index fb3ed090e6..7b97d77bd1 100644
--- a/dlls/dwrite/main.c
+++ b/dlls/dwrite/main.c
@@ -901,14 +901,14 @@ HRESULT factory_get_cached_fontface(IDWriteFactory5 *iface, IDWriteFontFile * co
const void *cached_key;
IDWriteFontFile *file;
- cached_face_index = IDWriteFontFace4_GetIndex(cached->fontface);
- cached_simulations = IDWriteFontFace4_GetSimulations(cached->fontface);
+ cached_face_index = IDWriteFontFace5_GetIndex(cached->fontface);
+ cached_simulations = IDWriteFontFace5_GetSimulations(cached->fontface);
/* skip earlier */
if (cached_face_index != index || cached_simulations != simulations)
continue;
- hr = IDWriteFontFace4_GetFiles(cached->fontface, &count, &file);
+ hr = IDWriteFontFace5_GetFiles(cached->fontface, &count, &file);
if (FAILED(hr))
break;
@@ -917,8 +917,9 @@ HRESULT factory_get_cached_fontface(IDWriteFactory5 *iface, IDWriteFontFile * co
if (FAILED(hr))
break;
- if (cached_key_size == key_size && !memcmp(cached_key, key, key_size)) {
- if (FAILED(hr = IDWriteFontFace4_QueryInterface(cached->fontface, riid, obj)))
+ if (cached_key_size == key_size && !memcmp(cached_key, key, key_size))
+ {
+ if (FAILED(hr = IDWriteFontFace5_QueryInterface(cached->fontface, riid, obj)))
WARN("Failed to get %s from fontface, hr %#x.\n", debugstr_guid(riid), hr);
TRACE("returning cached fontface %p\n", cached->fontface);
@@ -932,7 +933,7 @@ HRESULT factory_get_cached_fontface(IDWriteFactory5 *iface, IDWriteFontFile * co
}
struct fontfacecached *factory_cache_fontface(IDWriteFactory5 *iface, struct list *fontfaces,
- IDWriteFontFace4 *fontface)
+ IDWriteFontFace5 *fontface)
{
struct dwritefactory *factory = impl_from_IDWriteFactory5(iface);
struct fontfacecached *cached;
@@ -1011,7 +1012,7 @@ static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory5 *iface, DWRIT
desc.index = index;
desc.simulations = simulations;
desc.font_data = NULL;
- hr = create_fontface(&desc, fontfaces, (IDWriteFontFace4 **)fontface);
+ hr = create_fontface(&desc, fontfaces, (IDWriteFontFace5 **)fontface);
failed:
IDWriteFontFileStream_Release(stream);
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index efae402f91..09a9a861c3 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -2440,7 +2440,7 @@ void opentype_colr_next_glyph(const struct dwrite_fonttable *colr, struct dwrite
}
}
-BOOL opentype_has_vertical_variants(IDWriteFontFace4 *fontface)
+BOOL opentype_has_vertical_variants(IDWriteFontFace5 *fontface)
{
const struct gpos_gsub_header *header;
const struct ot_feature_list *featurelist;
@@ -2452,7 +2452,7 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace4 *fontface)
UINT32 size;
HRESULT hr;
- hr = IDWriteFontFace4_TryGetFontTable(fontface, MS_GSUB_TAG, &data, &size, &context, &exists);
+ hr = IDWriteFontFace5_TryGetFontTable(fontface, MS_GSUB_TAG, &data, &size, &context, &exists);
if (FAILED(hr) || !exists)
return FALSE;
@@ -2510,12 +2510,12 @@ BOOL opentype_has_vertical_variants(IDWriteFontFace4 *fontface)
}
}
- IDWriteFontFace4_ReleaseFontTable(fontface, context);
+ IDWriteFontFace5_ReleaseFontTable(fontface, context);
return ret;
}
-static BOOL opentype_has_font_table(IDWriteFontFace4 *fontface, UINT32 tag)
+static BOOL opentype_has_font_table(IDWriteFontFace5 *fontface, UINT32 tag)
{
BOOL exists = FALSE;
const void *data;
@@ -2523,17 +2523,17 @@ static BOOL opentype_has_font_table(IDWriteFontFace4 *fontface, UINT32 tag)
UINT32 size;
HRESULT hr;
- hr = IDWriteFontFace4_TryGetFontTable(fontface, tag, &data, &size, &context, &exists);
+ hr = IDWriteFontFace5_TryGetFontTable(fontface, tag, &data, &size, &context, &exists);
if (FAILED(hr))
return FALSE;
if (exists)
- IDWriteFontFace4_ReleaseFontTable(fontface, context);
+ IDWriteFontFace5_ReleaseFontTable(fontface, context);
return exists;
}
-static unsigned int opentype_get_sbix_formats(IDWriteFontFace4 *fontface)
+static unsigned int opentype_get_sbix_formats(IDWriteFontFace5 *fontface)
{
unsigned int num_strikes, num_glyphs, i, j, ret = 0;
const struct sbix_header *sbix_header;
@@ -2547,7 +2547,7 @@ static unsigned int opentype_get_sbix_formats(IDWriteFontFace4 *fontface)
num_glyphs = table_read_be_word(&table, FIELD_OFFSET(struct maxp, num_glyphs));
- IDWriteFontFace4_ReleaseFontTable(fontface, table.context);
+ IDWriteFontFace5_ReleaseFontTable(fontface, table.context);
memset(&table, 0, sizeof(table));
table.exists = TRUE;
@@ -2600,12 +2600,12 @@ static unsigned int opentype_get_sbix_formats(IDWriteFontFace4 *fontface)
}
}
- IDWriteFontFace4_ReleaseFontTable(fontface, table.context);
+ IDWriteFontFace5_ReleaseFontTable(fontface, table.context);
return ret;
}
-static unsigned int opentype_get_cblc_formats(IDWriteFontFace4 *fontface)
+static unsigned int opentype_get_cblc_formats(IDWriteFontFace5 *fontface)
{
const unsigned int format_mask = DWRITE_GLYPH_IMAGE_FORMATS_PNG |
DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8;
@@ -2637,12 +2637,12 @@ static unsigned int opentype_get_cblc_formats(IDWriteFontFace4 *fontface)
}
}
- IDWriteFontFace4_ReleaseFontTable(fontface, cblc.context);
+ IDWriteFontFace5_ReleaseFontTable(fontface, cblc.context);
return ret;
}
-UINT32 opentype_get_glyph_image_formats(IDWriteFontFace4 *fontface)
+UINT32 opentype_get_glyph_image_formats(IDWriteFontFace5 *fontface)
{
UINT32 ret = DWRITE_GLYPH_IMAGE_FORMATS_NONE;
--
2.24.0
1
2
[PATCH] testbot/LibvirtTool: Only check the start count after a reboot.
by Francois Gouget 02 Dec '19
by Francois Gouget 02 Dec '19
02 Dec '19
The start count check is not related to taking live snapshots.
And we can skip it if the VM was not freshly booted.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/LibvirtTool.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index e5dc8372e..a2939e738 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -463,14 +463,14 @@ sub SetupTestAgentd($$$$)
# So it all works out.
$TA->SetProperty("start.count", 0);
}
- else
+ elsif ($Booting)
{
# Check that TestAgentd is not displaying the "Has Windows rebooted?"
# warning.
my $Count = $TA->GetProperties("start.count");
if (defined $Count and $Count > 1)
{
- FatalError("Cannot take a live snapshot because start.count=$Count > 1");
+ FatalError("The VM has been rebooted too many times: start.count=$Count > 1");
}
}
$TA->Disconnect();
--
2.20.1
1
0
[PATCH] testbot/LogUtils: Skip the search for new errors if there is no error.
by Francois Gouget 02 Dec '19
by Francois Gouget 02 Dec '19
02 Dec '19
This avoids loading and parsing the reference log when not needed.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/lib/WineTestBot/LogUtils.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 282906e62..51932965c 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -888,10 +888,12 @@ sub GetNewLogErrors($$$)
{
my ($RefFileName, $Groups, $Errors) = @_;
+ my (@NewGroups, %NewErrors, %NewIndices);
+ return (\@NewGroups, \%NewErrors, \%NewIndices) if (!@$Groups);
+
my ($RefGroups, $RefErrors) = GetLogErrors($RefFileName);
return (undef, undef) if (!$RefGroups);
- my (@NewGroups, %NewErrors, %NewIndices);
foreach my $GroupName (@$Groups)
{
if ($RefErrors->{$GroupName})
--
2.20.1
1
0
[PATCH] testbot/WineRunTask: Move TestAgent error reporting to match WineRunWineTest.
by Francois Gouget 02 Dec '19
by Francois Gouget 02 Dec '19
02 Dec '19
It belongs in the wrap up section which makes it less likely that code
will be inserted between it and WrapUpAndExit().
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunTask.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 1f21050b3..a324265eb 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -584,11 +584,11 @@ elsif (!defined $TAError)
}
$TA->Disconnect();
-FatalTAError(undef, $TAError, $PossibleCrash) if (defined $TAError);
-
#
# Wrap up
#
+FatalTAError(undef, $TAError, $PossibleCrash) if (defined $TAError);
+
WrapUpAndExit($NewStatus, $TaskFailures, undef, $TaskTimedOut);
--
2.20.1
1
0