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
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
List overview
wine-commits
November 2011
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
852 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11: Get rid of the non-Xrender client-side font rendering.
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: b61a534853ab5a20ce050b9285842363dc10c2c0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b61a534853ab5a20ce050b928…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 17 20:26:23 2011 +0100 winex11: Get rid of the non-Xrender client-side font rendering. --- dlls/winex11.drv/xrender.c | 561 +++++--------------------------------------- 1 files changed, 62 insertions(+), 499 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b61a534853ab5a20ce050…
1
0
0
0
Alexandre Julliard : gdi32: Add support for anti-aliasing in the null driver text output fallback.
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: 670f25cc8f7bc69e14f65f886b5a6bb30414df51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=670f25cc8f7bc69e14f65f886…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 17 16:55:16 2011 +0100 gdi32: Add support for anti-aliasing in the null driver text output fallback. --- dlls/gdi32/dibdrv/dibdrv.h | 1 + dlls/gdi32/dibdrv/graphics.c | 113 ++++++++++++++++++++++++++++++++++++--- dlls/gdi32/dibdrv/objects.c | 17 +++--- dlls/gdi32/font.c | 121 +++++++++++++++++++++++++++++++++++++++++- dlls/gdi32/gdi_private.h | 3 + 5 files changed, 236 insertions(+), 19 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=670f25cc8f7bc69e14f65…
1
0
0
0
Alexandre Julliard : gdi32: Add a helper function to determine anti-aliasing flags.
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: 1b63d5a6101ee9d8fb27726c0cabc4d15e81cf30 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1b63d5a6101ee9d8fb27726c0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 17 12:01:58 2011 +0100 gdi32: Add a helper function to determine anti-aliasing flags. --- dlls/gdi32/dibdrv/graphics.c | 22 +++++----------------- dlls/gdi32/font.c | 19 +++++++++++++++++++ dlls/gdi32/gdi_private.h | 3 +++ 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c index 0e55af1..3a9880d 100644 --- a/dlls/gdi32/dibdrv/graphics.c +++ b/dlls/gdi32/dibdrv/graphics.c @@ -157,19 +157,6 @@ static void draw_glyph( dibdrv_physdev *pdev, const POINT *origin, const GLYPHME release_wine_region( pdev->clip ); } -static inline UINT get_aa_flags( dibdrv_physdev *pdev ) -{ - LOGFONTW lf; - - if (pdev->dib.bit_count <= 8) return GGO_BITMAP; - - GetObjectW( GetCurrentObject( pdev->dev.hdc, OBJ_FONT ), sizeof(lf), &lf ); - if (lf.lfQuality == NONANTIALIASED_QUALITY) return GGO_BITMAP; - - /* FIXME, check gasp and user prefs */ - return GGO_GRAY4_BITMAP; -} - static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; static const int padding[4] = {0, 3, 2, 1}; @@ -181,10 +168,10 @@ static const int padding[4] = {0, 3, 2, 1}; * For non-antialiased bitmaps convert them to the 17-level format * using only values 0 or 16. */ -static DWORD get_glyph_bitmap( dibdrv_physdev *pdev, UINT index, GLYPHMETRICS *metrics, +static DWORD get_glyph_bitmap( dibdrv_physdev *pdev, UINT index, UINT aa_flags, GLYPHMETRICS *metrics, struct gdi_image_bits *image ) { - UINT aa_flags = get_aa_flags( pdev ), ggo_flags = aa_flags | GGO_GLYPH_INDEX; + UINT ggo_flags = aa_flags | GGO_GLYPH_INDEX; static const MAT2 identity = { {0,1}, {0,0}, {0,0}, {0,1} }; UINT indices[3] = {0, 0, 0x20}; int i, x, y; @@ -253,7 +240,7 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect, LPCWSTR str, UINT count, const INT *dx ) { dibdrv_physdev *pdev = get_dibdrv_pdev(dev); - UINT i; + UINT aa_flags, i; POINT origin; DWORD err; HRGN saved_clip = NULL; @@ -274,6 +261,7 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, DeleteObject( clip ); } + aa_flags = get_font_aa_flags( dev->hdc ); origin.x = x; origin.y = y; for (i = 0; i < count; i++) @@ -281,7 +269,7 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, GLYPHMETRICS metrics; struct gdi_image_bits image; - err = get_glyph_bitmap( pdev, (UINT)str[i], &metrics, &image ); + err = get_glyph_bitmap( pdev, (UINT)str[i], aa_flags, &metrics, &image ); if (err) continue; if (image.ptr) draw_glyph( pdev, &origin, &metrics, &image ); diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index ee824f0..60e04c5 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -258,6 +258,25 @@ static void FONT_NewTextMetricExWToA(const NEWTEXTMETRICEXW *ptmW, NEWTEXTMETRIC } +UINT get_font_aa_flags( HDC hdc ) +{ + LOGFONTW lf; + + if (GetObjectType( hdc ) == OBJ_MEMDC) + { + BITMAP bm; + GetObjectW( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bm), &bm ); + if (bm.bmBitsPixel <= 8) return GGO_BITMAP; + } + else if (GetDeviceCaps( hdc, BITSPIXEL ) <= 8) return GGO_BITMAP; + + GetObjectW( GetCurrentObject( hdc, OBJ_FONT ), sizeof(lf), &lf ); + if (lf.lfQuality == NONANTIALIASED_QUALITY) return GGO_BITMAP; + + /* FIXME, check gasp and user prefs */ + return GGO_GRAY4_BITMAP; +} + /*********************************************************************** * GdiGetCodePage (GDI32.@) */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index d8a793f..70dc521 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -278,6 +278,9 @@ extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size ) DE /* enhmetafile.c */ extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk ) DECLSPEC_HIDDEN; +/* font.c */ +extern UINT get_font_aa_flags( HDC hdc ) DECLSPEC_HIDDEN; + /* freetype.c */ /* Undocumented structure filled in by GdiRealizationInfo */
1
0
0
0
Alexandre Julliard : gdi32: Add a null driver fallback implementation for non-antialiased text output.
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: 5282ffadaddbfe858d50f57d6363d11a8dae8ad5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5282ffadaddbfe858d50f57d6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 17 11:57:53 2011 +0100 gdi32: Add a null driver fallback implementation for non-antialiased text output. --- dlls/gdi32/driver.c | 6 -- dlls/gdi32/font.c | 150 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/gdi32/gdi_private.h | 2 + 3 files changed, 152 insertions(+), 6 deletions(-) diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 9b951d0..0610347 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -301,12 +301,6 @@ static BOOL nulldrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UIN return TRUE; } -static BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect, - LPCWSTR str, UINT count, const INT *dx ) -{ - return TRUE; -} - static BOOL nulldrv_FontIsLinked( PHYSDEV dev ) { return FALSE; diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 97cc2b6..ee824f0 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1607,6 +1607,156 @@ BOOL WINAPI GetCharWidth32A( HDC hdc, UINT firstChar, UINT lastChar, } +/* helper for nulldrv_ExtTextOut */ +static DWORD get_glyph_bitmap( HDC hdc, UINT index, UINT aa_flags, + GLYPHMETRICS *metrics, struct gdi_image_bits *image ) +{ + UINT ggo_flags = aa_flags | GGO_GLYPH_INDEX; + static const MAT2 identity = { {0,1}, {0,0}, {0,0}, {0,1} }; + UINT indices[3] = {0, 0, 0x20}; + int i; + DWORD ret, size; + int stride; + + indices[0] = index; + + for (i = 0; i < sizeof(indices) / sizeof(indices[0]); index = indices[++i]) + { + ret = GetGlyphOutlineW( hdc, index, ggo_flags, metrics, 0, NULL, &identity ); + if (ret != GDI_ERROR) break; + } + + if (ret == GDI_ERROR) return ERROR_NOT_FOUND; + if (!image) return ERROR_SUCCESS; + + image->ptr = NULL; + image->free = NULL; + if (!ret) return ERROR_SUCCESS; /* empty glyph */ + + stride = get_dib_stride( metrics->gmBlackBoxX, 1 ); + size = metrics->gmBlackBoxY * stride; + + if (!(image->ptr = HeapAlloc( GetProcessHeap(), 0, size ))) return ERROR_OUTOFMEMORY; + image->is_copy = TRUE; + image->free = free_heap_bits; + + ret = GetGlyphOutlineW( hdc, index, ggo_flags, metrics, size, image->ptr, &identity ); + if (ret == GDI_ERROR) + { + HeapFree( GetProcessHeap(), 0, image->ptr ); + return ERROR_NOT_FOUND; + } + return ERROR_SUCCESS; +} + +/* helper for nulldrv_ExtTextOut */ +static void draw_glyph( HDC hdc, INT origin_x, INT origin_y, const GLYPHMETRICS *metrics, + const struct gdi_image_bits *image, const RECT *clip ) +{ + static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; + UINT x, y, i, count; + BYTE *ptr = image->ptr; + int stride = get_dib_stride( metrics->gmBlackBoxX, 1 ); + POINT *pts; + RECT rect, clipped_rect; + + rect.left = origin_x + metrics->gmptGlyphOrigin.x; + rect.top = origin_y - metrics->gmptGlyphOrigin.y; + rect.right = rect.left + metrics->gmBlackBoxX; + rect.bottom = rect.top + metrics->gmBlackBoxY; + if (!clip) clipped_rect = rect; + else if (!intersect_rect( &clipped_rect, &rect, clip )) return; + + pts = HeapAlloc( GetProcessHeap(), 0, + max(2,metrics->gmBlackBoxX) * metrics->gmBlackBoxY * sizeof(*pts) ); + if (!pts) return; + + count = 0; + ptr += (clipped_rect.top - rect.top) * stride; + for (y = clipped_rect.top; y < clipped_rect.bottom; y++, ptr += stride) + { + for (x = clipped_rect.left - rect.left; x < clipped_rect.right - rect.left; x++) + { + while (x < clipped_rect.right - rect.left && !(ptr[x / 8] & masks[x % 8])) x++; + pts[count].x = rect.left + x; + while (x < clipped_rect.right - rect.left && (ptr[x / 8] & masks[x % 8])) x++; + pts[count + 1].x = rect.left + x; + if (pts[count + 1].x > pts[count].x) + { + pts[count].y = pts[count + 1].y = y; + count += 2; + } + } + } + DPtoLP( hdc, pts, count ); + for (i = 0; i < count; i += 2) Polyline( hdc, pts + i, 2 ); + HeapFree( GetProcessHeap(), 0, pts ); +} + +/*********************************************************************** + * nulldrv_ExtTextOut + */ +BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect, + LPCWSTR str, UINT count, const INT *dx ) +{ + UINT i; + DWORD err; + HGDIOBJ orig; + HPEN pen; + + if (flags & ETO_OPAQUE) + { + RECT rc = *rect; + HBRUSH brush = CreateSolidBrush( GetNearestColor( dev->hdc, GetBkColor(dev->hdc) )); + + if (brush) + { + orig = SelectObject( dev->hdc, brush ); + DPtoLP( dev->hdc, (POINT *)&rc, 2 ); + PatBlt( dev->hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY ); + SelectObject( dev->hdc, orig ); + DeleteObject( brush ); + } + } + + if (!count) return TRUE; + + pen = CreatePen( PS_SOLID, 1, GetTextColor(dev->hdc) ); + orig = SelectObject( dev->hdc, pen ); + + for (i = 0; i < count; i++) + { + GLYPHMETRICS metrics; + struct gdi_image_bits image; + + err = get_glyph_bitmap( dev->hdc, (UINT)str[i], GGO_BITMAP, &metrics, &image ); + if (err) continue; + + if (image.ptr) draw_glyph( dev->hdc, x, y, &metrics, &image, (flags & ETO_CLIPPED) ? rect : NULL ); + if (image.free) image.free( &image ); + + if (dx) + { + if (flags & ETO_PDY) + { + x += dx[ i * 2 ]; + y += dx[ i * 2 + 1]; + } + else x += dx[ i ]; + } + else + { + x += metrics.gmCellIncX; + y += metrics.gmCellIncY; + } + } + + SelectObject( dev->hdc, orig ); + DeleteObject( pen ); + return TRUE; +} + + /*********************************************************************** * ExtTextOutA (GDI32.@) * diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index c23a5cc..d8a793f 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -358,6 +358,8 @@ extern BOOL nulldrv_CopyBitmap( HBITMAP src, HBITMAP dst ) DECLSPEC_HIDDEN; extern BOOL nulldrv_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern INT nulldrv_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; extern INT nulldrv_ExtSelectClipRgn( PHYSDEV dev, HRGN rgn, INT mode ) DECLSPEC_HIDDEN; +extern BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect, + LPCWSTR str, UINT count, const INT *dx ) DECLSPEC_HIDDEN; extern BOOL nulldrv_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL nulldrv_FillRgn( PHYSDEV dev, HRGN rgn, HBRUSH brush ) DECLSPEC_HIDDEN; extern BOOL nulldrv_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
1
0
0
0
Huw Davies : gdi32: Add solid_line primitives.
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: 04396063c89785787b4a40b9d663d5f01c47ce50 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=04396063c89785787b4a40b9d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Nov 21 10:12:52 2011 +0000 gdi32: Add solid_line primitives. --- dlls/gdi32/dibdrv/dibdrv.h | 2 + dlls/gdi32/dibdrv/objects.c | 15 +--- dlls/gdi32/dibdrv/primitives.c | 230 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+), 13 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=04396063c89785787b4a4…
1
0
0
0
Huw Davies : gdi32: Simplify the Bresenham line drawing.
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: f168f838f1f6deb530251a0d6115d12b6bf8df2c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f168f838f1f6deb530251a0d6…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Nov 21 10:12:51 2011 +0000 gdi32: Simplify the Bresenham line drawing. --- dlls/gdi32/dibdrv/dibdrv.h | 8 +++ dlls/gdi32/dibdrv/objects.c | 147 ++++++++++++++++++++++++++----------------- 2 files changed, 97 insertions(+), 58 deletions(-) diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h index ee8e1a0..e38000e 100644 --- a/dlls/gdi32/dibdrv/dibdrv.h +++ b/dlls/gdi32/dibdrv/dibdrv.h @@ -147,6 +147,14 @@ static inline dibdrv_physdev *get_dibdrv_pdev( PHYSDEV dev ) return (dibdrv_physdev *)dev; } +struct line_params +{ + int err_start, err_add_1, err_add_2, bias; + unsigned int length; + int x_inc, y_inc; + BOOL x_major; +}; + struct stretch_params { int err_start, err_add_1, err_add_2; diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index c0dd7d2..9fbb3c9 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -545,44 +545,39 @@ int clip_line(const POINT *start, const POINT *end, const RECT *clip, } } -static void bres_line_with_bias(INT x1, INT y1, INT x2, INT y2, const bres_params *params, INT err, - BOOL last_pt, void (* callback)(dibdrv_physdev*,INT,INT), dibdrv_physdev *pdev) +static void bres_line_with_bias(const POINT *start, const struct line_params *params, + void (* callback)(dibdrv_physdev*,INT,INT), dibdrv_physdev *pdev) { - const int xadd = is_x_increasing(params->octant) ? 1 : -1; - const int yadd = is_y_increasing(params->octant) ? 1 : -1; - INT erradd; + POINT pt = *start; + int len = params->length, err = params->err_start; - if (is_xmajor(params->octant)) /* line is "more horizontal" */ + if (params->x_major) { - erradd = 2*params->dy - 2*params->dx; - while(x1 != x2) + while(len--) { - callback(pdev, x1, y1); + callback(pdev, pt.x, pt.y); if (err + params->bias > 0) { - y1 += yadd; - err += erradd; + pt.y += params->y_inc; + err += params->err_add_1; } - else err += 2*params->dy; - x1 += xadd; + else err += params->err_add_2; + pt.x += params->x_inc; } - if(last_pt) callback(pdev, x1, y1); } - else /* line is "more vertical" */ + else { - erradd = 2*params->dx - 2*params->dy; - while(y1 != y2) + while(len--) { - callback(pdev, x1, y1); + callback(pdev, pt.x, pt.y); if (err + params->bias > 0) { - x1 += xadd; - err += erradd; + pt.x += params->x_inc; + err += params->err_add_1; } - else err += 2*params->dx; - y1 += yadd; + else err += params->err_add_2; + pt.y += params->y_inc; } - if(last_pt) callback(pdev, x1, y1); } } @@ -651,38 +646,58 @@ static BOOL solid_pen_line(dibdrv_physdev *pdev, POINT *start, POINT *end) } else { - bres_params params; - INT dx = end->x - start->x; - INT dy = end->y - start->y; + bres_params clip_params; + struct line_params line_params; + INT dx = end->x - start->x, dy = end->y - start->y; + INT abs_dx = abs(dx), abs_dy = abs(dy); INT i; - params.dx = abs(dx); - params.dy = abs(dy); - params.octant = get_octant_mask(dx, dy); - params.bias = get_bias(params.octant); + clip_params.dx = abs_dx; + clip_params.dy = abs_dy; + clip_params.octant = get_octant_mask(dx, dy); + clip_params.bias = get_bias( clip_params.octant ); + + line_params.bias = clip_params.bias; + line_params.x_major = is_xmajor( clip_params.octant ); + line_params.x_inc = is_x_increasing( clip_params.octant ) ? 1 : -1; + line_params.y_inc = is_y_increasing( clip_params.octant ) ? 1 : -1; + + if (line_params.x_major) + { + line_params.err_add_1 = 2 * abs_dy - 2 * abs_dx; + line_params.err_add_2 = 2 * abs_dy; + } + else + { + line_params.err_add_1 = 2 * abs_dx - 2 * abs_dy; + line_params.err_add_2 = 2 * abs_dx; + } for(i = 0; i < clip->numRects; i++) { POINT clipped_start, clipped_end; int clip_status; - clip_status = clip_line(start, end, clip->rects + i, ¶ms, &clipped_start, &clipped_end); + clip_status = clip_line(start, end, clip->rects + i, &clip_params, &clipped_start, &clipped_end); if(clip_status) { int m = abs(clipped_start.x - start->x); int n = abs(clipped_start.y - start->y); - int err; - BOOL last_pt = FALSE; - if(is_xmajor(params.octant)) - err = 2 * params.dy - params.dx + m * 2 * params.dy - n * 2 * params.dx; + if (line_params.x_major) + { + line_params.err_start = 2 * abs_dy - abs_dx + m * 2 * abs_dy - n * 2 * abs_dx; + line_params.length = abs( clipped_end.x - clipped_start.x ) + 1; + } else - err = 2 * params.dx - params.dy + n * 2 * params.dx - m * 2 * params.dy; + { + line_params.err_start = 2 * abs_dx - abs_dy + n * 2 * abs_dx - m * 2 * abs_dy; + line_params.length = abs( clipped_end.y - clipped_start.y ) + 1; + } - if(clip_status == 1 && (end->x != clipped_end.x || end->y != clipped_end.y)) last_pt = TRUE; + if (clipped_end.x == end->x && clipped_end.y == end->y) line_params.length--; - bres_line_with_bias(clipped_start.x, clipped_start.y, clipped_end.x, clipped_end.y, ¶ms, - err, last_pt, solid_pen_line_callback, pdev); + bres_line_with_bias( &clipped_start, &line_params, solid_pen_line_callback, pdev ); if(clip_status == 2) break; /* completely unclipped, so we can finish */ } @@ -923,54 +938,70 @@ static BOOL dashed_pen_line(dibdrv_physdev *pdev, POINT *start, POINT *end) } else { - bres_params params; - INT dx = end->x - start->x; - INT dy = end->y - start->y; + bres_params clip_params; + struct line_params line_params; + INT dx = end->x - start->x, dy = end->y - start->y; + INT abs_dx = abs(dx), abs_dy = abs(dy); INT i; - params.dx = abs(dx); - params.dy = abs(dy); - params.octant = get_octant_mask(dx, dy); - params.bias = get_bias(params.octant); + clip_params.dx = abs_dx; + clip_params.dy = abs_dy; + clip_params.octant = get_octant_mask(dx, dy); + clip_params.bias = get_bias( clip_params.octant ); + + line_params.bias = clip_params.bias; + line_params.x_major = is_xmajor( clip_params.octant ); + line_params.x_inc = is_x_increasing( clip_params.octant ) ? 1 : -1; + line_params.y_inc = is_y_increasing( clip_params.octant ) ? 1 : -1; + + if (line_params.x_major) + { + line_params.err_add_1 = 2 * abs_dy - 2 * abs_dx; + line_params.err_add_2 = 2 * abs_dy; + } + else + { + line_params.err_add_1 = 2 * abs_dx - 2 * abs_dy; + line_params.err_add_2 = 2 * abs_dx; + } for(i = 0; i < clip->numRects; i++) { POINT clipped_start, clipped_end; int clip_status; - clip_status = clip_line(start, end, clip->rects + i, ¶ms, &clipped_start, &clipped_end); + clip_status = clip_line(start, end, clip->rects + i, &clip_params, &clipped_start, &clipped_end); if(clip_status) { int m = abs(clipped_start.x - start->x); int n = abs(clipped_start.y - start->y); - int err; - BOOL last_pt = FALSE; pdev->dash_pos = start_pos; - if(is_xmajor(params.octant)) + if (line_params.x_major) { - err = 2 * params.dy - params.dx + m * 2 * params.dy - n * 2 * params.dx; + line_params.err_start = 2 * abs_dy - abs_dx + m * 2 * abs_dy - n * 2 * abs_dx; + line_params.length = abs( clipped_end.x - clipped_start.x ) + 1; skip_dash(pdev, m); } else { - err = 2 * params.dx - params.dy + n * 2 * params.dx - m * 2 * params.dy; + line_params.err_start = 2 * abs_dx - abs_dy + n * 2 * abs_dx - m * 2 * abs_dy; + line_params.length = abs( clipped_end.y - clipped_start.y ) + 1; skip_dash(pdev, n); } - if(clip_status == 1 && (end->x != clipped_end.x || end->y != clipped_end.y)) last_pt = TRUE; + if (clipped_end.x == end->x && clipped_end.y == end->y) line_params.length--; - bres_line_with_bias(clipped_start.x, clipped_start.y, clipped_end.x, clipped_end.y, ¶ms, - err, last_pt, dashed_pen_line_callback, pdev); + bres_line_with_bias( &clipped_start, &line_params, dashed_pen_line_callback, pdev ); if(clip_status == 2) break; /* completely unclipped, so we can finish */ } } pdev->dash_pos = start_pos; - if(is_xmajor(params.octant)) - skip_dash(pdev, params.dx); + if(line_params.x_major) + skip_dash(pdev, abs_dx); else - skip_dash(pdev, params.dy); + skip_dash(pdev, abs_dy); } release_wine_region(pdev->clip);
1
0
0
0
Michael Stefaniuc : user32/tests: Drop superfluous function pointer casts.
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: 8cd1d5839f21c87cdb04a97f56d0c73c14cc8af1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8cd1d5839f21c87cdb04a97f5…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 21 11:05:34 2011 +0100 user32/tests: Drop superfluous function pointer casts. --- dlls/user32/tests/dialog.c | 2 +- dlls/user32/tests/edit.c | 102 ++++++++++++++++++++++---------------------- dlls/user32/tests/msg.c | 2 +- 3 files changed, 53 insertions(+), 53 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8cd1d5839f21c87cdb04a…
1
0
0
0
Alexandre Julliard : comctl32: Merge imagelist definitions into the C file.
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: e6cf9fbcc2751e8a8a418b531f8e98980b304933 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e6cf9fbcc2751e8a8a418b531…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 21 11:47:24 2011 +0100 comctl32: Merge imagelist definitions into the C file. --- dlls/comctl32/imagelist.c | 52 ++++++++++++++++++++++++++++- dlls/comctl32/imagelist.h | 80 --------------------------------------------- 2 files changed, 50 insertions(+), 82 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index ca6579f..db59104 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -52,15 +52,63 @@ #include "commctrl.h" #include "comctl32.h" #include "commoncontrols.h" -#include "imagelist.h" #include "wine/debug.h" #include "wine/exception.h" WINE_DEFAULT_DEBUG_CHANNEL(imagelist); - #define MAX_OVERLAYIMAGE 15 +struct _IMAGELIST +{ + const struct IImageListVtbl *lpVtbl; /* 00: IImageList vtable */ + + INT cCurImage; /* 04: ImageCount */ + INT cMaxImage; /* 08: maximages */ + INT cGrow; /* 0C: cGrow */ + INT cx; /* 10: cx */ + INT cy; /* 14: cy */ + DWORD x4; + UINT flags; /* 1C: flags */ + COLORREF clrFg; /* 20: foreground color */ + COLORREF clrBk; /* 24: background color */ + + + HBITMAP hbmImage; /* 28: images Bitmap */ + HBITMAP hbmMask; /* 2C: masks Bitmap */ + HDC hdcImage; /* 30: images MemDC */ + HDC hdcMask; /* 34: masks MemDC */ + INT nOvlIdx[MAX_OVERLAYIMAGE]; /* 38: overlay images index */ + + /* not yet found out */ + HBRUSH hbrBlend25; + HBRUSH hbrBlend50; + INT cInitial; + UINT uBitsPixel; + char *has_alpha; + + LONG ref; /* reference count */ +}; + +#define IMAGELIST_MAGIC 0x53414D58 + +/* Header used by ImageList_Read() and ImageList_Write() */ +#include "pshpack2.h" +typedef struct _ILHEAD +{ + USHORT usMagic; + USHORT usVersion; + WORD cCurImage; + WORD cMaxImage; + WORD cGrow; + WORD cx; + WORD cy; + COLORREF bkcolor; + WORD flags; + SHORT ovls[4]; +} ILHEAD; +#include "poppack.h" + /* internal image list data used for Drag & Drop operations */ typedef struct { diff --git a/dlls/comctl32/imagelist.h b/dlls/comctl32/imagelist.h deleted file mode 100644 index f6f1d1b..0000000 --- a/dlls/comctl32/imagelist.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * ImageList definitions - * - * Copyright 1998 Eric Kohl - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_IMAGELIST_H -#define __WINE_IMAGELIST_H - -#include <stdarg.h> - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" - -struct _IMAGELIST -{ - const struct IImageListVtbl *lpVtbl; /* 00: IImageList vtable */ - - INT cCurImage; /* 04: ImageCount */ - INT cMaxImage; /* 08: maximages */ - INT cGrow; /* 0C: cGrow */ - INT cx; /* 10: cx */ - INT cy; /* 14: cy */ - DWORD x4; - UINT flags; /* 1C: flags */ - COLORREF clrFg; /* 20: foreground color */ - COLORREF clrBk; /* 24: background color */ - - - HBITMAP hbmImage; /* 28: images Bitmap */ - HBITMAP hbmMask; /* 2C: masks Bitmap */ - HDC hdcImage; /* 30: images MemDC */ - HDC hdcMask; /* 34: masks MemDC */ - INT nOvlIdx[15]; /* 38: overlay images index */ - - /* not yet found out */ - HBRUSH hbrBlend25; - HBRUSH hbrBlend50; - INT cInitial; - UINT uBitsPixel; - char *has_alpha; - - LONG ref; /* reference count */ -}; - -#define IMAGELIST_MAGIC 0x53414D58 - -/* Header used by ImageList_Read() and ImageList_Write() */ -#include "pshpack2.h" -typedef struct _ILHEAD -{ - USHORT usMagic; - USHORT usVersion; - WORD cCurImage; - WORD cMaxImage; - WORD cGrow; - WORD cx; - WORD cy; - COLORREF bkcolor; - WORD flags; - SHORT ovls[4]; -} ILHEAD; -#include "poppack.h" - -#endif /* __WINE_IMAGELIST_H */
1
0
0
0
Alexandre Julliard : comctl32: Avoid accessing imagelist internals.
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: d0b1b4c7b0c4efc22cd35e03697818bad2a608d4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d0b1b4c7b0c4efc22cd35e036…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 21 11:43:06 2011 +0100 comctl32: Avoid accessing imagelist internals. --- dlls/comctl32/header.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index 17b55be..ce95d58 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -39,7 +39,6 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" -#include "imagelist.h" #include "vssym32.h" #include "uxtheme.h" #include "wine/debug.h" @@ -384,6 +383,7 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU /* cnt,txt,img,bmp */ UINT cx, tx, ix, bx, cw, tw, iw, bw; + INT img_cx, img_cy; BITMAP bmp; HEADER_PrepareCallbackItems(infoPtr, iItem, HDI_TEXT|HDI_IMAGE); @@ -400,8 +400,8 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU cw = textRect.right - textRect.left + 2 * infoPtr->iMargin; } - if ((phdi->fmt & HDF_IMAGE) && (infoPtr->himl)) { - iw = infoPtr->himl->cx + 2 * infoPtr->iMargin; + if ((phdi->fmt & HDF_IMAGE) && ImageList_GetIconSize( infoPtr->himl, &img_cx, &img_cy )) { + iw = img_cx + 2 * infoPtr->iMargin; x = &ix; w = &iw; } @@ -474,8 +474,8 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU if (iw) { ImageList_DrawEx (infoPtr->himl, phdi->iImage, hClipDC, - ix, r.top + ((INT)rh - infoPtr->himl->cy) / 2, - infoPtr->himl->cx, infoPtr->himl->cy, CLR_DEFAULT, CLR_DEFAULT, 0); + ix, r.top + ((INT)rh - img_cy) / 2, + img_cx, img_cy, CLR_DEFAULT, CLR_DEFAULT, 0); } DeleteObject(hClipRgn);
1
0
0
0
Alexandre Julliard : comctl32: Take the total bitmap size into account when reading a bottom-up image list .
by Alexandre Julliard
21 Nov '11
21 Nov '11
Module: wine Branch: master Commit: ee462a7801ae64cb57e890b62ed848c77d124154 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ee462a7801ae64cb57e890b62…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 21 11:42:48 2011 +0100 comctl32: Take the total bitmap size into account when reading a bottom-up image list. --- dlls/comctl32/imagelist.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index c32cb0b..ca6579f 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -2216,8 +2216,8 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm) if (image_info->bmiHeader.biHeight > 0) /* bottom-up */ { - ptr += (imagelist_height( ilHead.cCurImage ) - 1) * stride; - mask_ptr += (imagelist_height( ilHead.cCurImage ) - 1) * stride / 8; + ptr += image_info->bmiHeader.biHeight * image_info->bmiHeader.biWidth - stride; + mask_ptr += (image_info->bmiHeader.biHeight * image_info->bmiHeader.biWidth - stride) / 8; stride = -stride; image_info->bmiHeader.biHeight = himl->cy; }
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
86
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Results per page:
10
25
50
100
200