winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
September 2015
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
318 discussions
Start a n
N
ew thread
Stefan Dösinger : wined3d: Remove old surface flipping hacks.
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: ebd6bf7f7a3493284b2aaa21ce3ab982336e3835 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ebd6bf7f7a3493284b2aaa21c…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Sep 7 23:50:35 2015 +0200 wined3d: Remove old surface flipping hacks. They're non-functional these days anyway. --- dlls/wined3d/surface.c | 77 ------------------------------------------ dlls/wined3d/swapchain.c | 47 +++++--------------------- dlls/wined3d/wined3d_private.h | 1 - 3 files changed, 9 insertions(+), 116 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index f303d90..f01260c 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2881,83 +2881,6 @@ void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl } } -void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) -{ - if (front->container->level_count != 1 || front->container->layer_count != 1 - || back->container->level_count != 1 || back->container->layer_count != 1) - ERR("Flip between surfaces %p and %p not supported.\n", front, back); - - /* Flip the surface contents */ - /* Flip the DC */ - { - HDC tmp; - tmp = front->hDC; - front->hDC = back->hDC; - back->hDC = tmp; - } - - /* Flip the DIBsection */ - { - HBITMAP tmp = front->dib.DIBsection; - front->dib.DIBsection = back->dib.DIBsection; - back->dib.DIBsection = tmp; - } - - /* Flip the surface data */ - { - void* tmp; - - tmp = front->dib.bitmap_data; - front->dib.bitmap_data = back->dib.bitmap_data; - back->dib.bitmap_data = tmp; - - tmp = front->resource.heap_memory; - front->resource.heap_memory = back->resource.heap_memory; - back->resource.heap_memory = tmp; - } - - /* Flip the PBO */ - { - GLuint tmp_pbo = front->pbo; - front->pbo = back->pbo; - back->pbo = tmp_pbo; - } - - /* Flip the opengl texture */ - { - GLuint tmp; - - tmp = back->container->texture_rgb.name; - back->container->texture_rgb.name = front->container->texture_rgb.name; - front->container->texture_rgb.name = tmp; - - tmp = back->container->texture_srgb.name; - back->container->texture_srgb.name = front->container->texture_srgb.name; - front->container->texture_srgb.name = tmp; - - tmp = back->rb_multisample; - back->rb_multisample = front->rb_multisample; - front->rb_multisample = tmp; - - tmp = back->rb_resolved; - back->rb_resolved = front->rb_resolved; - front->rb_resolved = tmp; - - resource_unload(&back->resource); - resource_unload(&front->resource); - } - - { - DWORD tmp_flags = back->flags; - back->flags = front->flags; - front->flags = tmp_flags; - - tmp_flags = back->locations; - back->locations = front->locations; - front->locations = tmp_flags; - } -} - /* Does a direct frame buffer -> texture copy. Stretching is done with single * pixel copy calls. */ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index b37bbb9..0a1373f 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -555,45 +555,16 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT } front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); - if (!swapchain->render_to_fbo && ((front->locations & WINED3D_LOCATION_SYSMEM) - || (back_buffer->locations & WINED3D_LOCATION_SYSMEM))) - { - /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying - * Doesn't work with render_to_fbo because we're not flipping - */ - - if (front->resource.size == back_buffer->resource.size) - { - flip_surface(front, back_buffer); - /* Tell the front buffer surface that is has been modified. However, - * the other locations were preserved during that, so keep the flags. - * This serves to update the emulated overlay, if any. */ - surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); - } - else - { - surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); - surface_validate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE); - } - } - else - { - surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); - /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM - * and INTEXTURE copies can keep their old content if they have any defined content. - * If the swapeffect is COPY, the content remains the same. If it is FLIP however, - * the texture / sysmem copy needs to be reloaded from the drawable - */ - if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) - { - surface_validate_location(back_buffer, back_buffer->container->resource.draw_binding); - surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding); - } - } + surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); + surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); + /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM + * and INTEXTURE copies can keep their old content if they have any defined content. + * If the swapeffect is COPY, the content remains the same. + * + * The FLIP swap effect is not implemented yet. We could mark WINED3D_LOCATION_DRAWABLE + * up to date and hope WGL flipped front and back buffers and read this data into + * the FBO. Don't bother about this for now. */ if (fb->depth_stencil) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d1ba5e4..758af54 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2456,7 +2456,6 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; /* Surface flags: */ #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */
1
0
0
0
Stefan Dösinger : wined3d: Remove wined3d_backbuffer_type.
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: 2936e4ac54b14cc09c5b20b06b17fdb0545374b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2936e4ac54b14cc09c5b20b06…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Sep 7 23:50:34 2015 +0200 wined3d: Remove wined3d_backbuffer_type. --- dlls/d3d8/device.c | 5 +++-- dlls/d3d8/swapchain.c | 5 +++-- dlls/d3d9/device.c | 5 +++-- dlls/d3d9/swapchain.c | 5 +++-- dlls/dxgi/swapchain.c | 6 ++---- dlls/wined3d/swapchain.c | 6 +++--- include/wine/wined3d.h | 9 +-------- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 455c764..e899b34 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -732,6 +732,8 @@ static HRESULT WINAPI d3d8_device_GetBackBuffer(IDirect3DDevice8 *iface, TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + /* No need to check for backbuffer == NULL, Windows crashes in that case. */ wined3d_mutex_lock(); if (!(swapchain = wined3d_device_get_swapchain(device->wined3d_device, 0))) @@ -741,8 +743,7 @@ static HRESULT WINAPI d3d8_device_GetBackBuffer(IDirect3DDevice8 *iface, return D3DERR_INVALIDCALL; } - if (!(wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if (!(wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain, backbuffer_idx))) { wined3d_mutex_unlock(); *backbuffer = NULL; diff --git a/dlls/d3d8/swapchain.c b/dlls/d3d8/swapchain.c index 70b7fb0..8efdd0a 100644 --- a/dlls/d3d8/swapchain.c +++ b/dlls/d3d8/swapchain.c @@ -120,6 +120,8 @@ static HRESULT WINAPI d3d8_swapchain_GetBackBuffer(IDirect3DSwapChain8 *iface, TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + if (!backbuffer) { WARN("The output pointer is NULL, returning D3DERR_INVALIDCALL.\n"); @@ -127,8 +129,7 @@ static HRESULT WINAPI d3d8_swapchain_GetBackBuffer(IDirect3DSwapChain8 *iface, } wined3d_mutex_lock(); - if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, backbuffer_idx))) { wined3d_resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); surface_impl = wined3d_resource_get_parent(wined3d_resource); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 01a6d9e..3a0376d 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -754,6 +754,8 @@ static HRESULT WINAPI d3d9_device_GetBackBuffer(IDirect3DDevice9Ex *iface, UINT TRACE("iface %p, swapchain %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, swapchain, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + /* No need to check for backbuffer == NULL, Windows crashes in that case. */ wined3d_mutex_lock(); @@ -764,8 +766,7 @@ static HRESULT WINAPI d3d9_device_GetBackBuffer(IDirect3DDevice9Ex *iface, UINT return D3DERR_INVALIDCALL; } - if (!(wined3d_texture = wined3d_swapchain_get_back_buffer(wined3d_swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if (!(wined3d_texture = wined3d_swapchain_get_back_buffer(wined3d_swapchain, backbuffer_idx))) { wined3d_mutex_unlock(); *backbuffer = NULL; diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c index b26a482..c995afb 100644 --- a/dlls/d3d9/swapchain.c +++ b/dlls/d3d9/swapchain.c @@ -160,6 +160,8 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface, TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + if (!backbuffer) { WARN("The output pointer is NULL, returning D3DERR_INVALIDCALL.\n"); @@ -167,8 +169,7 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface, } wined3d_mutex_lock(); - if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, backbuffer_idx))) { wined3d_resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); surface_impl = wined3d_resource_get_parent(wined3d_resource); diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index 10ae26d..366bdb9 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -152,8 +152,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface, EnterCriticalSection(&dxgi_cs); - if (!(texture = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain, - buffer_idx, WINED3D_BACKBUFFER_TYPE_MONO))) + if (!(texture = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain, buffer_idx))) { LeaveCriticalSection(&dxgi_cs); return DXGI_ERROR_INVALID_CALL; @@ -235,8 +234,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeBuffers(IDXGISwapChain *if wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc); for (i = 0; i < wined3d_desc.backbuffer_count; ++i) { - texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, - i, WINED3D_BACKBUFFER_TYPE_MONO); + texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, i); parent = wined3d_texture_get_parent(texture); IUnknown_AddRef(parent); if (IUnknown_Release(parent)) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 8fb9f6a..b37bbb9 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -178,10 +178,10 @@ HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapc } struct wined3d_texture * CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, - UINT back_buffer_idx, enum wined3d_backbuffer_type type) + UINT back_buffer_idx) { - TRACE("swapchain %p, back_buffer_idx %u, type %#x.\n", - swapchain, back_buffer_idx, type); + TRACE("swapchain %p, back_buffer_idx %u.\n", + swapchain, back_buffer_idx); /* Return invalid if there is no backbuffer array, otherwise it will * crash when ddraw is used (there swapchain->back_buffers is always diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9c77cfe..7d4e5a0 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -503,13 +503,6 @@ enum wined3d_patch_edge_style WINED3D_PATCH_EDGE_CONTINUOUS = 1, }; -enum wined3d_backbuffer_type -{ - WINED3D_BACKBUFFER_TYPE_MONO = 0, - WINED3D_BACKBUFFER_TYPE_LEFT = 1, - WINED3D_BACKBUFFER_TYPE_RIGHT = 2, -}; - enum wined3d_swap_effect { WINED3D_SWAP_EFFECT_DISCARD = 1, @@ -2512,7 +2505,7 @@ HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device, struct w void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain); ULONG __cdecl wined3d_swapchain_decref(struct wined3d_swapchain *swapchain); struct wined3d_texture * __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, - UINT backbuffer_idx, enum wined3d_backbuffer_type backbuffer_type); + UINT backbuffer_idx); struct wined3d_device * __cdecl wined3d_swapchain_get_device(const struct wined3d_swapchain *swapchain); HRESULT __cdecl wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);
1
0
0
0
Stefan Dösinger : d3d8/tests: Test D3DBACKBUFFER_TYPE.
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: 9d29be28006fa8befa8dcee7cdab76f2dcab24c6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d29be28006fa8befa8dcee7c…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Sep 7 23:50:33 2015 +0200 d3d8/tests: Test D3DBACKBUFFER_TYPE. --- dlls/d3d8/tests/device.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 47326b5..cb7f5e1 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -257,7 +257,7 @@ static void test_swapchain(void) IDirect3DSwapChain8 *swapchain1; IDirect3DSwapChain8 *swapchain2; IDirect3DSwapChain8 *swapchain3; - IDirect3DSurface8 *backbuffer; + IDirect3DSurface8 *backbuffer, *stereo_buffer; D3DPRESENT_PARAMETERS d3dpp; IDirect3DDevice8 *device; IDirect3D8 *d3d; @@ -286,6 +286,24 @@ static void test_swapchain(void) ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); ok(!backbuffer, "The back buffer pointer is %p, expected NULL.\n", backbuffer); + hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(SUCCEEDED(hr), "Failed to get back buffer, hr %#x.\n", hr); + IDirect3DSurface8_Release(backbuffer); + + /* The back buffer type value is ignored. */ + hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + hr = IDirect3DDevice8_GetBackBuffer(device, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + memset(&d3dpp, 0, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; @@ -315,6 +333,20 @@ static void test_swapchain(void) ok(backbuffer != NULL && backbuffer != (void *) 0xdeadbeef, "The back buffer is %p\n", backbuffer); if(backbuffer && backbuffer != (void *) 0xdeadbeef) IDirect3DSurface8_Release(backbuffer); + /* The back buffer type value is ignored. */ + hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + backbuffer = (void *) 0xdeadbeef; hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 1, 0, &backbuffer); ok(SUCCEEDED(hr), "Failed to get the 2nd back buffer (%#08x)\n", hr);
1
0
0
0
Stefan Dösinger : d3d9/tests: Test D3DBACKBUFFER_TYPE.
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: 2e8e2da5ee22779eb77e04bc851ccbfb83749d62 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e8e2da5ee22779eb77e04bc8…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Sep 8 10:24:48 2015 +0200 d3d9/tests: Test D3DBACKBUFFER_TYPE. --- dlls/d3d9/tests/device.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index c41a5e6..3bf0ff2 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -1053,7 +1053,7 @@ static void test_swapchain(void) IDirect3DSwapChain9 *swapchain2; IDirect3DSwapChain9 *swapchain3; IDirect3DSwapChain9 *swapchainX; - IDirect3DSurface9 *backbuffer; + IDirect3DSurface9 *backbuffer, *stereo_buffer; D3DPRESENT_PARAMETERS d3dpp; IDirect3DDevice9 *device; IDirect3D9 *d3d; @@ -1103,6 +1103,33 @@ static void test_swapchain(void) ok(backbuffer != NULL, "The back buffer is NULL\n"); if(backbuffer) IDirect3DSurface9_Release(backbuffer); + /* The back buffer type value is ignored. */ + hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + + hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + /* Try to get a nonexistent swapchain */ hr = IDirect3DDevice9_GetSwapChain(device, 1, &swapchainX); ok(hr == D3DERR_INVALIDCALL, "GetSwapChain on an nonexistent swapchain returned (%08x)\n", hr);
1
0
0
0
Nikolay Sivov : dwrite: Implement GetFontCollection() for matching list.
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: b55e599a4d1f4c8055f802c4e3109d3337e0a42e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b55e599a4d1f4c8055f802c4e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Sep 8 11:41:59 2015 +0300 dwrite: Implement GetFontCollection() for matching list. --- dlls/dwrite/font.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index aea35c9..6a46a1a 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -1513,10 +1513,7 @@ static ULONG WINAPI dwritefontlist_Release(IDWriteFontList *iface) static HRESULT WINAPI dwritefontlist_GetFontCollection(IDWriteFontList *iface, IDWriteFontCollection **collection) { struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); - - FIXME("(%p)->(%p): stub\n", This, collection); - - return E_NOTIMPL; + return IDWriteFontFamily_GetFontCollection(This->family, collection); } static UINT32 WINAPI dwritefontlist_GetFontCount(IDWriteFontList *iface)
1
0
0
0
Nikolay Sivov : dwrite: Implement GetFont() for matching list.
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: 9c198982174d30e7fc933aeb526d8e508ba39940 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9c198982174d30e7fc933aeb5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Sep 8 11:41:28 2015 +0300 dwrite: Implement GetFont() for matching list. --- dlls/dwrite/font.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 89 insertions(+), 4 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 2129094..aea35c9 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -97,6 +97,10 @@ struct dwrite_font_data { struct dwrite_fontlist { IDWriteFontList IDWriteFontList_iface; LONG ref; + + IDWriteFontFamily *family; + struct dwrite_font_data **fonts; + UINT32 font_count; }; struct dwrite_fontfamily_data { @@ -1495,6 +1499,11 @@ static ULONG WINAPI dwritefontlist_Release(IDWriteFontList *iface) TRACE("(%p)->(%d)\n", This, ref); if (!ref) { + UINT32 i; + + for (i = 0; i < This->font_count; i++) + release_font_data(This->fonts[i]); + IDWriteFontFamily_Release(This->family); heap_free(This); } @@ -1513,19 +1522,25 @@ static HRESULT WINAPI dwritefontlist_GetFontCollection(IDWriteFontList *iface, I static UINT32 WINAPI dwritefontlist_GetFontCount(IDWriteFontList *iface) { struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); - FIXME("(%p): stub\n", This); - return 0; + TRACE("(%p)\n", This); + return This->font_count; } static HRESULT WINAPI dwritefontlist_GetFont(IDWriteFontList *iface, UINT32 index, IDWriteFont **font) { struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); - FIXME("(%p)->(%u %p): stub\n", This, index, font); + TRACE("(%p)->(%u %p)\n", This, index, font); *font = NULL; - return E_NOTIMPL; + if (This->font_count == 0) + return S_FALSE; + + if (index >= This->font_count) + return E_INVALIDARG; + + return create_font(This->fonts[index], This->family, font); } static const IDWriteFontListVtbl dwritefontlistvtbl = { @@ -1687,11 +1702,48 @@ static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily *i return create_font(match, iface, font); } +typedef BOOL (*matching_filter_func)(const struct dwrite_font_data*); + +static BOOL is_font_acceptable_for_normal(const struct dwrite_font_data *font) +{ + return font->style == DWRITE_FONT_STYLE_NORMAL || font->style == DWRITE_FONT_STYLE_ITALIC; +} + +static BOOL is_font_acceptable_for_oblique_italic(const struct dwrite_font_data *font) +{ + return font->style == DWRITE_FONT_STYLE_OBLIQUE || font->style == DWRITE_FONT_STYLE_ITALIC; +} + +static void matchingfonts_sort(struct dwrite_fontlist *fonts, const struct dwrite_font_propvec *req) +{ + UINT32 b = fonts->font_count - 1, j, t; + + while (1) { + t = b; + + for (j = 0; j < b; j++) { + if (is_better_font_match(&fonts->fonts[j+1]->propvec, &fonts->fonts[j]->propvec, req)) { + struct dwrite_font_data *s = fonts->fonts[j]; + fonts->fonts[j] = fonts->fonts[j+1]; + fonts->fonts[j+1] = s; + t = j; + } + } + + if (t == b) + break; + b = t; + }; +} + static HRESULT WINAPI dwritefontfamily_GetMatchingFonts(IDWriteFontFamily *iface, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFontList **ret) { struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); + matching_filter_func func = NULL; + struct dwrite_font_propvec req; struct dwrite_fontlist *fonts; + UINT32 i; TRACE("(%p)->(%d %d %d %p)\n", This, weight, stretch, style, ret); @@ -1700,8 +1752,41 @@ static HRESULT WINAPI dwritefontfamily_GetMatchingFonts(IDWriteFontFamily *iface fonts = heap_alloc(sizeof(*fonts)); if (!fonts) return E_OUTOFMEMORY; + + /* Allocate as many as family has, not all of them will be necessary used. */ + fonts->fonts = heap_alloc(sizeof(*fonts->fonts) * This->data->font_count); + if (!fonts->fonts) { + heap_free(fonts); + return E_OUTOFMEMORY; + } + fonts->IDWriteFontList_iface.lpVtbl = &dwritefontlistvtbl; fonts->ref = 1; + fonts->family = iface; + IDWriteFontFamily_AddRef(fonts->family); + fonts->font_count = 0; + + /* Normal style accepts Normal or Italic, Oblique and Italic - both Oblique and Italic styles */ + if (style == DWRITE_FONT_STYLE_NORMAL) { + if (This->data->has_normal_face || This->data->has_italic_face) + func = is_font_acceptable_for_normal; + } + else /* requested oblique or italic */ { + if (This->data->has_oblique_face || This->data->has_italic_face) + func = is_font_acceptable_for_oblique_italic; + } + + for (i = 0; i < This->data->font_count; i++) { + if (!func || func(This->data->fonts[i])) { + fonts->fonts[fonts->font_count] = This->data->fonts[i]; + InterlockedIncrement(&This->data->fonts[i]->ref); + fonts->font_count++; + } + } + + /* now potential matches are sorted using same criteria GetFirstMatchingFont uses */ + init_font_prop_vec(weight, stretch, style, &req); + matchingfonts_sort(fonts, &req); *ret = &fonts->IDWriteFontList_iface; return S_OK;
1
0
0
0
Nikolay Sivov : dwrite: Track face styles added to a family.
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: 42a99a8de596f8f399038cb956bea78bd0f3dc4b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=42a99a8de596f8f399038cb95…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Sep 8 11:40:54 2015 +0300 dwrite: Track face styles added to a family. --- dlls/dwrite/font.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 4689075..2129094 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -107,6 +107,9 @@ struct dwrite_fontfamily_data { struct dwrite_font_data **fonts; UINT32 font_count; UINT32 font_alloc; + BOOL has_normal_face : 1; + BOOL has_oblique_face : 1; + BOOL has_italic_face : 1; }; struct dwrite_fontcollection { @@ -1936,6 +1939,12 @@ static HRESULT fontfamily_add_font(struct dwrite_fontfamily_data *family_data, s family_data->fonts[family_data->font_count] = font_data; family_data->font_count++; + if (font_data->style == DWRITE_FONT_STYLE_NORMAL) + family_data->has_normal_face = TRUE; + else if (font_data->style == DWRITE_FONT_STYLE_OBLIQUE) + family_data->has_oblique_face = TRUE; + else + family_data->has_italic_face = TRUE; return S_OK; } @@ -2815,6 +2824,9 @@ static HRESULT init_fontfamily_data(IDWriteLocalizedStrings *familyname, struct data->ref = 1; data->font_count = 0; data->font_alloc = 2; + data->has_normal_face = FALSE; + data->has_oblique_face = FALSE; + data->has_italic_face = FALSE; data->fonts = heap_alloc(sizeof(*data->fonts)*data->font_alloc); if (!data->fonts) {
1
0
0
0
Nikolay Sivov : dwrite: Return stub IDWriteFontList from GetMatchingFonts( ).
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: 6dd9cdca4b2cae8aba317b1f8fb374dcf5e15481 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6dd9cdca4b2cae8aba317b1f8…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Sep 8 11:40:25 2015 +0300 dwrite: Return stub IDWriteFontList from GetMatchingFonts(). --- dlls/dwrite/font.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 3 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index a181395..4689075 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -94,6 +94,11 @@ struct dwrite_font_data { BOOL oblique_sim_tested : 1; }; +struct dwrite_fontlist { + IDWriteFontList IDWriteFontList_iface; + LONG ref; +}; + struct dwrite_fontfamily_data { LONG ref; @@ -241,6 +246,11 @@ static inline struct dwrite_colorglyphenum *impl_from_IDWriteColorGlyphRunEnumer return CONTAINING_RECORD(iface, struct dwrite_colorglyphenum, IDWriteColorGlyphRunEnumerator_iface); } +static inline struct dwrite_fontlist *impl_from_IDWriteFontList(IDWriteFontList *iface) +{ + return CONTAINING_RECORD(iface, struct dwrite_fontlist, IDWriteFontList_iface); +} + static inline const char *debugstr_tag(UINT32 tag) { return wine_dbg_sprintf("%c%c%c%c", tag & 0xff, (tag >> 8) & 0xff, (tag >> 16) & 0xff, tag >> 24); @@ -1447,6 +1457,83 @@ static HRESULT create_font(struct dwrite_font_data *data, IDWriteFontFamily *fam return S_OK; } +/* IDWriteFontList */ +static HRESULT WINAPI dwritefontlist_QueryInterface(IDWriteFontList *iface, REFIID riid, void **obj) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IDWriteFontList) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IDWriteFontList_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI dwritefontlist_AddRef(IDWriteFontList *iface) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + return ref; +} + +static ULONG WINAPI dwritefontlist_Release(IDWriteFontList *iface) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(%d)\n", This, ref); + + if (!ref) { + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI dwritefontlist_GetFontCollection(IDWriteFontList *iface, IDWriteFontCollection **collection) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + + FIXME("(%p)->(%p): stub\n", This, collection); + + return E_NOTIMPL; +} + +static UINT32 WINAPI dwritefontlist_GetFontCount(IDWriteFontList *iface) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + FIXME("(%p): stub\n", This); + return 0; +} + +static HRESULT WINAPI dwritefontlist_GetFont(IDWriteFontList *iface, UINT32 index, IDWriteFont **font) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + + FIXME("(%p)->(%u %p): stub\n", This, index, font); + + *font = NULL; + + return E_NOTIMPL; +} + +static const IDWriteFontListVtbl dwritefontlistvtbl = { + dwritefontlist_QueryInterface, + dwritefontlist_AddRef, + dwritefontlist_Release, + dwritefontlist_GetFontCollection, + dwritefontlist_GetFontCount, + dwritefontlist_GetFont +}; + static HRESULT WINAPI dwritefontfamily_QueryInterface(IDWriteFontFamily *iface, REFIID riid, void **obj) { struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); @@ -1598,11 +1685,23 @@ static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily *i } static HRESULT WINAPI dwritefontfamily_GetMatchingFonts(IDWriteFontFamily *iface, DWRITE_FONT_WEIGHT weight, - DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFontList **fonts) + DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFontList **ret) { struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); - FIXME("(%p)->(%d %d %d %p): stub\n", This, weight, stretch, style, fonts); - return E_NOTIMPL; + struct dwrite_fontlist *fonts; + + TRACE("(%p)->(%d %d %d %p)\n", This, weight, stretch, style, ret); + + *ret = NULL; + + fonts = heap_alloc(sizeof(*fonts)); + if (!fonts) + return E_OUTOFMEMORY; + fonts->IDWriteFontList_iface.lpVtbl = &dwritefontlistvtbl; + fonts->ref = 1; + + *ret = &fonts->IDWriteFontList_iface; + return S_OK; } static const IDWriteFontFamilyVtbl fontfamilyvtbl = {
1
0
0
0
Gerald Pfeifer : mshtml: Adjust NS_ERROR_GENERATE_FAILURE to avoid shift overflow.
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: a0da827d61640e91302d96492ce5f0ce9f06948a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a0da827d61640e91302d96492…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Mon Sep 7 23:51:57 2015 +0200 mshtml: Adjust NS_ERROR_GENERATE_FAILURE to avoid shift overflow. --- dlls/mshtml/mshtml_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 58ef423..55375d4 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -40,7 +40,7 @@ #include "nsiface.h" #define NS_ERROR_GENERATE_FAILURE(module,code) \ - ((nsresult) (((UINT32)(1<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code)))) + ((nsresult) (((UINT32)(1u<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code)))) #define NS_OK ((nsresult)0x00000000L) #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
1
0
0
0
Gerald Pfeifer : gdi32: Avoid two cases of shift overflow in get_glyph_indices.
by Alexandre Julliard
08 Sep '15
08 Sep '15
Module: wine Branch: master Commit: 775de7922ef363d665b1cb19dc7c00269779030d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=775de7922ef363d665b1cb19d…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Mon Sep 7 23:52:55 2015 +0200 gdi32: Avoid two cases of shift overflow in get_glyph_indices. --- dlls/gdi32/tests/font.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 3757a8d..6b0da1f 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -2391,12 +2391,12 @@ static BOOL get_glyph_indices(INT charset, UINT code_page, WORD *idx, UINT count if (charset == SYMBOL_CHARSET) { ok(strcmp("Arial", name), "face name should NOT be Arial\n"); - ok(fs.fsCsb[0] & (1 << 31), "symbol encoding should be available\n"); + ok(fs.fsCsb[0] & (1u << 31), "symbol encoding should be available\n"); } else { ok(!strcmp("Arial", name), "face name should be Arial, not %s\n", name); - ok(!(fs.fsCsb[0] & (1 << 31)), "symbol encoding should NOT be available\n"); + ok(!(fs.fsCsb[0] & (1u << 31)), "symbol encoding should NOT be available\n"); } if (!TranslateCharsetInfo((DWORD *)(INT_PTR)cs, &csi, TCI_SRCCHARSET))
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
32
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Results per page:
10
25
50
100
200