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
Dmitry Timoshkov : ntdll: Change the virtual memory test to accept both READWRITE and WRITECOPY protections .
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: 277259157b5c68123cb6c5ee6c5acee6cc832834 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=277259157b5c68123cb6c5ee6…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Nov 22 21:14:55 2011 +0800 ntdll: Change the virtual memory test to accept both READWRITE and WRITECOPY protections. --- dlls/ntdll/tests/info.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index ec1ce3d..440f602 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -1293,7 +1293,8 @@ static void test_queryvirtualmemory(void) { ok (mbi.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "mbi.AllocationProtect is 0x%x, expected 0x%x\n", mbi.AllocationProtect, PAGE_EXECUTE_WRITECOPY); ok (mbi.State == MEM_COMMIT, "mbi.State is 0x%x, expected 0x%X\n", mbi.State, MEM_COMMIT); - ok (mbi.Protect == PAGE_READWRITE, "mbi.Protect is 0x%x, expected 0x%X\n", mbi.Protect, PAGE_READWRITE); + ok (mbi.Protect == PAGE_READWRITE || mbi.Protect == PAGE_WRITECOPY, + "mbi.Protect is 0x%x\n", mbi.Protect); } else skip( "bss is outside of module\n" ); /* this can happen on Mac OS */ }
1
0
0
0
Alexandre Julliard : gdi32: Specify an initial allocation size for paths to avoid some reallocations.
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: 79691e7afa5dfe2423f12bb47401736ea8ae9777 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=79691e7afa5dfe2423f12bb47…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 23 14:00:22 2011 +0100 gdi32: Specify an initial allocation size for paths to avoid some reallocations. --- dlls/gdi32/path.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 51354df..4d753fd 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -125,7 +125,7 @@ void free_gdi_path( struct gdi_path *path ) HeapFree( GetProcessHeap(), 0, path ); } -static struct gdi_path *alloc_gdi_path(void) +static struct gdi_path *alloc_gdi_path( int count ) { struct gdi_path *path = HeapAlloc( GetProcessHeap(), 0, sizeof(*path) ); @@ -134,8 +134,9 @@ static struct gdi_path *alloc_gdi_path(void) SetLastError( ERROR_NOT_ENOUGH_MEMORY ); return NULL; } - path->points = HeapAlloc( GetProcessHeap(), 0, NUM_ENTRIES_INITIAL * sizeof(*path->points) ); - path->flags = HeapAlloc( GetProcessHeap(), 0, NUM_ENTRIES_INITIAL * sizeof(*path->flags) ); + count = max( NUM_ENTRIES_INITIAL, count ); + path->points = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*path->points) ); + path->flags = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*path->flags) ); if (!path->points || !path->flags) { free_gdi_path( path ); @@ -143,7 +144,7 @@ static struct gdi_path *alloc_gdi_path(void) return NULL; } path->count = 0; - path->allocated = NUM_ENTRIES_INITIAL; + path->allocated = count; path->newStroke = TRUE; return path; } @@ -352,7 +353,7 @@ static struct gdi_path *PATH_FlattenPath(const struct gdi_path *pPath) struct gdi_path *new_path; INT srcpt; - if (!(new_path = alloc_gdi_path())) return NULL; + if (!(new_path = alloc_gdi_path( pPath->count ))) return NULL; for(srcpt = 0; srcpt < pPath->count; srcpt++) { switch(pPath->flags[srcpt] & ~PT_CLOSEFIGURE) { @@ -1810,7 +1811,7 @@ static struct gdi_path *PATH_WidenPath(DC *dc) else pStrokes = HeapReAlloc(GetProcessHeap(), 0, pStrokes, numStrokes * sizeof(*pStrokes)); if(!pStrokes) return NULL; - pStrokes[numStrokes - 1] = alloc_gdi_path(); + pStrokes[numStrokes - 1] = alloc_gdi_path(0); /* fall through */ case PT_LINETO: case (PT_LINETO | PT_CLOSEFIGURE): @@ -1828,11 +1829,11 @@ static struct gdi_path *PATH_WidenPath(DC *dc) } } - pNewPath = alloc_gdi_path(); + pNewPath = alloc_gdi_path( flat_path->count ); for(i = 0; i < numStrokes; i++) { - pUpPath = alloc_gdi_path(); - pDownPath = alloc_gdi_path(); + pUpPath = alloc_gdi_path( pStrokes[i]->count ); + pDownPath = alloc_gdi_path( pStrokes[i]->count ); for(j = 0; j < pStrokes[i]->count; j++) { /* Beginning or end of the path if not closed */ @@ -2094,7 +2095,7 @@ BOOL nulldrv_BeginPath( PHYSDEV dev ) { DC *dc = get_nulldrv_dc( dev ); struct path_physdev *physdev; - struct gdi_path *path = alloc_gdi_path(); + struct gdi_path *path = alloc_gdi_path(0); if (!path) return FALSE; if (!path_driver.pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL ))
1
0
0
0
Alexandre Julliard : gdi32: Get rid of the Hungarian line noise in the gdi_path structure.
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: c2491ccc2d23cd6651183a3b4ac2fbf6cebcccd1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2491ccc2d23cd6651183a3b4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 23 13:37:08 2011 +0100 gdi32: Get rid of the Hungarian line noise in the gdi_path structure. --- dlls/gdi32/path.c | 213 +++++++++++++++++++++++++++-------------------------- 1 files changed, 107 insertions(+), 106 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c2491ccc2d23cd6651183…
1
0
0
0
Alexandre Julliard : gdi32: Get rid of the GdiPath typedef.
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: aefb608752b06b26a62d11b81116db35d378c0ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aefb608752b06b26a62d11b81…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 23 13:32:22 2011 +0100 gdi32: Get rid of the GdiPath typedef. --- dlls/gdi32/path.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index a501bc1..4ce0745 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -81,13 +81,13 @@ typedef struct tagFLOAT_POINT double x, y; } FLOAT_POINT; -typedef struct gdi_path +struct gdi_path { POINT *pPoints; BYTE *pFlags; int numEntriesUsed, numEntriesAllocated; BOOL newStroke; -} GdiPath; +}; struct path_physdev { @@ -202,7 +202,7 @@ static inline INT int_from_fixed(FIXED f) * been allocated; allocates larger arrays and copies the existing entries * to those arrays, if necessary. Returns TRUE if successful, else FALSE. */ -static BOOL PATH_ReserveEntries(GdiPath *pPath, INT count) +static BOOL PATH_ReserveEntries(struct gdi_path *pPath, INT count) { POINT *pPointsNew; BYTE *pFlagsNew; @@ -236,7 +236,7 @@ static BOOL PATH_ReserveEntries(GdiPath *pPath, INT count) * or PT_BEZIERTO, optionally ORed with PT_CLOSEFIGURE. Returns TRUE if * successful, FALSE otherwise (e.g. if not enough memory was available). */ -static BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags) +static BOOL PATH_AddEntry(struct gdi_path *pPath, const POINT *pPoint, BYTE flags) { /* FIXME: If newStroke is true, perhaps we want to check that we're * getting a PT_MOVETO @@ -261,7 +261,7 @@ static BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags) static BYTE *add_log_points( struct path_physdev *physdev, const POINT *points, DWORD count, BYTE type ) { BYTE *ret; - GdiPath *path = physdev->path; + struct gdi_path *path = physdev->path; if (!PATH_ReserveEntries( path, path->numEntriesUsed + count )) return NULL; @@ -277,7 +277,7 @@ static BYTE *add_log_points( struct path_physdev *physdev, const POINT *points, static BOOL start_new_stroke( struct path_physdev *physdev ) { POINT pos; - GdiPath *path = physdev->path; + struct gdi_path *path = physdev->path; if (!path->newStroke && path->numEntriesUsed && !(path->pFlags[path->numEntriesUsed - 1] & PT_CLOSEFIGURE)) @@ -327,7 +327,7 @@ static void PATH_CheckCorners( HDC hdc, POINT corners[], INT x1, INT y1, INT x2, /* PATH_AddFlatBezier */ -static BOOL PATH_AddFlatBezier(GdiPath *pPath, POINT *pt, BOOL closed) +static BOOL PATH_AddFlatBezier(struct gdi_path *pPath, POINT *pt, BOOL closed) { POINT *pts; INT no, i; @@ -468,7 +468,7 @@ static void PATH_NormalizePoint(FLOAT_POINT corners[], * control point is added to the path; otherwise, it is assumed that the current * position is equal to the first control point. */ -static BOOL PATH_DoArcPart(GdiPath *pPath, FLOAT_POINT corners[], +static BOOL PATH_DoArcPart(struct gdi_path *pPath, FLOAT_POINT corners[], double angleStart, double angleEnd, BYTE startEntryType) { double halfAngle, a; @@ -680,7 +680,7 @@ HRGN WINAPI PathToRegion(HDC hdc) return hrgnRval; } -static BOOL PATH_FillPath( HDC hdc, GdiPath *pPath ) +static BOOL PATH_FillPath( HDC hdc, const struct gdi_path *pPath ) { INT mapMode, graphicsMode; SIZE ptViewportExt, ptWindowExt; @@ -1394,7 +1394,7 @@ static BOOL pathdrv_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* co * * internally used by PATH_add_outline */ -static void PATH_BezierTo(GdiPath *pPath, POINT *lppt, INT n) +static void PATH_BezierTo(struct gdi_path *pPath, POINT *lppt, INT n) { if (n < 2) return; @@ -1609,7 +1609,7 @@ BOOL WINAPI FlattenPath(HDC hdc) } -static BOOL PATH_StrokePath( HDC hdc, GdiPath *pPath ) +static BOOL PATH_StrokePath( HDC hdc, const struct gdi_path *pPath ) { INT i, nLinePts, nAlloc; POINT *pLinePts; @@ -1805,9 +1805,9 @@ static struct gdi_path *PATH_WidenPath(DC *dc) numStrokes++; j = 0; if(numStrokes == 1) - pStrokes = HeapAlloc(GetProcessHeap(), 0, sizeof(GdiPath*)); + pStrokes = HeapAlloc(GetProcessHeap(), 0, sizeof(*pStrokes)); else - pStrokes = HeapReAlloc(GetProcessHeap(), 0, pStrokes, numStrokes * sizeof(GdiPath*)); + pStrokes = HeapReAlloc(GetProcessHeap(), 0, pStrokes, numStrokes * sizeof(*pStrokes)); if(!pStrokes) return NULL; pStrokes[numStrokes - 1] = alloc_gdi_path(); /* fall through */ @@ -1891,7 +1891,7 @@ static struct gdi_path *PATH_WidenPath(DC *dc) double alpha, theta, miterWidth; DWORD _joint = joint; POINT pt; - GdiPath *pInsidePath, *pOutsidePath; + struct gdi_path *pInsidePath, *pOutsidePath; if(j > 0 && j < pStrokes[i]->numEntriesUsed - 1) { previous = j - 1; next = j + 1;
1
0
0
0
Alexandre Julliard : gdi32: Get rid of the no longer needed path states.
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: ccc3b9caae092321080a3d408e206161fdbdc0be URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ccc3b9caae092321080a3d408…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 23 13:25:31 2011 +0100 gdi32: Get rid of the no longer needed path states. --- dlls/gdi32/path.c | 21 --------------------- 1 files changed, 0 insertions(+), 21 deletions(-) diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index c9b7262..a501bc1 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -81,16 +81,8 @@ typedef struct tagFLOAT_POINT double x, y; } FLOAT_POINT; -typedef enum -{ - PATH_Null, - PATH_Open, - PATH_Closed -} GdiPathState; - typedef struct gdi_path { - GdiPathState state; POINT *pPoints; BYTE *pFlags; int numEntriesUsed, numEntriesAllocated; @@ -149,7 +141,6 @@ static struct gdi_path *alloc_gdi_path(void) SetLastError( ERROR_NOT_ENOUGH_MEMORY ); return NULL; } - path->state = PATH_Open; path->numEntriesUsed = 0; path->numEntriesAllocated = NUM_ENTRIES_INITIAL; path->newStroke = TRUE; @@ -165,7 +156,6 @@ static struct gdi_path *copy_gdi_path( const struct gdi_path *src_path ) SetLastError( ERROR_NOT_ENOUGH_MEMORY ); return NULL; } - path->state = src_path->state; path->numEntriesUsed = path->numEntriesAllocated = src_path->numEntriesUsed; path->newStroke = src_path->newStroke; path->pPoints = HeapAlloc( GetProcessHeap(), 0, path->numEntriesUsed * sizeof(*path->pPoints) ); @@ -253,10 +243,6 @@ static BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags) */ TRACE("(%d,%d) - %d\n", pPoint->x, pPoint->y, flags); - /* Check that path is open */ - if(pPath->state!=PATH_Open) - return FALSE; - /* Reserve enough memory for an extra path entry */ if(!PATH_ReserveEntries(pPath, pPath->numEntriesUsed+1)) return FALSE; @@ -388,7 +374,6 @@ static struct gdi_path *PATH_FlattenPath(const struct gdi_path *pPath) break; } } - new_path->state = PATH_Closed; return new_path; } @@ -836,7 +821,6 @@ static BOOL pathdrv_EndPath( PHYSDEV dev ) if (!dc) return FALSE; dc->path = physdev->path; - dc->path->state = PATH_Closed; pop_path_driver( dc, physdev ); release_dc_ptr( dc ); return TRUE; @@ -1818,9 +1802,6 @@ static struct gdi_path *PATH_WidenPath(DC *dc) } switch(flat_path->pFlags[i]) { case PT_MOVETO: - if(numStrokes > 0) { - pStrokes[numStrokes - 1]->state = PATH_Closed; - } numStrokes++; j = 0; if(numStrokes == 1) @@ -2040,8 +2021,6 @@ static struct gdi_path *PATH_WidenPath(DC *dc) } HeapFree(GetProcessHeap(), 0, pStrokes); free_gdi_path( flat_path ); - - pNewPath->state = PATH_Closed; return pNewPath; }
1
0
0
0
Alexandre Julliard : gdi32: Only store the path in the DC when it's closed.
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: 2201d08834f282e83791e93af980dc482f1b1b76 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2201d08834f282e83791e93af…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 23 13:24:12 2011 +0100 gdi32: Only store the path in the DC when it's closed. Open paths are stored only in the path physdev. --- dlls/gdi32/gdi_private.h | 1 + dlls/gdi32/path.c | 93 +++++++++++++++++++++++++++------------------ 2 files changed, 57 insertions(+), 37 deletions(-) diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 70f2e4b..db53163 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -150,6 +150,7 @@ typedef struct tagDC } DC; /* DC flags */ +#define DC_PATH_OPEN 0x0001 /* DC path is open (only set on saved DCs) */ #define DC_BOUNDS_ENABLE 0x0008 /* Bounding rectangle tracking is enabled */ /* Certain functions will do no further processing if the driver returns this. diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 715932c..c9b7262 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -108,11 +108,21 @@ static inline struct path_physdev *get_path_physdev( PHYSDEV dev ) return (struct path_physdev *)dev; } -static inline void pop_path_driver( DC *dc ) +static inline void pop_path_driver( DC *dc, struct path_physdev *physdev ) { - PHYSDEV dev = pop_dc_driver( &dc->physDev ); - assert( dev->funcs == &path_driver ); - HeapFree( GetProcessHeap(), 0, dev ); + PHYSDEV *dev = &dc->physDev; + while (*dev != &physdev->dev) dev = &(*dev)->next; + *dev = physdev->dev.next; + HeapFree( GetProcessHeap(), 0, physdev ); +} + +static inline struct path_physdev *find_path_physdev( DC *dc ) +{ + PHYSDEV dev; + + for (dev = dc->physDev; dev->funcs != &null_driver; dev = dev->next) + if (dev->funcs == &path_driver) return get_path_physdev( dev ); + return NULL; } void free_gdi_path( struct gdi_path *path ) @@ -614,44 +624,39 @@ BOOL WINAPI CloseFigure(HDC hdc) /*********************************************************************** * GetPath (GDI32.@) */ -INT WINAPI GetPath(HDC hdc, LPPOINT pPoints, LPBYTE pTypes, - INT nSize) +INT WINAPI GetPath(HDC hdc, LPPOINT pPoints, LPBYTE pTypes, INT nSize) { INT ret = -1; - GdiPath *pPath; DC *dc = get_dc_ptr( hdc ); if(!dc) return -1; - pPath = dc->path; - - /* Check that path is closed */ - if(!pPath || pPath->state != PATH_Closed) + if (!dc->path) { SetLastError(ERROR_CAN_NOT_COMPLETE); goto done; } if(nSize==0) - ret = pPath->numEntriesUsed; - else if(nSize<pPath->numEntriesUsed) + ret = dc->path->numEntriesUsed; + else if(nSize<dc->path->numEntriesUsed) { SetLastError(ERROR_INVALID_PARAMETER); goto done; } else { - memcpy(pPoints, pPath->pPoints, sizeof(POINT)*pPath->numEntriesUsed); - memcpy(pTypes, pPath->pFlags, sizeof(BYTE)*pPath->numEntriesUsed); + memcpy(pPoints, dc->path->pPoints, sizeof(POINT)*dc->path->numEntriesUsed); + memcpy(pTypes, dc->path->pFlags, sizeof(BYTE)*dc->path->numEntriesUsed); /* Convert the points to logical coordinates */ - if(!DPtoLP(hdc, pPoints, pPath->numEntriesUsed)) + if(!DPtoLP(hdc, pPoints, dc->path->numEntriesUsed)) { /* FIXME: Is this the correct value? */ SetLastError(ERROR_CAN_NOT_COMPLETE); goto done; } - else ret = pPath->numEntriesUsed; + else ret = dc->path->numEntriesUsed; } done: release_dc_ptr( dc ); @@ -676,8 +681,7 @@ HRGN WINAPI PathToRegion(HDC hdc) /* Get pointer to path */ if(!dc) return 0; - /* Check that path is closed */ - if (!dc->path || dc->path->state != PATH_Closed) SetLastError(ERROR_CAN_NOT_COMPLETE); + if (!dc->path) SetLastError(ERROR_CAN_NOT_COMPLETE); else { if ((hrgnRval = PATH_PathToRegion(dc->path, GetPolyFillMode(hdc)))) @@ -811,12 +815,12 @@ static BOOL pathdrv_BeginPath( PHYSDEV dev ) */ static BOOL pathdrv_AbortPath( PHYSDEV dev ) { + struct path_physdev *physdev = get_path_physdev( dev ); DC *dc = get_dc_ptr( dev->hdc ); if (!dc) return FALSE; - free_gdi_path( dc->path ); - dc->path = NULL; - pop_path_driver( dc ); + free_gdi_path( physdev->path ); + pop_path_driver( dc, physdev ); release_dc_ptr( dc ); return TRUE; } @@ -827,11 +831,13 @@ static BOOL pathdrv_AbortPath( PHYSDEV dev ) */ static BOOL pathdrv_EndPath( PHYSDEV dev ) { + struct path_physdev *physdev = get_path_physdev( dev ); DC *dc = get_dc_ptr( dev->hdc ); if (!dc) return FALSE; + dc->path = physdev->path; dc->path->state = PATH_Closed; - pop_path_driver( dc ); + pop_path_driver( dc, physdev ); release_dc_ptr( dc ); return TRUE; } @@ -866,30 +872,43 @@ static BOOL pathdrv_DeleteDC( PHYSDEV dev ) BOOL PATH_SavePath( DC *dst, DC *src ) { + struct path_physdev *physdev; + if (src->path) { if (!(dst->path = copy_gdi_path( src->path ))) return FALSE; } + else if ((physdev = find_path_physdev( src ))) + { + if (!(dst->path = copy_gdi_path( physdev->path ))) return FALSE; + dst->flags |= DC_PATH_OPEN; + } else dst->path = NULL; return TRUE; } BOOL PATH_RestorePath( DC *dst, DC *src ) { - struct path_physdev *physdev; + struct path_physdev *physdev = find_path_physdev( dst ); - if (src->path && src->path->state == PATH_Open) + if (src->path && (src->flags & DC_PATH_OPEN)) { - if (!dst->path || dst->path->state != PATH_Open) + if (!physdev) { if (!path_driver.pCreateDC( &dst->physDev, NULL, NULL, NULL, NULL )) return FALSE; + physdev = get_path_physdev( dst->physDev ); } - physdev = get_path_physdev( dst->physDev ); - assert( physdev->dev.funcs == &path_driver ); + else free_gdi_path( physdev->path ); + physdev->path = src->path; + src->flags &= ~DC_PATH_OPEN; + src->path = NULL; + } + else if (physdev) + { + free_gdi_path( physdev->path ); + pop_path_driver( dst, physdev ); } - else if (dst->path && dst->path->state == PATH_Open) pop_path_driver( dst ); - if (dst->path) free_gdi_path( dst->path ); dst->path = src->path; src->path = NULL; @@ -2106,7 +2125,7 @@ BOOL nulldrv_BeginPath( PHYSDEV dev ) physdev = get_path_physdev( dc->physDev ); physdev->path = path; if (dc->path) free_gdi_path( dc->path ); - dc->path = path; + dc->path = NULL; return TRUE; } @@ -2137,7 +2156,7 @@ BOOL nulldrv_SelectClipPath( PHYSDEV dev, INT mode ) HRGN hrgn; DC *dc = get_nulldrv_dc( dev ); - if (!dc->path || dc->path->state != PATH_Closed) + if (!dc->path) { SetLastError( ERROR_CAN_NOT_COMPLETE ); return FALSE; @@ -2158,7 +2177,7 @@ BOOL nulldrv_FillPath( PHYSDEV dev ) { DC *dc = get_nulldrv_dc( dev ); - if (!dc->path || dc->path->state != PATH_Closed) + if (!dc->path) { SetLastError( ERROR_CAN_NOT_COMPLETE ); return FALSE; @@ -2174,7 +2193,7 @@ BOOL nulldrv_StrokeAndFillPath( PHYSDEV dev ) { DC *dc = get_nulldrv_dc( dev ); - if (!dc->path || dc->path->state != PATH_Closed) + if (!dc->path) { SetLastError( ERROR_CAN_NOT_COMPLETE ); return FALSE; @@ -2190,7 +2209,7 @@ BOOL nulldrv_StrokePath( PHYSDEV dev ) { DC *dc = get_nulldrv_dc( dev ); - if (!dc->path || dc->path->state != PATH_Closed) + if (!dc->path) { SetLastError( ERROR_CAN_NOT_COMPLETE ); return FALSE; @@ -2206,7 +2225,7 @@ BOOL nulldrv_FlattenPath( PHYSDEV dev ) DC *dc = get_nulldrv_dc( dev ); struct gdi_path *path; - if (!dc->path || dc->path->state != PATH_Closed) + if (!dc->path) { SetLastError( ERROR_CAN_NOT_COMPLETE ); return FALSE; @@ -2222,7 +2241,7 @@ BOOL nulldrv_WidenPath( PHYSDEV dev ) DC *dc = get_nulldrv_dc( dev ); struct gdi_path *path; - if (!dc->path || dc->path->state != PATH_Closed) + if (!dc->path) { SetLastError( ERROR_CAN_NOT_COMPLETE ); return FALSE;
1
0
0
0
Jacek Caban : jscript: Use bytecode for double literal.
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: a218e0685421e3a3ec48c2bce898c5cdc12f620c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a218e0685421e3a3ec48c2bce…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Nov 23 12:14:31 2011 +0100 jscript: Use bytecode for double literal. --- dlls/jscript/compile.c | 20 ++++++++++++++++++++ dlls/jscript/engine.c | 13 +++++++++++++ dlls/jscript/engine.h | 2 ++ 3 files changed, 35 insertions(+), 0 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 5b7d9d0..85d38da 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -112,6 +112,24 @@ static HRESULT push_instr_str(compiler_ctx_t *ctx, jsop_t op, const WCHAR *arg) return S_OK; } +static HRESULT push_instr_double(compiler_ctx_t *ctx, jsop_t op, double arg) +{ + unsigned instr; + DOUBLE *dbl; + + dbl = compiler_alloc(ctx->code, sizeof(arg)); + if(!dbl) + return E_OUTOFMEMORY; + *dbl = arg; + + instr = push_instr(ctx, op); + if(instr == -1) + return E_OUTOFMEMORY; + + instr_ptr(ctx, instr)->arg1.dbl = dbl; + return S_OK; +} + static HRESULT compile_binary_expression(compiler_ctx_t *ctx, binary_expression_t *expr, jsop_t op) { HRESULT hres; @@ -157,6 +175,8 @@ static HRESULT compile_literal(compiler_ctx_t *ctx, literal_expression_t *expr) switch(literal->type) { case LT_BOOL: return push_instr_int(ctx, OP_bool, literal->u.bval); + case LT_DOUBLE: + return push_instr_double(ctx, OP_double, literal->u.dval); case LT_INT: return push_instr_int(ctx, OP_int, literal->u.lval); case LT_STRING: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index b894b44..e9dc976 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1747,6 +1747,19 @@ HRESULT interp_int(exec_ctx_t *ctx) return stack_push(ctx, &v); } +/* ECMA-262 3rd Edition 7.8.3 */ +HRESULT interp_double(exec_ctx_t *ctx) +{ + const double arg = *ctx->parser->code->instrs[ctx->ip].arg1.dbl; + VARIANT v; + + TRACE("%lf\n", arg); + + V_VT(&v) = VT_R8; + V_R8(&v) = arg; + return stack_push(ctx, &v); +} + /* ECMA-262 3rd Edition 7.8.4 */ HRESULT interp_str(exec_ctx_t *ctx) { diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 1e463cc..2c099e4 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -45,6 +45,7 @@ typedef struct _func_stack { X(add, 1, 0) \ X(bool, 1, 0) \ X(bneg, 1, 0) \ + X(double, 1, 0) \ X(eq2, 1, 0) \ X(in, 1, 0) \ X(int, 1, ARG_INT) \ @@ -64,6 +65,7 @@ OP_LIST typedef union { expression_t *expr; + double *dbl; LONG lng; WCHAR *str; } instr_arg_t;
1
0
0
0
Jacek Caban : jscript: Use bytecode for string literal.
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: e5e7803a550bf7b0f8621514e03553eba0010ad7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e5e7803a550bf7b0f8621514e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Nov 23 12:14:15 2011 +0100 jscript: Use bytecode for string literal. --- dlls/jscript/compile.c | 38 ++++++++++++++++++++++++++++++++++++++ dlls/jscript/engine.c | 16 ++++++++++++++++ dlls/jscript/engine.h | 3 +++ 3 files changed, 57 insertions(+), 0 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 2f2516b..5b7d9d0 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -36,6 +36,23 @@ struct _compiler_ctx_t { static HRESULT compile_expression(compiler_ctx_t*,expression_t*); +static inline void *compiler_alloc(bytecode_t *code, size_t size) +{ + return jsheap_alloc(&code->heap, size); +} + +static WCHAR *compiler_alloc_string(bytecode_t *code, const WCHAR *str) +{ + size_t size; + WCHAR *ret; + + size = (strlenW(str)+1)*sizeof(WCHAR); + ret = compiler_alloc(code, size); + if(ret) + memcpy(ret, str, size); + return ret; +} + static unsigned push_instr(compiler_ctx_t *ctx, jsop_t op) { assert(ctx->code_size >= ctx->code_off); @@ -78,6 +95,23 @@ static HRESULT push_instr_int(compiler_ctx_t *ctx, jsop_t op, LONG arg) return S_OK; } +static HRESULT push_instr_str(compiler_ctx_t *ctx, jsop_t op, const WCHAR *arg) +{ + unsigned instr; + WCHAR *str; + + str = compiler_alloc_string(ctx->code, arg); + if(!str) + return E_OUTOFMEMORY; + + instr = push_instr(ctx, op); + if(instr == -1) + return E_OUTOFMEMORY; + + instr_ptr(ctx, instr)->arg1.str = str; + return S_OK; +} + static HRESULT compile_binary_expression(compiler_ctx_t *ctx, binary_expression_t *expr, jsop_t op) { HRESULT hres; @@ -125,6 +159,8 @@ static HRESULT compile_literal(compiler_ctx_t *ctx, literal_expression_t *expr) return push_instr_int(ctx, OP_bool, literal->u.bval); case LT_INT: return push_instr_int(ctx, OP_int, literal->u.lval); + case LT_STRING: + return push_instr_str(ctx, OP_str, literal->u.wstr); default: return compile_interp_fallback(ctx, &expr->expr); } @@ -159,6 +195,7 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) void release_bytecode(bytecode_t *code) { + jsheap_free(&code->heap); heap_free(code->instrs); heap_free(code); } @@ -176,6 +213,7 @@ HRESULT compile_subscript(parser_ctx_t *parser, expression_t *expr, unsigned *re parser->code = heap_alloc_zero(sizeof(bytecode_t)); if(!parser->code) return E_OUTOFMEMORY; + jsheap_init(&parser->code->heap); } if(!parser->compiler) { diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 1d35496..b894b44 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1747,6 +1747,22 @@ HRESULT interp_int(exec_ctx_t *ctx) return stack_push(ctx, &v); } +/* ECMA-262 3rd Edition 7.8.4 */ +HRESULT interp_str(exec_ctx_t *ctx) +{ + const WCHAR *str = ctx->parser->code->instrs[ctx->ip].arg1.str; + VARIANT v; + + TRACE("%s\n", debugstr_w(str)); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = SysAllocString(str); + if(!V_BSTR(&v)) + return E_OUTOFMEMORY; + + return stack_push(ctx, &v); +} + /* ECMA-262 3rd Edition 7.8 */ HRESULT literal_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 302f9a5..1e463cc 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -50,6 +50,7 @@ typedef struct _func_stack { X(int, 1, ARG_INT) \ X(neg, 1, 0) \ X(neq2, 1, 0) \ + X(str, 1, 0) \ X(tonum, 1, 0) \ X(tree, 1, ARG_EXPR) \ X(ret, 0, 0) @@ -64,6 +65,7 @@ OP_LIST typedef union { expression_t *expr; LONG lng; + WCHAR *str; } instr_arg_t; typedef enum { @@ -79,6 +81,7 @@ typedef struct { typedef struct { instr_t *instrs; + jsheap_t heap; } bytecode_t; void release_bytecode(bytecode_t*);
1
0
0
0
Jacek Caban : jscript: Use bytecode for bool literal implementation.
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: 13d96df4bd7c24891647d64c5116b30a41344ae2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=13d96df4bd7c24891647d64c5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Nov 23 12:13:57 2011 +0100 jscript: Use bytecode for bool literal implementation. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 10 ++++++++++ dlls/jscript/engine.h | 1 + 3 files changed, 13 insertions(+), 0 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 780e6b5..2f2516b 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -121,6 +121,8 @@ static HRESULT compile_literal(compiler_ctx_t *ctx, literal_expression_t *expr) literal_t *literal = expr->literal; switch(literal->type) { + case LT_BOOL: + return push_instr_int(ctx, OP_bool, literal->u.bval); case LT_INT: return push_instr_int(ctx, OP_int, literal->u.lval); default: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 792ba13..1d35496 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1724,6 +1724,16 @@ HRESULT identifier_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD return hres; } +/* ECMA-262 3rd Edition 7.8.2 */ +HRESULT interp_bool(exec_ctx_t *ctx) +{ + const LONG arg = ctx->parser->code->instrs[ctx->ip].arg1.lng; + + TRACE("%s\n", arg ? "true" : "false"); + + return stack_push_bool(ctx, arg); +} + /* ECMA-262 3rd Edition 7.8.3 */ HRESULT interp_int(exec_ctx_t *ctx) { diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index c210bb7..302f9a5 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -43,6 +43,7 @@ typedef struct _func_stack { #define OP_LIST \ X(add, 1, 0) \ + X(bool, 1, 0) \ X(bneg, 1, 0) \ X(eq2, 1, 0) \ X(in, 1, 0) \
1
0
0
0
Jacek Caban : jscript: Use bytecode for int literal implementation.
by Alexandre Julliard
23 Nov '11
23 Nov '11
Module: wine Branch: master Commit: b3feafab41893ea997cf94526c2e60cd76174045 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b3feafab41893ea997cf94526…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Nov 23 12:13:46 2011 +0100 jscript: Use bytecode for int literal implementation. --- dlls/jscript/compile.c | 26 ++++++++++++++++++++++++++ dlls/jscript/engine.c | 13 +++++++++++++ dlls/jscript/engine.h | 5 ++++- 3 files changed, 43 insertions(+), 1 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index e36dcbe..780e6b5 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -66,6 +66,18 @@ static inline instr_t *instr_ptr(compiler_ctx_t *ctx, unsigned off) return ctx->code->instrs + off; } +static HRESULT push_instr_int(compiler_ctx_t *ctx, jsop_t op, LONG arg) +{ + unsigned instr; + + instr = push_instr(ctx, op); + if(instr == -1) + return E_OUTOFMEMORY; + + instr_ptr(ctx, instr)->arg1.lng = arg; + return S_OK; +} + static HRESULT compile_binary_expression(compiler_ctx_t *ctx, binary_expression_t *expr, jsop_t op) { HRESULT hres; @@ -104,6 +116,18 @@ static HRESULT compile_interp_fallback(compiler_ctx_t *ctx, expression_t *expr) return S_OK; } +static HRESULT compile_literal(compiler_ctx_t *ctx, literal_expression_t *expr) +{ + literal_t *literal = expr->literal; + + switch(literal->type) { + case LT_INT: + return push_instr_int(ctx, OP_int, literal->u.lval); + default: + return compile_interp_fallback(ctx, &expr->expr); + } +} + static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) { switch(expr->type) { @@ -115,6 +139,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eq2); case EXPR_IN: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_in); + case EXPR_LITERAL: + return compile_literal(ctx, (literal_expression_t*)expr); case EXPR_LOGNEG: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_neg); case EXPR_NOTEQEQ: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index c6b9eef..792ba13 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1724,6 +1724,19 @@ HRESULT identifier_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD return hres; } +/* ECMA-262 3rd Edition 7.8.3 */ +HRESULT interp_int(exec_ctx_t *ctx) +{ + const LONG arg = ctx->parser->code->instrs[ctx->ip].arg1.lng; + VARIANT v; + + TRACE("%d\n", arg); + + V_VT(&v) = VT_I4; + V_I4(&v) = arg; + return stack_push(ctx, &v); +} + /* ECMA-262 3rd Edition 7.8 */ HRESULT literal_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index e5e316f..c210bb7 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -46,6 +46,7 @@ typedef struct _func_stack { X(bneg, 1, 0) \ X(eq2, 1, 0) \ X(in, 1, 0) \ + X(int, 1, ARG_INT) \ X(neg, 1, 0) \ X(neq2, 1, 0) \ X(tonum, 1, 0) \ @@ -61,11 +62,13 @@ OP_LIST typedef union { expression_t *expr; + LONG lng; } instr_arg_t; typedef enum { ARG_NONE = 0, - ARG_EXPR + ARG_EXPR, + ARG_INT } instr_arg_type_t; typedef struct {
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
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