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
October 2011
----- 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
3 participants
783 discussions
Start a n
N
ew thread
Alexandre Julliard : gdi32: Add a helper function to add multiple points at once to a path.
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: e5ff45992e266f6bb352d2302cb8d1219a3c1e71 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e5ff45992e266f6bb352d2302…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 26 23:47:34 2011 +0200 gdi32: Add a helper function to add multiple points at once to a path. --- dlls/gdi32/path.c | 125 ++++++++++++++++++++++------------------------------ 1 files changed, 53 insertions(+), 72 deletions(-) diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 6d1eb9d..1d78bd2 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -235,6 +235,23 @@ static BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags) return TRUE; } +/* add a number of points, converting them to device coords */ +/* return a pointer to the first type byte so it can be fixed up if necessary */ +static BYTE *add_log_points( struct path_physdev *physdev, const POINT *points, DWORD count, BYTE type ) +{ + BYTE *ret; + GdiPath *path = physdev->path; + + if (!PATH_ReserveEntries( path, path->numEntriesUsed + count )) return NULL; + + ret = &path->pFlags[path->numEntriesUsed]; + memcpy( &path->pPoints[path->numEntriesUsed], points, count * sizeof(*points) ); + LPtoDP( physdev->dev.hdc, &path->pPoints[path->numEntriesUsed], count ); + memset( ret, type, count ); + path->numEntriesUsed += count; + return ret; +} + /* start a new path stroke if necessary */ static BOOL start_new_stroke( struct path_physdev *physdev ) { @@ -243,8 +260,7 @@ static BOOL start_new_stroke( struct path_physdev *physdev ) if (!physdev->path->newStroke) return TRUE; physdev->path->newStroke = FALSE; GetCurrentPositionEx( physdev->dev.hdc, &pos ); - LPtoDP( physdev->dev.hdc, &pos, 1 ); - return PATH_AddEntry( physdev->path, &pos, PT_MOVETO ); + return add_log_points( physdev, &pos, 1, PT_MOVETO ) != NULL; } /* PATH_AssignGdiPath @@ -918,14 +934,10 @@ static BOOL pathdrv_LineTo( PHYSDEV dev, INT x, INT y ) struct path_physdev *physdev = get_path_physdev( dev ); POINT point; - /* Convert point to device coordinates */ + if (!start_new_stroke( physdev )) return FALSE; point.x = x; point.y = y; - LPtoDP( dev->hdc, &point, 1 ); - - if (!start_new_stroke( physdev )) return FALSE; - - return PATH_AddEntry(physdev->path, &point, PT_LINETO); + return add_log_points( physdev, &point, 1, PT_LINETO ) != NULL; } @@ -1230,17 +1242,9 @@ static BOOL pathdrv_Ellipse( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2 ) static BOOL pathdrv_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD cbPoints ) { struct path_physdev *physdev = get_path_physdev( dev ); - POINT pt; - UINT i; if (!start_new_stroke( physdev )) return FALSE; - - for(i = 0; i < cbPoints; i++) { - pt = pts[i]; - LPtoDP( dev->hdc, &pt, 1 ); - PATH_AddEntry(physdev->path, &pt, PT_BEZIERTO); - } - return TRUE; + return add_log_points( physdev, pts, cbPoints, PT_BEZIERTO ) != NULL; } @@ -1250,14 +1254,10 @@ static BOOL pathdrv_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD cbPoints static BOOL pathdrv_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD cbPoints ) { struct path_physdev *physdev = get_path_physdev( dev ); - POINT pt; - UINT i; + BYTE *type = add_log_points( physdev, pts, cbPoints, PT_BEZIERTO ); - for(i = 0; i < cbPoints; i++) { - pt = pts[i]; - LPtoDP( dev->hdc, &pt, 1 ); - PATH_AddEntry(physdev->path, &pt, (i == 0) ? PT_MOVETO : PT_BEZIERTO); - } + if (!type) return FALSE; + type[0] = PT_MOVETO; return TRUE; } @@ -1328,14 +1328,10 @@ static BOOL pathdrv_PolyDraw( PHYSDEV dev, const POINT *pts, const BYTE *types, static BOOL pathdrv_Polyline( PHYSDEV dev, const POINT *pts, INT cbPoints ) { struct path_physdev *physdev = get_path_physdev( dev ); - POINT pt; - INT i; + BYTE *type = add_log_points( physdev, pts, cbPoints, PT_LINETO ); - for(i = 0; i < cbPoints; i++) { - pt = pts[i]; - LPtoDP( dev->hdc, &pt, 1 ); - PATH_AddEntry(physdev->path, &pt, (i == 0) ? PT_MOVETO : PT_LINETO); - } + if (!type) return FALSE; + if (cbPoints) type[0] = PT_MOVETO; return TRUE; } @@ -1346,18 +1342,9 @@ static BOOL pathdrv_Polyline( PHYSDEV dev, const POINT *pts, INT cbPoints ) static BOOL pathdrv_PolylineTo( PHYSDEV dev, const POINT *pts, INT cbPoints ) { struct path_physdev *physdev = get_path_physdev( dev ); - POINT pt; - INT i; if (!start_new_stroke( physdev )) return FALSE; - - for(i = 0; i < cbPoints; i++) { - pt = pts[i]; - LPtoDP( dev->hdc, &pt, 1 ); - PATH_AddEntry(physdev->path, &pt, PT_LINETO); - } - - return TRUE; + return add_log_points( physdev, pts, cbPoints, PT_LINETO ) != NULL; } @@ -1367,16 +1354,12 @@ static BOOL pathdrv_PolylineTo( PHYSDEV dev, const POINT *pts, INT cbPoints ) static BOOL pathdrv_Polygon( PHYSDEV dev, const POINT *pts, INT cbPoints ) { struct path_physdev *physdev = get_path_physdev( dev ); - POINT pt; - INT i; + BYTE *type = add_log_points( physdev, pts, cbPoints, PT_LINETO ); - for(i = 0; i < cbPoints; i++) { - pt = pts[i]; - LPtoDP( dev->hdc, &pt, 1 ); - PATH_AddEntry(physdev->path, &pt, (i == 0) ? PT_MOVETO : - ((i == cbPoints-1) ? PT_LINETO | PT_CLOSEFIGURE : - PT_LINETO)); - } + if (!type) return FALSE; + if (cbPoints) type[0] = PT_MOVETO; + if (cbPoints > 1) type[cbPoints - 1] = PT_LINETO | PT_CLOSEFIGURE; + physdev->path->newStroke = TRUE; return TRUE; } @@ -1387,20 +1370,18 @@ static BOOL pathdrv_Polygon( PHYSDEV dev, const POINT *pts, INT cbPoints ) static BOOL pathdrv_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* counts, UINT polygons ) { struct path_physdev *physdev = get_path_physdev( dev ); - POINT pt, startpt; - UINT poly, i; - INT point; - - for(i = 0, poly = 0; poly < polygons; poly++) { - for(point = 0; point < counts[poly]; point++, i++) { - pt = pts[i]; - LPtoDP( dev->hdc, &pt, 1 ); - if(point == 0) startpt = pt; - PATH_AddEntry(physdev->path, &pt, (point == 0) ? PT_MOVETO : PT_LINETO); - } + UINT poly; + BYTE *type; + + for(poly = 0; poly < polygons; poly++) { + type = add_log_points( physdev, pts, counts[poly], PT_LINETO ); + if (!type) return FALSE; + type[0] = PT_MOVETO; /* win98 adds an extra line to close the figure for some reason */ - PATH_AddEntry(physdev->path, &startpt, PT_LINETO | PT_CLOSEFIGURE); + add_log_points( physdev, pts, 1, PT_LINETO | PT_CLOSEFIGURE ); + pts += counts[poly]; } + physdev->path->newStroke = TRUE; return TRUE; } @@ -1411,16 +1392,16 @@ static BOOL pathdrv_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* count static BOOL pathdrv_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* counts, DWORD polylines ) { struct path_physdev *physdev = get_path_physdev( dev ); - POINT pt; - UINT poly, point, i; + UINT poly, count; + BYTE *type; - for(i = 0, poly = 0; poly < polylines; poly++) { - for(point = 0; point < counts[poly]; point++, i++) { - pt = pts[i]; - LPtoDP( dev->hdc, &pt, 1 ); - PATH_AddEntry(physdev->path, &pt, (point == 0) ? PT_MOVETO : PT_LINETO); - } - } + for (poly = count = 0; poly < polylines; poly++) count += counts[poly]; + + type = add_log_points( physdev, pts, count, PT_LINETO ); + if (!type) return FALSE; + + /* make the first point of each polyline a PT_MOVETO */ + for (poly = 0; poly < polylines; poly++, type += counts[poly]) *type = PT_MOVETO; return TRUE; }
1
0
0
0
Alexandre Julliard : gdi32: Pass a HDC instead of a DC pointer to internal path functions.
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: fbafa45e84cc9451d7c46d0b1fcc65e1c2e7b4ae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fbafa45e84cc9451d7c46d0b1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 26 23:15:10 2011 +0200 gdi32: Pass a HDC instead of a DC pointer to internal path functions. --- dlls/gdi32/path.c | 114 ++++++++++++++++++++++++++-------------------------- 1 files changed, 57 insertions(+), 57 deletions(-) diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 9689e67..6d1eb9d 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -683,7 +683,7 @@ HRGN WINAPI PathToRegion(HDC hdc) return hrgnRval; } -static BOOL PATH_FillPath(DC *dc, GdiPath *pPath) +static BOOL PATH_FillPath( HDC hdc, GdiPath *pPath ) { INT mapMode, graphicsMode; SIZE ptViewportExt, ptWindowExt; @@ -692,7 +692,7 @@ static BOOL PATH_FillPath(DC *dc, GdiPath *pPath) HRGN hrgn; /* Construct a region from the path and fill it */ - if(PATH_PathToRegion(pPath, dc->polyFillMode, &hrgn)) + if(PATH_PathToRegion(pPath, GetPolyFillMode(hdc), &hrgn)) { /* Since PaintRgn interprets the region as being in logical coordinates * but the points we store for the path are already in device @@ -703,11 +703,11 @@ static BOOL PATH_FillPath(DC *dc, GdiPath *pPath) */ /* Save the information about the old mapping mode */ - mapMode=GetMapMode(dc->hSelf); - GetViewportExtEx(dc->hSelf, &ptViewportExt); - GetViewportOrgEx(dc->hSelf, &ptViewportOrg); - GetWindowExtEx(dc->hSelf, &ptWindowExt); - GetWindowOrgEx(dc->hSelf, &ptWindowOrg); + mapMode=GetMapMode(hdc); + GetViewportExtEx(hdc, &ptViewportExt); + GetViewportOrgEx(hdc, &ptViewportOrg); + GetWindowExtEx(hdc, &ptWindowExt); + GetWindowOrgEx(hdc, &ptWindowOrg); /* Save world transform * NB: The Windows documentation on world transforms would lead one to @@ -715,32 +715,32 @@ static BOOL PATH_FillPath(DC *dc, GdiPath *pPath) * tests show that resetting the graphics mode to GM_COMPATIBLE does * not reset the world transform. */ - GetWorldTransform(dc->hSelf, &xform); + GetWorldTransform(hdc, &xform); /* Set MM_TEXT */ - SetMapMode(dc->hSelf, MM_TEXT); - SetViewportOrgEx(dc->hSelf, 0, 0, NULL); - SetWindowOrgEx(dc->hSelf, 0, 0, NULL); - graphicsMode=GetGraphicsMode(dc->hSelf); - SetGraphicsMode(dc->hSelf, GM_ADVANCED); - ModifyWorldTransform(dc->hSelf, &xform, MWT_IDENTITY); - SetGraphicsMode(dc->hSelf, graphicsMode); + SetMapMode(hdc, MM_TEXT); + SetViewportOrgEx(hdc, 0, 0, NULL); + SetWindowOrgEx(hdc, 0, 0, NULL); + graphicsMode=GetGraphicsMode(hdc); + SetGraphicsMode(hdc, GM_ADVANCED); + ModifyWorldTransform(hdc, &xform, MWT_IDENTITY); + SetGraphicsMode(hdc, graphicsMode); /* Paint the region */ - PaintRgn(dc->hSelf, hrgn); + PaintRgn(hdc, hrgn); DeleteObject(hrgn); /* Restore the old mapping mode */ - SetMapMode(dc->hSelf, mapMode); - SetViewportExtEx(dc->hSelf, ptViewportExt.cx, ptViewportExt.cy, NULL); - SetViewportOrgEx(dc->hSelf, ptViewportOrg.x, ptViewportOrg.y, NULL); - SetWindowExtEx(dc->hSelf, ptWindowExt.cx, ptWindowExt.cy, NULL); - SetWindowOrgEx(dc->hSelf, ptWindowOrg.x, ptWindowOrg.y, NULL); + SetMapMode(hdc, mapMode); + SetViewportExtEx(hdc, ptViewportExt.cx, ptViewportExt.cy, NULL); + SetViewportOrgEx(hdc, ptViewportOrg.x, ptViewportOrg.y, NULL); + SetWindowExtEx(hdc, ptWindowExt.cx, ptWindowExt.cy, NULL); + SetWindowOrgEx(hdc, ptWindowOrg.x, ptWindowOrg.y, NULL); /* Go to GM_ADVANCED temporarily to restore the world transform */ - graphicsMode=GetGraphicsMode(dc->hSelf); - SetGraphicsMode(dc->hSelf, GM_ADVANCED); - SetWorldTransform(dc->hSelf, &xform); - SetGraphicsMode(dc->hSelf, graphicsMode); + graphicsMode=GetGraphicsMode(hdc); + SetGraphicsMode(hdc, GM_ADVANCED); + SetWorldTransform(hdc, &xform); + SetGraphicsMode(hdc, graphicsMode); return TRUE; } return FALSE; @@ -1630,7 +1630,7 @@ BOOL WINAPI FlattenPath(HDC hdc) } -static BOOL PATH_StrokePath(DC *dc, GdiPath *pPath) +static BOOL PATH_StrokePath( HDC hdc, GdiPath *pPath ) { INT i, nLinePts, nAlloc; POINT *pLinePts; @@ -1641,21 +1641,21 @@ static BOOL PATH_StrokePath(DC *dc, GdiPath *pPath) BOOL ret = TRUE; /* Save the mapping mode info */ - mapMode=GetMapMode(dc->hSelf); - GetViewportExtEx(dc->hSelf, &szViewportExt); - GetViewportOrgEx(dc->hSelf, &ptViewportOrg); - GetWindowExtEx(dc->hSelf, &szWindowExt); - GetWindowOrgEx(dc->hSelf, &ptWindowOrg); - GetWorldTransform(dc->hSelf, &xform); + mapMode=GetMapMode(hdc); + GetViewportExtEx(hdc, &szViewportExt); + GetViewportOrgEx(hdc, &ptViewportOrg); + GetWindowExtEx(hdc, &szWindowExt); + GetWindowOrgEx(hdc, &ptWindowOrg); + GetWorldTransform(hdc, &xform); /* Set MM_TEXT */ - SetMapMode(dc->hSelf, MM_TEXT); - SetViewportOrgEx(dc->hSelf, 0, 0, NULL); - SetWindowOrgEx(dc->hSelf, 0, 0, NULL); - graphicsMode=GetGraphicsMode(dc->hSelf); - SetGraphicsMode(dc->hSelf, GM_ADVANCED); - ModifyWorldTransform(dc->hSelf, &xform, MWT_IDENTITY); - SetGraphicsMode(dc->hSelf, graphicsMode); + SetMapMode(hdc, MM_TEXT); + SetViewportOrgEx(hdc, 0, 0, NULL); + SetWindowOrgEx(hdc, 0, 0, NULL); + graphicsMode=GetGraphicsMode(hdc); + SetGraphicsMode(hdc, GM_ADVANCED); + ModifyWorldTransform(hdc, &xform, MWT_IDENTITY); + SetGraphicsMode(hdc, graphicsMode); /* Allocate enough memory for the worst case without beziers (one PT_MOVETO * and the rest PT_LINETO with PT_CLOSEFIGURE at the end) plus some buffer @@ -1678,7 +1678,7 @@ static BOOL PATH_StrokePath(DC *dc, GdiPath *pPath) TRACE("Got PT_MOVETO (%d, %d)\n", pPath->pPoints[i].x, pPath->pPoints[i].y); if(nLinePts >= 2) - Polyline(dc->hSelf, pLinePts, nLinePts); + Polyline(hdc, pLinePts, nLinePts); nLinePts = 0; pLinePts[nLinePts++] = pPath->pPoints[i]; break; @@ -1724,23 +1724,23 @@ static BOOL PATH_StrokePath(DC *dc, GdiPath *pPath) pLinePts[nLinePts++] = pLinePts[0]; } if(nLinePts >= 2) - Polyline(dc->hSelf, pLinePts, nLinePts); + Polyline(hdc, pLinePts, nLinePts); end: HeapFree(GetProcessHeap(), 0, pLinePts); /* Restore the old mapping mode */ - SetMapMode(dc->hSelf, mapMode); - SetWindowExtEx(dc->hSelf, szWindowExt.cx, szWindowExt.cy, NULL); - SetWindowOrgEx(dc->hSelf, ptWindowOrg.x, ptWindowOrg.y, NULL); - SetViewportExtEx(dc->hSelf, szViewportExt.cx, szViewportExt.cy, NULL); - SetViewportOrgEx(dc->hSelf, ptViewportOrg.x, ptViewportOrg.y, NULL); + SetMapMode(hdc, mapMode); + SetWindowExtEx(hdc, szWindowExt.cx, szWindowExt.cy, NULL); + SetWindowOrgEx(hdc, ptWindowOrg.x, ptWindowOrg.y, NULL); + SetViewportExtEx(hdc, szViewportExt.cx, szViewportExt.cy, NULL); + SetViewportOrgEx(hdc, ptViewportOrg.x, ptViewportOrg.y, NULL); /* Go to GM_ADVANCED temporarily to restore the world transform */ - graphicsMode=GetGraphicsMode(dc->hSelf); - SetGraphicsMode(dc->hSelf, GM_ADVANCED); - SetWorldTransform(dc->hSelf, &xform); - SetGraphicsMode(dc->hSelf, graphicsMode); + graphicsMode=GetGraphicsMode(hdc); + SetGraphicsMode(hdc, GM_ADVANCED); + SetWorldTransform(hdc, &xform); + SetGraphicsMode(hdc, graphicsMode); /* If we've moved the current point then get its new position which will be in device (MM_TEXT) co-ords, convert it to @@ -1750,9 +1750,9 @@ static BOOL PATH_StrokePath(DC *dc, GdiPath *pPath) */ if(i > 0) { POINT pt; - GetCurrentPositionEx(dc->hSelf, &pt); - DPtoLP(dc->hSelf, &pt, 1); - MoveToEx(dc->hSelf, pt.x, pt.y, NULL); + GetCurrentPositionEx(hdc, &pt); + DPtoLP(hdc, &pt, 1); + MoveToEx(hdc, pt.x, pt.y, NULL); } return ret; @@ -2207,7 +2207,7 @@ BOOL nulldrv_FillPath( PHYSDEV dev ) SetLastError( ERROR_CAN_NOT_COMPLETE ); return FALSE; } - if (!PATH_FillPath( dc, &dc->path )) return FALSE; + if (!PATH_FillPath( dev->hdc, &dc->path )) return FALSE; /* FIXME: Should the path be emptied even if conversion failed? */ PATH_EmptyPath( &dc->path ); return TRUE; @@ -2222,8 +2222,8 @@ BOOL nulldrv_StrokeAndFillPath( PHYSDEV dev ) SetLastError( ERROR_CAN_NOT_COMPLETE ); return FALSE; } - if (!PATH_FillPath( dc, &dc->path )) return FALSE; - if (!PATH_StrokePath( dc, &dc->path )) return FALSE; + if (!PATH_FillPath( dev->hdc, &dc->path )) return FALSE; + if (!PATH_StrokePath( dev->hdc, &dc->path )) return FALSE; PATH_EmptyPath( &dc->path ); return TRUE; } @@ -2237,7 +2237,7 @@ BOOL nulldrv_StrokePath( PHYSDEV dev ) SetLastError( ERROR_CAN_NOT_COMPLETE ); return FALSE; } - if (!PATH_StrokePath( dc, &dc->path )) return FALSE; + if (!PATH_StrokePath( dev->hdc, &dc->path )) return FALSE; PATH_EmptyPath( &dc->path ); return TRUE; }
1
0
0
0
Bernhard Loos : ntoskrnl: Correctly implement PsGetCurrentThread/ProcessId.
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: 507d92905174ccef96a33a806bfc383874ff7dcf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=507d92905174ccef96a33a806…
Author: Bernhard Loos <bernhardloos(a)googlemail.com> Date: Thu Oct 27 14:20:19 2011 +0200 ntoskrnl: Correctly implement PsGetCurrentThread/ProcessId. --- dlls/ntoskrnl.exe/ntoskrnl.c | 29 ++++++++++++++++++++++------- include/wine/server_protocol.h | 4 +++- server/device.c | 3 +++ server/protocol.def | 2 ++ server/request.h | 8 +++++--- server/trace.c | 2 ++ 6 files changed, 37 insertions(+), 11 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index e5668fd..9c7916e 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -68,6 +68,13 @@ struct IrpInstance IRP *irp; }; +/* tid of the thread running client request */ +static DWORD request_thread; + +/* pid/tid of the client thread */ +static DWORD client_tid; +static DWORD client_pid; + #ifdef __i386__ #define DEFINE_FASTCALL1_ENTRYPOINT( name ) \ __ASM_STDCALL_FUNC( name, 4, \ @@ -197,6 +204,8 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event ) ULONG in_size = 4096, out_size = 0; HANDLE handles[2]; + request_thread = GetCurrentThreadId(); + if (!(in_buff = HeapAlloc( GetProcessHeap(), 0, in_size ))) { ERR( "failed to allocate buffer\n" ); @@ -217,11 +226,13 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event ) wine_server_set_reply( req, in_buff, in_size ); if (!(status = wine_server_call( req ))) { - code = reply->code; - ioctl = reply->next; - device = wine_server_get_ptr( reply->user_ptr ); - in_size = reply->in_size; - out_size = reply->out_size; + code = reply->code; + ioctl = reply->next; + device = wine_server_get_ptr( reply->user_ptr ); + client_tid = reply->client_pid; + client_pid = reply->client_tid; + in_size = reply->in_size; + out_size = reply->out_size; } else { @@ -1465,7 +1476,9 @@ NTSTATUS WINAPI PsCreateSystemThread(PHANDLE ThreadHandle, ULONG DesiredAccess, */ HANDLE WINAPI PsGetCurrentProcessId(void) { - return UlongToHandle(GetCurrentProcessId()); /* FIXME: not quite right... */ + if (GetCurrentThreadId() == request_thread) + return UlongToHandle(client_pid); + return UlongToHandle(GetCurrentProcessId()); } @@ -1474,7 +1487,9 @@ HANDLE WINAPI PsGetCurrentProcessId(void) */ HANDLE WINAPI PsGetCurrentThreadId(void) { - return UlongToHandle(GetCurrentThreadId()); /* FIXME: not quite right... */ + if (GetCurrentThreadId() == request_thread) + return UlongToHandle(client_tid); + return UlongToHandle(GetCurrentThreadId()); } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index e0b0ac8..ab239f3 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4613,6 +4613,8 @@ struct get_next_device_request_reply obj_handle_t next; ioctl_code_t code; client_ptr_t user_ptr; + process_id_t client_pid; + thread_id_t client_tid; data_size_t in_size; data_size_t out_size; /* VARARG(next_data,bytes); */ @@ -5637,6 +5639,6 @@ union generic_reply struct set_suspend_context_reply set_suspend_context_reply; }; -#define SERVER_PROTOCOL_VERSION 427 +#define SERVER_PROTOCOL_VERSION 428 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/device.c b/server/device.c index 4d134a3..49f90e3 100644 --- a/server/device.c +++ b/server/device.c @@ -32,6 +32,7 @@ #include "file.h" #include "handle.h" #include "request.h" +#include "process.h" struct ioctl_call { @@ -510,6 +511,8 @@ DECL_HANDLER(get_next_device_request) ioctl = LIST_ENTRY( ptr, struct ioctl_call, mgr_entry ); reply->code = ioctl->code; reply->user_ptr = ioctl->device->user_ptr; + reply->client_pid = get_process_id( ioctl->thread->process ); + reply->client_tid = get_thread_id( ioctl->thread ); reply->in_size = ioctl->in_size; reply->out_size = ioctl->out_size; if (ioctl->in_size > get_reply_max_size()) set_error( STATUS_BUFFER_OVERFLOW ); diff --git a/server/protocol.def b/server/protocol.def index bec2e3c..a59bb6e 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3203,6 +3203,8 @@ enum coords_relative obj_handle_t next; /* handle to the next ioctl */ ioctl_code_t code; /* ioctl code */ client_ptr_t user_ptr; /* opaque ptr for the device */ + process_id_t client_pid; /* pid of process calling ioctl */ + thread_id_t client_tid; /* tid of thread calling ioctl */ data_size_t in_size; /* total needed input size */ data_size_t out_size; /* needed output size */ VARARG(next_data,bytes); /* input data of the next ioctl */ diff --git a/server/request.h b/server/request.h index b875e30..ac69461 100644 --- a/server/request.h +++ b/server/request.h @@ -2046,9 +2046,11 @@ C_ASSERT( sizeof(struct get_next_device_request_request) == 24 ); C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, next) == 8 ); C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, code) == 12 ); C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, user_ptr) == 16 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, in_size) == 24 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, out_size) == 28 ); -C_ASSERT( sizeof(struct get_next_device_request_reply) == 32 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_pid) == 24 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_tid) == 28 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, in_size) == 32 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, out_size) == 36 ); +C_ASSERT( sizeof(struct get_next_device_request_reply) == 40 ); C_ASSERT( sizeof(struct make_process_system_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct make_process_system_reply, event) == 8 ); C_ASSERT( sizeof(struct make_process_system_reply) == 16 ); diff --git a/server/trace.c b/server/trace.c index 188eee4..e463229 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3731,6 +3731,8 @@ static void dump_get_next_device_request_reply( const struct get_next_device_req fprintf( stderr, " next=%04x", req->next ); dump_ioctl_code( ", code=", &req->code ); dump_uint64( ", user_ptr=", &req->user_ptr ); + fprintf( stderr, ", client_pid=%04x", req->client_pid ); + fprintf( stderr, ", client_tid=%04x", req->client_tid ); fprintf( stderr, ", in_size=%u", req->in_size ); fprintf( stderr, ", out_size=%u", req->out_size ); dump_varargs_bytes( ", next_data=", cur_size );
1
0
0
0
Jörg Höhle : mmdevapi/tests: Fix errors and crashes in various native configurations.
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: 8e62e823d6a41f40d1b50c5a77083290f525bb0c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8e62e823d6a41f40d1b50c5a7…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed Oct 5 23:51:47 2011 +0200 mmdevapi/tests: Fix errors and crashes in various native configurations. --- dlls/mmdevapi/tests/capture.c | 4 +- dlls/mmdevapi/tests/render.c | 131 +++++++++++++++++++++++++++-------------- 2 files changed, 89 insertions(+), 46 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8e62e823d6a41f40d1b50…
1
0
0
0
Jörg Höhle : mmdevapi: IsFormatSupported EXCLUSIVE mode never returns S_FALSE.
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: 00684f84a550d5f4740b00f0d53a0ba5952ddc2d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=00684f84a550d5f4740b00f0d…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Thu Sep 8 15:21:52 2011 +0200 mmdevapi: IsFormatSupported EXCLUSIVE mode never returns S_FALSE. --- dlls/winealsa.drv/mmdevdrv.c | 8 +++++++- dlls/winecoreaudio.drv/mmdevdrv.c | 8 +++----- dlls/wineoss.drv/mmdevdrv.c | 16 +++++++++------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index ac5be34..25693c0 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -1204,8 +1204,11 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, dump_fmt(fmt); - if(out) + if(out){ *out = NULL; + if(mode != AUDCLNT_SHAREMODE_SHARED) + out = NULL; + } EnterCriticalSection(&This->lock); @@ -1339,6 +1342,9 @@ exit: LeaveCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, formats); + if(hr == S_FALSE && !out) + hr = AUDCLNT_E_UNSUPPORTED_FORMAT; + if(hr == S_FALSE && out) { closest->nBlockAlign = closest->nChannels * closest->wBitsPerSample / 8; diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 79cf5e3..a35f18c 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -1145,6 +1145,9 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, dump_fmt(pwfx); + if(outpwfx) + *outpwfx = NULL; + if(pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE && fmtex->dwChannelMask != 0 && fmtex->dwChannelMask != get_channel_mask(pwfx->nChannels)) @@ -1156,17 +1159,12 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, if(SUCCEEDED(hr)){ AudioQueueDispose(aqueue, 1); OSSpinLockUnlock(&This->lock); - if(outpwfx) - *outpwfx = NULL; TRACE("returning %08x\n", S_OK); return S_OK; } OSSpinLockUnlock(&This->lock); - if(outpwfx) - *outpwfx = NULL; - TRACE("returning %08x\n", AUDCLNT_E_UNSUPPORTED_FORMAT); return AUDCLNT_E_UNSUPPORTED_FORMAT; } diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index f8316ee..24cd147 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -714,9 +714,6 @@ static HRESULT setup_oss_device(int fd, const WAVEFORMATEX *fmt, WAVEFORMATEXTENSIBLE *fmtex = (void*)fmt; WAVEFORMATEX *closest = NULL; - if(out) - *out = NULL; - tmp = oss_format = get_oss_format(fmt); if(oss_format < 0) return AUDCLNT_E_UNSUPPORTED_FORMAT; @@ -767,6 +764,9 @@ static HRESULT setup_oss_device(int fd, const WAVEFORMATEX *fmt, ret = S_FALSE; } + if(ret == S_FALSE && !out) + ret = AUDCLNT_E_UNSUPPORTED_FORMAT; + if(ret == S_FALSE && out){ closest->nBlockAlign = closest->nChannels * closest->wBitsPerSample / 8; @@ -901,10 +901,6 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, } hr = setup_oss_device(This->fd, fmt, NULL, FALSE); - if(hr == S_FALSE){ - LeaveCriticalSection(&This->lock); - return AUDCLNT_E_UNSUPPORTED_FORMAT; - } if(FAILED(hr)){ LeaveCriticalSection(&This->lock); return hr; @@ -1137,6 +1133,12 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, dump_fmt(pwfx); + if(outpwfx){ + *outpwfx = NULL; + if(mode != AUDCLNT_SHAREMODE_SHARED) + outpwfx = NULL; + } + if(This->dataflow == eRender) fd = open(This->devnode, O_WRONLY, 0); else if(This->dataflow == eCapture)
1
0
0
0
Jörg Höhle : winecoreaudio: Release buffer memory .
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: 41c6ffea440f0814b16b3499f4d7dbdfdd7699e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41c6ffea440f0814b16b3499f…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Sun Aug 21 06:53:56 2011 +0200 winecoreaudio: Release buffer memory. --- dlls/winecoreaudio.drv/mmdevdrv.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index c45a8c6..79cf5e3 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -509,16 +509,27 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface) ref = InterlockedDecrement(&This->ref); TRACE("(%p) Refcount now %u\n", This, ref); if(!ref){ - IAudioClient_Stop(iface); - if(This->aqueue) + if(This->aqueue){ + AQBuffer *buf, *next; + if(This->public_buffer){ + buf = This->public_buffer->mUserData; + list_add_tail(&This->avail_buffers, &buf->entry); + } + IAudioClient_Stop(iface); + AudioQueueStop(This->aqueue, 1); + /* Stopped synchronously, all buffers returned. */ + LIST_FOR_EACH_ENTRY_SAFE(buf, next, &This->avail_buffers, AQBuffer, entry){ + AudioQueueFreeBuffer(This->aqueue, buf->buf); + HeapFree(GetProcessHeap(), 0, buf); + } AudioQueueDispose(This->aqueue, 1); + } if(This->session){ EnterCriticalSection(&g_sessions_lock); list_remove(&This->entry); LeaveCriticalSection(&g_sessions_lock); } HeapFree(GetProcessHeap(), 0, This->vols); - HeapFree(GetProcessHeap(), 0, This->public_buffer); CoTaskMemFree(This->fmt); IMMDevice_Release(This->parent); HeapFree(GetProcessHeap(), 0, This);
1
0
0
0
Frédéric Delanoy : cmd: Fix a comment.
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: ecc4d8725374ed0e1c80f650888e2a4ec182ddbe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ecc4d8725374ed0e1c80f6508…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Oct 28 09:52:18 2011 +0200 cmd: Fix a comment. --- programs/cmd/tests/test_builtins.cmd | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index a56d0a3..13c9393 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -1436,7 +1436,7 @@ if exist foo.cmd ( echo ------------ Testing setlocal/endlocal ------------ call :setError 0 -rem Note: setlocal EnableDelayedExtension already tested in the variable delayed expansion test section +rem Note: setlocal EnableDelayedExpansion already tested in the variable delayed expansion test section mkdir foobar & cd foobar echo ...enable/disable extensions setlocal DisableEXTensions
1
0
0
0
Aric Stewart : usp10: Sinhala does glyph props like Indic languages.
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: 89a53d6f814f648bd784e0f45ff0ea6157c685da URL:
http://source.winehq.org/git/wine.git/?a=commit;h=89a53d6f814f648bd784e0f45…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Thu Oct 27 13:38:25 2011 -0500 usp10: Sinhala does glyph props like Indic languages. --- dlls/usp10/shape.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 779e8f6..7464b4a 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -61,6 +61,7 @@ static void ShapeCharGlyphProp_Arabic( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSI static void ShapeCharGlyphProp_Thai( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ); static void ShapeCharGlyphProp_None( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ); static void ShapeCharGlyphProp_Tibet( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ); +static void ShapeCharGlyphProp_Sinhala( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ); static void ShapeCharGlyphProp_Devanagari( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ); static void ShapeCharGlyphProp_Bengali( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ); static void ShapeCharGlyphProp_Gurmukhi( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ); @@ -553,7 +554,7 @@ static const ScriptShapeData ShapingData[] = {{ standard_features, 2}, NULL, "cyrl", "", NULL, NULL}, {{ standard_features, 2}, NULL, "armn", "", NULL, NULL}, {{ standard_features, 2}, NULL, "geor", "", NULL, NULL}, - {{ sinhala_features, 3}, NULL, "sinh", "", ContextualShape_Sinhala, NULL}, + {{ sinhala_features, 3}, NULL, "sinh", "", ContextualShape_Sinhala, ShapeCharGlyphProp_Sinhala}, {{ tibetan_features, 2}, NULL, "tibt", "", NULL, ShapeCharGlyphProp_Tibet}, {{ tibetan_features, 2}, NULL, "tibt", "", NULL, ShapeCharGlyphProp_Tibet}, {{ tibetan_features, 2}, NULL, "phag", "", ContextualShape_Phags_pa, ShapeCharGlyphProp_Thai}, @@ -3281,6 +3282,11 @@ static void ShapeCharGlyphProp_BaseIndic( HDC hdc, ScriptCache *psc, SCRIPT_ANAL HeapFree(GetProcessHeap(), 0, syllables); } +static void ShapeCharGlyphProp_Sinhala( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ) +{ + ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, sinhala_lex); +} + static void ShapeCharGlyphProp_Devanagari( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ) { ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, devanagari_lex);
1
0
0
0
Aric Stewart : usp10: All glyphs in a single indic syllable are part of the same cluster.
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: ec23fe6543f6292aa81f70aa46430ad393c7082b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ec23fe6543f6292aa81f70aa4…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Thu Oct 27 13:38:42 2011 -0500 usp10: All glyphs in a single indic syllable are part of the same cluster. --- dlls/usp10/indic.c | 33 ++++++++++++++++++++++++--------- dlls/usp10/shape.c | 21 +++++++++++++++++++++ dlls/usp10/usp10_internal.h | 1 + 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/dlls/usp10/indic.c b/dlls/usp10/indic.c index f8e5b5e..df2a977 100644 --- a/dlls/usp10/indic.c +++ b/dlls/usp10/indic.c @@ -71,7 +71,8 @@ static void debug_output_string(LPCWSTR str, int cChar, lexical_function f) static inline BOOL is_matra( int type ) { return (type == lex_Matra_above || type == lex_Matra_below || - type == lex_Matra_pre || type == lex_Matra_post); + type == lex_Matra_pre || type == lex_Matra_post || + type == lex_Composed_Vowel); } static inline BOOL is_joiner( int type ) @@ -207,7 +208,7 @@ static INT Indic_process_next_syllable( LPCWSTR input, INT cChar, INT start, INT return parse_consonant_syllable(input, cChar, start, main, next, lex); } -static BOOL Consonent_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern) +static BOOL Consonent_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern) { if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant) { @@ -224,7 +225,7 @@ static BOOL Consonent_is_post_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCac return FALSE; } -static BOOL Consonent_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern) +static BOOL Consonent_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern) { if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant) { @@ -241,7 +242,7 @@ static BOOL Consonent_is_below_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCa return FALSE; } -static BOOL Consonent_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern) +static BOOL Consonent_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical, BOOL modern) { if (is_consonant(lexical(pwChar[s->base])) && s->base > s->start && lexical(pwChar[s->base-1]) == lex_Halant) { @@ -258,14 +259,14 @@ static BOOL Consonent_is_pre_base_form(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCach return FALSE; } -static BOOL Consonent_is_ralf(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR pwChar, IndicSyllable *s, lexical_function lexical) +static BOOL Consonent_is_ralf(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR pwChar, IndicSyllable *s, lexical_function lexical) { if ((lexical(pwChar[s->start])==lex_Ra) && s->end > s->start && lexical(pwChar[s->start+1]) == lex_Halant) return (SHAPE_does_GSUB_feature_apply_to_chars(hdc, psa, psc, &pwChar[s->start], 1, 2, "rphf") > 0); return FALSE; } -static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR input, IndicSyllable *s, lexical_function lex, BOOL modern) +static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, IndicSyllable *s, lexical_function lex, BOOL modern) { int i; BOOL blwf = FALSE; @@ -313,7 +314,7 @@ static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LP return s->base; } -void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR input, int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern) +void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, const int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern) { int index = 0; int next = 0; @@ -321,7 +322,7 @@ void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, L *syllable_count = 0; - if (!lex || ! reorder_f) + if (!lex) { ERR("Failure to have required functions\n"); return; @@ -349,7 +350,6 @@ void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, L (*syllables)[*syllable_count].pref = -1; (*syllables)[*syllable_count].end = next-1; FindBaseConsonant(hdc, psa, psc, input, &(*syllables)[*syllable_count], lex, modern); - reorder_f(input, &(*syllables)[*syllable_count], lex); index = next; *syllable_count = (*syllable_count)+1; } @@ -361,3 +361,18 @@ void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, L } TRACE("Processed %i of %i characters into %i syllables\n",index,cChar,*syllable_count); } + +void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR input, int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern) +{ + int i; + + if (!reorder_f) + { + ERR("Failure to have required functions\n"); + return; + } + + Indic_ParseSyllables(hdc, psa, psc, input, cChar, syllables, syllable_count, lex, modern); + for (i = 0; i < *syllable_count; i++) + reorder_f(input, &(*syllables)[i], lex); +} diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 0b1af46..779e8f6 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -3213,6 +3213,9 @@ static void ShapeCharGlyphProp_Tibet( HDC hdc, ScriptCache* psc, SCRIPT_ANALYSIS static void ShapeCharGlyphProp_BaseIndic( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp, lexical_function lexical) { int i,k; + IndicSyllable *syllables = NULL; + int syllable_count = 0; + BOOL modern = get_GSUB_Indic2(psa, psc); for (i = 0; i < cGlyphs; i++) { @@ -3257,7 +3260,25 @@ static void ShapeCharGlyphProp_BaseIndic( HDC hdc, ScriptCache *psc, SCRIPT_ANAL break; } } + + Indic_ParseSyllables( hdc, psa, psc, pwcChars, cChars, &syllables, &syllable_count, lexical, modern); + + for (i = 0; i < syllable_count; i++) + { + int j; + WORD g = pwLogClust[syllables[i].start]; + for (j = syllables[i].start+1; j <= syllables[i].end; j++) + { + if (pwLogClust[j] != g) + { + pGlyphProp[pwLogClust[j]].sva.fClusterStart = 0; + pwLogClust[j] = g; + } + } + } + UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp); + HeapFree(GetProcessHeap(), 0, syllables); } static void ShapeCharGlyphProp_Devanagari( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp ) diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index e85afbe..7a88ac7 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -136,5 +136,6 @@ void SHAPE_CharGlyphProp(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const INT SHAPE_does_GSUB_feature_apply_to_chars(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, const WCHAR *chars, INT write_dir, INT count, const char* feature) DECLSPEC_HIDDEN; void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR input, int cChars, IndicSyllable **syllables, int *syllable_count, lexical_function lexical_f, reorder_function reorder_f, BOOL modern) DECLSPEC_HIDDEN; +void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, const int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern); void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la) DECLSPEC_HIDDEN;
1
0
0
0
Aric Stewart : user32: Improvement for performance in soft linebreaking.
by Alexandre Julliard
28 Oct '11
28 Oct '11
Module: wine Branch: master Commit: c83841ca0e08902bad88d1d9c3e04db8b3097bcd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c83841ca0e08902bad88d1d9c…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Thu Oct 27 13:38:15 2011 -0500 user32: Improvement for performance in soft linebreaking. --- dlls/user32/edit.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 71df7e6..bfee8f5 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -602,15 +602,20 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta if (!(es->style & ES_AUTOHSCROLL)) { if (current_line->width > fw) { - INT prev; + INT prev, next; int w; const SIZE *sz; + float d; prev = current_line->net_length - 1; w = current_line->net_length; + d = (float)current_line->width/(float)fw; + if (d > 1.2) d -= 0.2; + next = prev/d; + if (next >= prev) next = prev-1; do { prev = EDIT_CallWordBreakProc(es, current_position - es->text, - prev-1, current_line->net_length, WB_LEFT); + next, current_line->net_length, WB_LEFT); current_line->net_length = prev; EDIT_InvalidateUniscribeData_linedef(current_line); EDIT_UpdateUniscribeData_linedef(es, NULL, current_line); @@ -619,6 +624,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta current_line->width = sz->cx; else prev = 0; + next = prev - 1; } while (prev && current_line->width > fw); current_line->net_length = w;
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
79
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
Results per page:
10
25
50
100
200