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
July 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
567 discussions
Start a n
N
ew thread
Hans Leidekker : user32: Add a stub implementation of IsWindowRedirectedForPrint.
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: 1a78666654f60fdd408f3627f7d8828437148655 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a78666654f60fdd408f3627f…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jul 29 11:38:13 2015 +0200 user32: Add a stub implementation of IsWindowRedirectedForPrint. --- dlls/user32/misc.c | 10 ++++++++++ dlls/user32/user32.spec | 1 + 2 files changed, 11 insertions(+) diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c index e395d2f..d2b4b73 100644 --- a/dlls/user32/misc.c +++ b/dlls/user32/misc.c @@ -748,6 +748,16 @@ BOOL WINAPI IsTouchWindow( HWND hwnd, PULONG flags ) return FALSE; } +/********************************************************************** + * IsWindowRedirectedForPrint [USER32.@] + */ +BOOL WINAPI IsWindowRedirectedForPrint( HWND hwnd ) +{ + FIXME("(%p): stub\n", hwnd); + return FALSE; +} + + static const WCHAR imeW[] = {'I','M','E',0}; const struct builtin_class_descr IME_builtin_class = { diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 204ccd4..f0e541f 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -450,6 +450,7 @@ @ stdcall IsWindow(long) @ stdcall IsWindowEnabled(long) # @ stub IsWindowInDestroy +@ stdcall IsWindowRedirectedForPrint(long) @ stdcall IsWindowUnicode(long) @ stdcall IsWindowVisible(long) @ stdcall IsZoomed(long)
1
0
0
0
Henri Verbeet : d2d1: Force alpha to 1.0f for clears.
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: 230785dc328a373627b242d47250cf5ee5d01540 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=230785dc328a373627b242d47…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 29 11:36:22 2015 +0200 d2d1: Force alpha to 1.0f for clears. --- dlls/d2d1/render_target.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/d2d1/render_target.c b/dlls/d2d1/render_target.c index ead6b29..6c533f2 100644 --- a/dlls/d2d1/render_target.c +++ b/dlls/d2d1/render_target.c @@ -1133,6 +1133,7 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_PopAxisAlignedClip(ID2D1Rend static void STDMETHODCALLTYPE d2d_d3d_render_target_Clear(ID2D1RenderTarget *iface, const D2D1_COLOR_F *color) { struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + D2D1_COLOR_F c = {0.0f, 0.0f, 0.0f, 0.0f}; D3D10_SUBRESOURCE_DATA buffer_data; D3D10_BUFFER_DESC buffer_desc; ID3D10Buffer *vs_cb, *ps_cb; @@ -1162,8 +1163,11 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_Clear(ID2D1RenderTarget *ifa return; } - buffer_desc.ByteWidth = sizeof(*color); - buffer_data.pSysMem = color; + if (color) + c = *color; + c.a = 1.0f; + buffer_desc.ByteWidth = sizeof(c); + buffer_data.pSysMem = &c; if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &ps_cb))) {
1
0
0
0
Henri Verbeet : d2d1: Take the bitmap' s alpha mode into account in bitmap brushes.
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: c4503779bb82a03016cb05c815390b378f314fd9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c4503779bb82a03016cb05c81…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 29 11:36:21 2015 +0200 d2d1: Take the bitmap's alpha mode into account in bitmap brushes. --- dlls/d2d1/brush.c | 24 +++++++++++++----------- dlls/d2d1/render_target.c | 17 +++++++++++------ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c index fb40f3d..b968a65 100644 --- a/dlls/d2d1/brush.c +++ b/dlls/d2d1/brush.c @@ -728,8 +728,9 @@ HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_d3d_render_targe struct { float _11, _21, _31, pad0; - float _12, _22, _32, pad1; - } transform; + float _12, _22, _32, opacity; + BOOL ignore_alpha; + } bitmap_brush_cb; D2D1_COLOR_F color; HRESULT hr; @@ -783,17 +784,18 @@ HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_d3d_render_targe d = b._11 * b._22 - b._21 * b._12; if (d != 0.0f) { - transform._11 = b._22 / d; - transform._21 = -b._21 / d; - transform._31 = (b._21 * b._32 - b._31 * b._22) / d; - transform._12 = -b._12 / d; - transform._22 = b._11 / d; - transform._32 = -(b._11 * b._32 - b._31 * b._12) / d; + bitmap_brush_cb._11 = b._22 / d; + bitmap_brush_cb._21 = -b._21 / d; + bitmap_brush_cb._31 = (b._21 * b._32 - b._31 * b._22) / d; + bitmap_brush_cb._12 = -b._12 / d; + bitmap_brush_cb._22 = b._11 / d; + bitmap_brush_cb._32 = -(b._11 * b._32 - b._31 * b._12) / d; } - transform.pad1 = brush->opacity; + bitmap_brush_cb.opacity = brush->opacity; + bitmap_brush_cb.ignore_alpha = bitmap->format.alphaMode == D2D1_ALPHA_MODE_IGNORE; - buffer_desc.ByteWidth = sizeof(transform); - buffer_data.pSysMem = &transform; + buffer_desc.ByteWidth = sizeof(bitmap_brush_cb); + buffer_data.pSysMem = &bitmap_brush_cb; } else { diff --git a/dlls/d2d1/render_target.c b/dlls/d2d1/render_target.c index 1c641e7..ead6b29 100644 --- a/dlls/d2d1/render_target.c +++ b/dlls/d2d1/render_target.c @@ -1564,6 +1564,7 @@ HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, #if 0 float3x2 transform; float opacity; + bool ignore_alpha; SamplerState s; Texture2D t; @@ -1576,26 +1577,30 @@ HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, texcoord.x = position.x * transform._11 + position.y * transform._21 + transform._31; texcoord.y = position.x * transform._12 + position.y * transform._22 + transform._32; ret = t.Sample(s, texcoord); - ret.a *= opacity; + if (ignore_alpha) + ret.a = opacity; + else + ret.a *= opacity; return ret; } #endif - 0x43425844, 0x9a5f9280, 0xa5351c23, 0x15d6e760, 0xce35bcc3, 0x00000001, 0x000001d0, 0x00000003, + 0x43425844, 0xf2e9967c, 0xad1d1ac2, 0x865274b8, 0x6ab4c5ca, 0x00000001, 0x000001fc, 0x00000003, 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, - 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000134, 0x00000040, - 0x0000004d, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0300005a, 0x00106000, 0x00000000, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000160, 0x00000040, + 0x00000058, 0x04000059, 0x00208e46, 0x00000000, 0x00000003, 0x0300005a, 0x00106000, 0x00000000, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04002064, 0x00101032, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0800000f, 0x00100012, 0x00000000, 0x00101046, 0x00000000, 0x00208046, 0x00000000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0020802a, 0x00000000, 0x00000000, 0x0800000f, 0x00100042, 0x00000000, 0x00101046, 0x00000000, 0x00208046, 0x00000000, 0x00000001, 0x08000000, 0x00100022, 0x00000000, 0x0010002a, 0x00000000, 0x0020802a, 0x00000000, 0x00000001, 0x09000045, 0x001000f2, 0x00000000, - 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x00102082, + 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x00100082, 0x00000000, 0x0010003a, 0x00000000, 0x0020803a, 0x00000000, 0x00000001, 0x05000036, 0x00102072, - 0x00000000, 0x00100246, 0x00000000, 0x0100003e, + 0x00000000, 0x00100246, 0x00000000, 0x0b000037, 0x00102082, 0x00000000, 0x0020800a, 0x00000000, + 0x00000002, 0x0020803a, 0x00000000, 0x00000001, 0x0010003a, 0x00000000, 0x0100003e, }; /* The basic idea here is to evaluate the implicit form of the curve in * texture space. "t.z" determines which side of the curve is shaded. */
1
0
0
0
Henri Verbeet : d2d1: Implement d2d_bitmap_brush_SetBitmap().
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: d742887b7fe957108f59c1e8741dfd9c46fa86e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d742887b7fe957108f59c1e87…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 29 11:36:20 2015 +0200 d2d1: Implement d2d_bitmap_brush_SetBitmap(). --- dlls/d2d1/brush.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c index 5c45d3c..fb40f3d 100644 --- a/dlls/d2d1/brush.c +++ b/dlls/d2d1/brush.c @@ -501,6 +501,8 @@ static ULONG STDMETHODCALLTYPE d2d_bitmap_brush_Release(ID2D1BitmapBrush *iface) { if (brush->u.bitmap.sampler_state) ID3D10SamplerState_Release(brush->u.bitmap.sampler_state); + if (brush->u.bitmap.bitmap) + ID2D1Bitmap_Release(&brush->u.bitmap.bitmap->ID2D1Bitmap_iface); HeapFree(GetProcessHeap(), 0, brush); } @@ -598,7 +600,15 @@ static void STDMETHODCALLTYPE d2d_bitmap_brush_SetInterpolationMode(ID2D1BitmapB static void STDMETHODCALLTYPE d2d_bitmap_brush_SetBitmap(ID2D1BitmapBrush *iface, ID2D1Bitmap *bitmap) { - FIXME("iface %p, bitmap %p stub!\n", iface, bitmap); + struct d2d_brush *brush = impl_from_ID2D1BitmapBrush(iface); + + TRACE("iface %p, bitmap %p.\n", iface, bitmap); + + if (bitmap) + ID2D1Bitmap_AddRef(bitmap); + if (brush->u.bitmap.bitmap) + ID2D1Bitmap_Release(&brush->u.bitmap.bitmap->ID2D1Bitmap_iface); + brush->u.bitmap.bitmap = unsafe_impl_from_ID2D1Bitmap(bitmap); } static D2D1_EXTEND_MODE STDMETHODCALLTYPE d2d_bitmap_brush_GetExtendModeX(ID2D1BitmapBrush *iface) @@ -666,7 +676,8 @@ HRESULT d2d_bitmap_brush_init(struct d2d_brush *brush, struct d2d_d3d_render_tar d2d_brush_init(brush, &render_target->ID2D1RenderTarget_iface, D2D_BRUSH_TYPE_BITMAP, brush_desc, (ID2D1BrushVtbl *)&d2d_bitmap_brush_vtbl); - brush->u.bitmap.bitmap = unsafe_impl_from_ID2D1Bitmap(bitmap); + if ((brush->u.bitmap.bitmap = unsafe_impl_from_ID2D1Bitmap(bitmap))) + ID2D1Bitmap_AddRef(&brush->u.bitmap.bitmap->ID2D1Bitmap_iface); if (bitmap_brush_desc) { brush->u.bitmap.extend_mode_x = bitmap_brush_desc->extendModeX;
1
0
0
0
Henri Verbeet : d2d1: Implement d2d_bitmap_GetPixelFormat().
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: a2f41ed5b662999572a9f91a5660186af2d0b9fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a2f41ed5b662999572a9f91a5…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 29 11:36:19 2015 +0200 d2d1: Implement d2d_bitmap_GetPixelFormat(). --- dlls/d2d1/bitmap.c | 8 +++++--- dlls/d2d1/d2d1_private.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c index 2439d79..be03b66 100644 --- a/dlls/d2d1/bitmap.c +++ b/dlls/d2d1/bitmap.c @@ -103,10 +103,11 @@ static D2D1_SIZE_U * STDMETHODCALLTYPE d2d_bitmap_GetPixelSize(ID2D1Bitmap *ifac static D2D1_PIXEL_FORMAT * STDMETHODCALLTYPE d2d_bitmap_GetPixelFormat(ID2D1Bitmap *iface, D2D1_PIXEL_FORMAT *format) { - FIXME("iface %p stub!\n", iface); + struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap(iface); + + TRACE("iface %p, format %p.\n", iface, format); - format->format = DXGI_FORMAT_UNKNOWN; - format->alphaMode = D2D1_ALPHA_MODE_UNKNOWN; + *format = bitmap->format; return format; } @@ -242,6 +243,7 @@ HRESULT d2d_bitmap_init(struct d2d_bitmap *bitmap, struct d2d_d3d_render_target } bitmap->pixel_size = size; + bitmap->format = desc->pixelFormat; bitmap->dpi_x = desc->dpiX; bitmap->dpi_y = desc->dpiY; diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 0c564fa..96a0bb8 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -184,6 +184,7 @@ struct d2d_bitmap ID3D10ShaderResourceView *view; D2D1_SIZE_U pixel_size; + D2D1_PIXEL_FORMAT format; float dpi_x; float dpi_y; };
1
0
0
0
Henri Verbeet : d2d1: Validate bitmap formats.
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: 1b3574ebc0adb2fb05413fe6ed11607455a7aabb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1b3574ebc0adb2fb05413fe6e…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 29 11:36:18 2015 +0200 d2d1: Validate bitmap formats. --- dlls/d2d1/bitmap.c | 40 +++++++++++++++++++++++++ dlls/d2d1/tests/d2d1.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c index ccc8d75..2439d79 100644 --- a/dlls/d2d1/bitmap.c +++ b/dlls/d2d1/bitmap.c @@ -165,8 +165,48 @@ HRESULT d2d_bitmap_init(struct d2d_bitmap *bitmap, struct d2d_d3d_render_target D3D10_SUBRESOURCE_DATA resource_data; D3D10_TEXTURE2D_DESC texture_desc; ID3D10Texture2D *texture; + BOOL supported = FALSE; + unsigned int i; HRESULT hr; + static const D2D1_PIXEL_FORMAT supported_formats[] = + { + {DXGI_FORMAT_R32G32B32A32_FLOAT, D2D1_ALPHA_MODE_PREMULTIPLIED}, + {DXGI_FORMAT_R32G32B32A32_FLOAT, D2D1_ALPHA_MODE_IGNORE }, + {DXGI_FORMAT_R16G16B16A16_FLOAT, D2D1_ALPHA_MODE_PREMULTIPLIED}, + {DXGI_FORMAT_R16G16B16A16_FLOAT, D2D1_ALPHA_MODE_IGNORE }, + {DXGI_FORMAT_R16G16B16A16_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}, + {DXGI_FORMAT_R16G16B16A16_UNORM, D2D1_ALPHA_MODE_IGNORE }, + {DXGI_FORMAT_R8G8B8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}, + {DXGI_FORMAT_R8G8B8A8_UNORM, D2D1_ALPHA_MODE_IGNORE }, + {DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D2D1_ALPHA_MODE_PREMULTIPLIED}, + {DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D2D1_ALPHA_MODE_IGNORE }, + {DXGI_FORMAT_A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}, + {DXGI_FORMAT_A8_UNORM, D2D1_ALPHA_MODE_STRAIGHT }, + {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}, + {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE }, + {DXGI_FORMAT_B8G8R8X8_UNORM, D2D1_ALPHA_MODE_IGNORE }, + {DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, D2D1_ALPHA_MODE_PREMULTIPLIED}, + {DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, D2D1_ALPHA_MODE_IGNORE }, + }; + + for (i = 0; i < sizeof(supported_formats) / sizeof(*supported_formats); ++i) + { + if (supported_formats[i].format == desc->pixelFormat.format + && supported_formats[i].alphaMode == desc->pixelFormat.alphaMode) + { + supported = TRUE; + break; + } + } + + if (!supported) + { + WARN("Tried to create bitmap with unsupported format {%#x / %#x}.\n", + desc->pixelFormat.format, desc->pixelFormat.alphaMode); + return D2DERR_UNSUPPORTED_PIXEL_FORMAT; + } + FIXME("Ignoring bitmap properties.\n"); bitmap->ID2D1Bitmap_iface.lpVtbl = &d2d_bitmap_vtbl; diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index f8ebecc..4d83154 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -1530,6 +1530,85 @@ static void test_path_geometry(void) DestroyWindow(window); } +static void test_bitmap_formats(void) +{ + D2D1_BITMAP_PROPERTIES bitmap_desc; + IDXGISwapChain *swapchain; + D2D1_SIZE_U size = {4, 4}; + ID2D1RenderTarget *rt; + ID3D10Device1 *device; + IDXGISurface *surface; + ID2D1Bitmap *bitmap; + unsigned int i, j; + HWND window; + HRESULT hr; + + static const struct + { + DXGI_FORMAT format; + DWORD mask; + } + bitmap_formats[] = + { + {DXGI_FORMAT_R32G32B32A32_FLOAT, 0x8a}, + {DXGI_FORMAT_R16G16B16A16_FLOAT, 0x8a}, + {DXGI_FORMAT_R16G16B16A16_UNORM, 0x8a}, + {DXGI_FORMAT_R8G8B8A8_TYPELESS, 0x00}, + {DXGI_FORMAT_R8G8B8A8_UNORM, 0x0a}, + {DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, 0x8a}, + {DXGI_FORMAT_R8G8B8A8_UINT, 0x00}, + {DXGI_FORMAT_R8G8B8A8_SNORM, 0x00}, + {DXGI_FORMAT_R8G8B8A8_SINT, 0x00}, + {DXGI_FORMAT_A8_UNORM, 0x06}, + {DXGI_FORMAT_B8G8R8A8_UNORM, 0x0a}, + {DXGI_FORMAT_B8G8R8X8_UNORM, 0x88}, + {DXGI_FORMAT_B8G8R8A8_TYPELESS, 0x00}, + {DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, 0x8a}, + }; + + if (!(device = create_device())) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + swapchain = create_swapchain(device, window, TRUE); + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface); + ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr); + rt = create_render_target(surface); + ok(!!rt, "Failed to create render target.\n"); + + bitmap_desc.dpiX = 96.0f; + bitmap_desc.dpiY = 96.0f; + for (i = 0; i < sizeof(bitmap_formats) / sizeof(*bitmap_formats); ++i) + { + for (j = 0; j < 4; ++j) + { + if ((bitmap_formats[i].mask & (0x80 | (1u << j))) == (0x80 | (1u << j))) + continue; + + bitmap_desc.pixelFormat.format = bitmap_formats[i].format; + bitmap_desc.pixelFormat.alphaMode = j; + hr = ID2D1RenderTarget_CreateBitmap(rt, size, NULL, 0, &bitmap_desc, &bitmap); + if (bitmap_formats[i].mask & (1u << j)) + ok(hr == S_OK, "Got unexpected hr %#x, for format %#x/%#x.\n", + hr, bitmap_formats[i].format, j); + else + ok(hr == D2DERR_UNSUPPORTED_PIXEL_FORMAT, "Got unexpected hr %#x, for format %#x/%#x.\n", + hr, bitmap_formats[i].format, j); + if (SUCCEEDED(hr)) + ID2D1Bitmap_Release(bitmap); + } + } + + ID2D1RenderTarget_Release(rt); + IDXGISurface_Release(surface); + IDXGISwapChain_Release(swapchain); + ID3D10Device1_Release(device); + DestroyWindow(window); +} + START_TEST(d2d1) { test_clip(); @@ -1537,4 +1616,5 @@ START_TEST(d2d1) test_color_brush(); test_bitmap_brush(); test_path_geometry(); + test_bitmap_formats(); }
1
0
0
0
Nikolay Sivov : dwrite: Implement parameter validation for CreateAlphaTexture().
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: 5137aaa9c9b372ee6b5380eaf4a85d6bf500d0c3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5137aaa9c9b372ee6b5380eaf…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jul 29 12:00:26 2015 +0300 dwrite: Implement parameter validation for CreateAlphaTexture(). --- dlls/dwrite/font.c | 109 +++++++++++++++++++++++++----------- dlls/dwrite/tests/font.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+), 31 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5137aaa9c9b372ee6b538…
1
0
0
0
Nikolay Sivov : dwrite: Implement GetAlphaTextureBounds().
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: b50416aa5fd10911856cfff241a7013b7fbaf944 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b50416aa5fd10911856cfff24…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jul 29 11:59:02 2015 +0300 dwrite: Implement GetAlphaTextureBounds(). --- dlls/dwrite/dwrite_private.h | 3 ++- dlls/dwrite/font.c | 62 +++++++++++++++++++++++++++++++++++++++++--- dlls/dwrite/freetype.c | 40 ++++++++++++++++++++++++++-- dlls/dwrite/main.c | 4 +-- dlls/dwrite/tests/font.c | 12 +++------ 5 files changed, 103 insertions(+), 18 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b50416aa5fd10911856cf…
1
0
0
0
Nikolay Sivov : dwrite: Implement GetAlphaBlendParams().
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: 2c6eca8682bd216c7579796aa96fd68f98dafcc1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2c6eca8682bd216c7579796aa…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jul 29 11:58:24 2015 +0300 dwrite: Implement GetAlphaBlendParams(). --- dlls/dwrite/font.c | 34 +++++++++++++-- dlls/dwrite/tests/font.c | 110 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 3 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 9876451..3f016d6 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -2933,11 +2933,39 @@ static HRESULT WINAPI glyphrunanalysis_CreateAlphaTexture(IDWriteGlyphRunAnalysi } static HRESULT WINAPI glyphrunanalysis_GetAlphaBlendParams(IDWriteGlyphRunAnalysis *iface, IDWriteRenderingParams *params, - FLOAT *blendGamma, FLOAT *blendEnhancedContrast, FLOAT *blendClearTypeLevel) + FLOAT *gamma, FLOAT *contrast, FLOAT *cleartypelevel) { struct dwrite_glyphrunanalysis *This = impl_from_IDWriteGlyphRunAnalysis(iface); - FIXME("(%p)->(%p %p %p %p): stub\n", This, params, blendGamma, blendEnhancedContrast, blendClearTypeLevel); - return E_NOTIMPL; + + TRACE("(%p)->(%p %p %p %p)\n", This, params, gamma, contrast, cleartypelevel); + + if (!params) + return E_INVALIDARG; + + switch (This->rendering_mode) + { + case DWRITE_RENDERING_MODE_GDI_CLASSIC: + case DWRITE_RENDERING_MODE_GDI_NATURAL: + { + UINT value = 0; + SystemParametersInfoW(SPI_GETFONTSMOOTHINGCONTRAST, 0, &value, 0); + *gamma = (FLOAT)value / 1000.0f; + *contrast = 0.0f; + *cleartypelevel = 1.0f; + break; + } + case DWRITE_RENDERING_MODE_ALIASED: + case DWRITE_RENDERING_MODE_NATURAL: + case DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC: + *gamma = IDWriteRenderingParams_GetGamma(params); + *contrast = IDWriteRenderingParams_GetEnhancedContrast(params); + *cleartypelevel = IDWriteRenderingParams_GetClearTypeLevel(params); + break; + default: + ; + } + + return S_OK; } static const struct IDWriteGlyphRunAnalysisVtbl glyphrunanalysisvtbl = { diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index bd001e7..502930f 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -20,6 +20,7 @@ */ #include <math.h> +#include <limits.h> #define COBJMACROS @@ -4346,6 +4347,114 @@ if (0) /* crashes on native */ IDWriteFactory_Release(factory); } +static inline BOOL float_eq(FLOAT left, FLOAT right) +{ + int x = *(int *)&left; + int y = *(int *)&right; + + if (x < 0) + x = INT_MIN - x; + if (y < 0) + y = INT_MIN - y; + + return abs(x - y) <= 8; +} + +static void test_GetAlphaBlendParams(void) +{ + static const DWRITE_RENDERING_MODE rendermodes[] = { + DWRITE_RENDERING_MODE_ALIASED, + DWRITE_RENDERING_MODE_GDI_CLASSIC, + DWRITE_RENDERING_MODE_GDI_NATURAL, + DWRITE_RENDERING_MODE_NATURAL, + DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, + }; + + IDWriteGlyphRunAnalysis *analysis; + FLOAT gamma, contrast, ctlevel; + IDWriteRenderingParams *params; + DWRITE_GLYPH_METRICS metrics; + DWRITE_GLYPH_OFFSET offset; + IDWriteFontFace *fontface; + IDWriteFactory *factory; + DWRITE_GLYPH_RUN run; + FLOAT advance, expected_gdi_gamma; + UINT value = 0; + UINT16 glyph; + UINT32 ch, i; + HRESULT hr; + BOOL ret; + + factory = create_factory(); + fontface = create_fontface(factory); + + ch = 'A'; + glyph = 0; + hr = IDWriteFontFace_GetGlyphIndices(fontface, &ch, 1, &glyph); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(glyph > 0, "got %u\n", glyph); + + hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, &glyph, 1, &metrics, FALSE); + ok(hr == S_OK, "got 0x%08x\n", hr); + advance = metrics.advanceWidth; + + offset.advanceOffset = 0.0; + offset.ascenderOffset = 0.0; + + run.fontFace = fontface; + run.fontEmSize = 24.0; + run.glyphCount = 1; + run.glyphIndices = &glyph; + run.glyphAdvances = &advance; + run.glyphOffsets = &offset; + run.isSideways = FALSE; + run.bidiLevel = 0; + + hr = IDWriteFactory_CreateCustomRenderingParams(factory, 0.9, 0.3, 0.1, DWRITE_PIXEL_GEOMETRY_RGB, + DWRITE_RENDERING_MODE_DEFAULT, ¶ms); + ok(hr == S_OK, "got 0x%08x\n", hr); + + value = 0; + ret = SystemParametersInfoW(SPI_GETFONTSMOOTHINGCONTRAST, 0, &value, 0); + ok(ret, "got %d\n", ret); + expected_gdi_gamma = (FLOAT)(value / 1000.0); + + for (i = 0; i < sizeof(rendermodes)/sizeof(rendermodes[0]); i++) { + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, + rendermodes[i], DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, &analysis); + ok(hr == S_OK, "got 0x%08x\n", hr); + + gamma = contrast = ctlevel = -1.0; + hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis, NULL, &gamma, &contrast, &ctlevel); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(gamma == -1.0, "got %.2f\n", gamma); + ok(contrast == -1.0, "got %.2f\n", contrast); + ok(ctlevel == -1.0, "got %.2f\n", ctlevel); + + gamma = contrast = ctlevel = -1.0; + hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis, params, &gamma, &contrast, &ctlevel); + ok(hr == S_OK, "got 0x%08x\n", hr); + + if (rendermodes[i] == DWRITE_RENDERING_MODE_GDI_CLASSIC || rendermodes[i] == DWRITE_RENDERING_MODE_GDI_NATURAL) { + ok(float_eq(gamma, expected_gdi_gamma), "got %.2f, expected %.2f\n", gamma, expected_gdi_gamma); + ok(contrast == 0.0f, "got %.2f\n", contrast); + ok(ctlevel == 1.0f, "got %.2f\n", ctlevel); + } + else { + ok(gamma == 0.9f, "got %.2f\n", gamma); + ok(contrast == 0.3f, "got %.2f\n", contrast); + ok(ctlevel == 0.1f, "got %.2f\n", ctlevel); + } + + IDWriteGlyphRunAnalysis_Release(analysis); + } + + IDWriteRenderingParams_Release(params); + IDWriteFontFace_Release(fontface); + IDWriteFactory_Release(factory); +} + START_TEST(font) { IDWriteFactory *factory; @@ -4393,6 +4502,7 @@ START_TEST(font) test_GetPanose(); test_GetGdiCompatibleGlyphAdvances(); test_GetRecommendedRenderingMode(); + test_GetAlphaBlendParams(); IDWriteFactory_Release(factory); }
1
0
0
0
Nikolay Sivov : dwrite: Store run info for IDWriteGlyphRunAnalysis instance.
by Alexandre Julliard
29 Jul '15
29 Jul '15
Module: wine Branch: master Commit: fb35557db96c97b6a13ed73a8da6bafac364285e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fb35557db96c97b6a13ed73a8…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jul 29 11:57:52 2015 +0300 dwrite: Store run info for IDWriteGlyphRunAnalysis instance. --- dlls/dwrite/dwrite_private.h | 2 +- dlls/dwrite/font.c | 35 ++++++++++++++++++++++++++++++++++- dlls/dwrite/main.c | 8 ++++---- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 65cf4b0..aa24550 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -124,7 +124,7 @@ extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *refer extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN; extern HRESULT create_fontface(DWRITE_FONT_FACE_TYPE,UINT32,IDWriteFontFile* const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace2**) DECLSPEC_HIDDEN; extern HRESULT create_font_collection(IDWriteFactory2*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection**) DECLSPEC_HIDDEN; -extern HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN; +extern HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE,DWRITE_GLYPH_RUN const*,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN; extern BOOL is_system_collection(IDWriteFontCollection*) DECLSPEC_HIDDEN; extern HRESULT get_local_refkey(const WCHAR*,const FILETIME*,void**,UINT32*) DECLSPEC_HIDDEN; extern HRESULT get_filestream_from_file(IDWriteFontFile*,IDWriteFontFileStream**) DECLSPEC_HIDDEN; diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 4fdea6c..9876451 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -111,6 +111,10 @@ struct dwrite_glyphrunanalysis { LONG ref; DWRITE_RENDERING_MODE rendering_mode; + DWRITE_GLYPH_RUN run; + UINT16 *glyphs; + FLOAT *advances; + DWRITE_GLYPH_OFFSET *offsets; }; #define GLYPH_BLOCK_SHIFT 8 @@ -2890,6 +2894,10 @@ static ULONG WINAPI glyphrunanalysis_Release(IDWriteGlyphRunAnalysis *iface) TRACE("(%p)->(%u)\n", This, ref); if (!ref) { + IDWriteFontFace_Release(This->run.fontFace); + heap_free(This->glyphs); + heap_free(This->advances); + heap_free(This->offsets); heap_free(This); } @@ -2941,7 +2949,7 @@ static const struct IDWriteGlyphRunAnalysisVtbl glyphrunanalysisvtbl = { glyphrunanalysis_GetAlphaBlendParams }; -HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, IDWriteGlyphRunAnalysis **ret) +HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_GLYPH_RUN const *run, IDWriteGlyphRunAnalysis **ret) { struct dwrite_glyphrunanalysis *analysis; @@ -2958,6 +2966,31 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, IDWriteGly analysis->IDWriteGlyphRunAnalysis_iface.lpVtbl = &glyphrunanalysisvtbl; analysis->ref = 1; analysis->rendering_mode = rendering_mode; + analysis->run = *run; + IDWriteFontFace_AddRef(analysis->run.fontFace); + analysis->glyphs = heap_alloc(run->glyphCount*sizeof(*run->glyphIndices)); + analysis->advances = heap_alloc(run->glyphCount*sizeof(*run->glyphAdvances)); + analysis->offsets = heap_alloc(run->glyphCount*sizeof(*run->glyphOffsets)); + if (!analysis->glyphs || !analysis->advances || !analysis->offsets) { + heap_free(analysis->glyphs); + heap_free(analysis->advances); + heap_free(analysis->offsets); + + analysis->glyphs = NULL; + analysis->advances = NULL; + analysis->offsets = NULL; + + IDWriteGlyphRunAnalysis_Release(&analysis->IDWriteGlyphRunAnalysis_iface); + return E_OUTOFMEMORY; + } + + analysis->run.glyphIndices = analysis->glyphs; + analysis->run.glyphAdvances = analysis->advances; + analysis->run.glyphOffsets = analysis->offsets; + + memcpy(analysis->glyphs, run->glyphIndices, run->glyphCount*sizeof(*run->glyphIndices)); + memcpy(analysis->advances, run->glyphAdvances, run->glyphCount*sizeof(*run->glyphAdvances)); + memcpy(analysis->offsets, run->glyphOffsets, run->glyphCount*sizeof(*run->glyphOffsets)); *ret = &analysis->IDWriteGlyphRunAnalysis_iface; return S_OK; diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c index 96b4925..7c027f9 100644 --- a/dlls/dwrite/main.c +++ b/dlls/dwrite/main.c @@ -1070,16 +1070,16 @@ static HRESULT WINAPI dwritefactory_CreateNumberSubstitution(IDWriteFactory2 *if return create_numbersubstitution(method, locale, ignore_user_override, substitution); } -static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory2 *iface, DWRITE_GLYPH_RUN const *glyph_run, - FLOAT pixels_per_dip, DWRITE_MATRIX const* transform, DWRITE_RENDERING_MODE rendering_mode, +static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory2 *iface, DWRITE_GLYPH_RUN const *run, + FLOAT ppdip, DWRITE_MATRIX const* transform, DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, FLOAT baseline_x, FLOAT baseline_y, IDWriteGlyphRunAnalysis **analysis) { struct dwritefactory *This = impl_from_IDWriteFactory2(iface); - TRACE("(%p)->(%p %f %p %d %d %f %f %p)\n", This, glyph_run, pixels_per_dip, transform, rendering_mode, + TRACE("(%p)->(%p %f %p %d %d %f %f %p)\n", This, run, ppdip, transform, rendering_mode, measuring_mode, baseline_x, baseline_y, analysis); - return create_glyphrunanalysis(rendering_mode, analysis); + return create_glyphrunanalysis(rendering_mode, run, analysis); } static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory2 *iface, IDWriteFontCollection **collection,
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
57
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Results per page:
10
25
50
100
200