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
December 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
2 participants
810 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11: Store the visible region handle directly instead of making a copy.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: 649e33de58d9e2cdf28850035d25daabe29b14ce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=649e33de58d9e2cdf28850035…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 6 13:31:46 2011 +0100 winex11: Store the visible region handle directly instead of making a copy. --- dlls/winex11.drv/graphics.c | 2 +- dlls/winex11.drv/init.c | 7 ------- 2 files changed, 1 insertions(+), 8 deletions(-) diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 4f76a1f..356f7d7e 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -244,7 +244,7 @@ void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) RGNDATA *data; X11DRV_PDEVICE *physDev = get_x11drv_dev( dev ); - CombineRgn( physDev->region, rgn, 0, RGN_COPY ); + physDev->region = rgn; if ((data = X11DRV_GetRegionData( physDev->region, 0 ))) update_x11_clipping( physDev, data ); HeapFree( GetProcessHeap(), 0, data ); diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 8b3b951..39a57b5 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -126,12 +126,6 @@ static X11DRV_PDEVICE *create_x11_physdev( Drawable drawable ) if (!(physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physDev) ))) return NULL; - if (!(physDev->region = CreateRectRgn( 0, 0, 0, 0 ))) - { - HeapFree( GetProcessHeap(), 0, physDev ); - return NULL; - } - wine_tsx11_lock(); physDev->drawable = drawable; physDev->gc = XCreateGC( gdi_display, drawable, 0, NULL ); @@ -193,7 +187,6 @@ static BOOL X11DRV_DeleteDC( PHYSDEV dev ) { X11DRV_PDEVICE *physDev = get_x11drv_dev( dev ); - DeleteObject( physDev->region ); wine_tsx11_lock(); XFreeGC( gdi_display, physDev->gc ); wine_tsx11_unlock();
1
0
0
0
Alexandre Julliard : gdi32: Pass the total visible region in the SetDeviceClipping driver entry point.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: 7534d47b1ba75886297bca2c653a28cc41c2a28e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7534d47b1ba75886297bca2c6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 6 13:15:35 2011 +0100 gdi32: Pass the total visible region in the SetDeviceClipping driver entry point. --- dlls/gdi32/clipping.c | 2 +- dlls/gdi32/dibdrv/dc.c | 9 +++++---- dlls/gdi32/driver.c | 2 +- dlls/winex11.drv/graphics.c | 4 ++-- dlls/winex11.drv/x11drv.h | 2 +- dlls/winex11.drv/xrender.c | 4 ++-- include/wine/gdi_driver.h | 4 ++-- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index b4d77d3..7f69950 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -101,7 +101,7 @@ void CLIPPING_UpdateGCRegion( DC * dc ) if (dc->region) DeleteObject( dc->region ); dc->region = 0; } - physdev->funcs->pSetDeviceClipping( physdev, dc->hVisRgn, clip_rgn ); + physdev->funcs->pSetDeviceClipping( physdev, dc->region ); } /*********************************************************************** diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index 8af8c85..f9b5e7b 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -475,14 +475,15 @@ static INT dibdrv_SetBkMode( PHYSDEV dev, INT mode ) /*********************************************************************** * dibdrv_SetDeviceClipping */ -static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_rgn ) +static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) { PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetDeviceClipping ); dibdrv_physdev *pdev = get_dibdrv_pdev(dev); - TRACE("(%p, %p, %p)\n", dev, vis_rgn, clip_rgn); + TRACE("(%p, %p)\n", dev, rgn); - CombineRgn( pdev->clip, vis_rgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY ); - return next->funcs->pSetDeviceClipping( next, vis_rgn, clip_rgn); + SetRectRgn( pdev->clip, 0, 0, pdev->dib.width, pdev->dib.height ); + if (rgn) CombineRgn( pdev->clip, pdev->clip, rgn, RGN_AND ); + return next->funcs->pSetDeviceClipping( next, rgn ); } /*********************************************************************** diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 26048b4..15481ac 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -582,7 +582,7 @@ static UINT nulldrv_SetDIBColorTable( PHYSDEV dev, UINT pos, UINT count, const R return 0; } -static void nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_rgn ) +static void nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) { } diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index f2cf037..4f76a1f 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -239,12 +239,12 @@ void restore_clipping_region( X11DRV_PDEVICE *dev, RGNDATA *data ) /*********************************************************************** * X11DRV_SetDeviceClipping */ -void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_rgn ) +void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) { RGNDATA *data; X11DRV_PDEVICE *physDev = get_x11drv_dev( dev ); - CombineRgn( physDev->region, vis_rgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY ); + CombineRgn( physDev->region, rgn, 0, RGN_COPY ); if ((data = X11DRV_GetRegionData( physDev->region, 0 ))) update_x11_clipping( physDev, data ); HeapFree( GetProcessHeap(), 0, data ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index d90968d..f1f22bd 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -230,7 +230,7 @@ extern HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetDCBrushColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetDCPenColor( PHYSDEV dev, COLORREF crColor ) DECLSPEC_HIDDEN; -extern void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_rgn ) DECLSPEC_HIDDEN; +extern void X11DRV_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) DECLSPEC_HIDDEN; extern BOOL X11DRV_SetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ) DECLSPEC_HIDDEN; extern UINT X11DRV_SetDIBColorTable( PHYSDEV dev, UINT start, UINT count, const RGBQUAD *colors ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 1c15d2a..5aafd2d 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -1337,14 +1337,14 @@ static DWORD xrenderdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info /*********************************************************************** * xrenderdrv_SetDeviceClipping */ -static void xrenderdrv_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_rgn ) +static void xrenderdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn ) { struct xrender_physdev *physdev = get_xrender_dev( dev ); physdev->update_clip = TRUE; dev = GET_NEXT_PHYSDEV( dev, pSetDeviceClipping ); - dev->funcs->pSetDeviceClipping( dev, vis_rgn, clip_rgn ); + dev->funcs->pSetDeviceClipping( dev, rgn ); } diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index d996fb4..b3241c0 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -159,7 +159,7 @@ struct gdi_dc_funcs COLORREF (*pSetDCPenColor)(PHYSDEV, COLORREF); UINT (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*); INT (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,BITMAPINFO*,UINT); - VOID (*pSetDeviceClipping)(PHYSDEV,HRGN,HRGN); + VOID (*pSetDeviceClipping)(PHYSDEV,HRGN); BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID); DWORD (*pSetLayout)(PHYSDEV,DWORD); INT (*pSetMapMode)(PHYSDEV,INT); @@ -205,7 +205,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 19 +#define WINE_GDI_DRIVER_VERSION 20 static inline PHYSDEV get_physdev_entry_point( PHYSDEV dev, size_t offset ) {
1
0
0
0
Alexandre Julliard : gdi32: Maintain a region inside gdi32 to keep track of the total visible region.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: 5a1a6e935a8a42c63712e9a41f6b779ce13426d1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a1a6e935a8a42c63712e9a41…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 6 13:08:19 2011 +0100 gdi32: Maintain a region inside gdi32 to keep track of the total visible region. --- dlls/gdi32/clipping.c | 52 +++++++++++++-------------------------------- dlls/gdi32/dc.c | 3 ++ dlls/gdi32/gdi_private.h | 15 +++++++++--- 3 files changed, 29 insertions(+), 41 deletions(-) diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index 53ad56b..b4d77d3 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -53,27 +53,6 @@ static inline RECT get_clip_rect( DC * dc, int left, int top, int right, int bot } /*********************************************************************** - * get_clip_box - * - * Get the clipping rectangle in device coordinates. - */ -static int get_clip_box( DC *dc, RECT *rect ) -{ - int ret = ERROR; - HRGN rgn, clip = get_clip_region( dc ); - - if (!clip) return GetRgnBox( dc->hVisRgn, rect ); - - if ((rgn = CreateRectRgn( 0, 0, 0, 0 ))) - { - CombineRgn( rgn, dc->hVisRgn, clip, RGN_AND ); - ret = GetRgnBox( rgn, rect ); - DeleteObject( rgn ); - } - return ret; -} - -/*********************************************************************** * clip_visrect * * Clip a rectangle to the DC visible rect. @@ -82,7 +61,7 @@ BOOL clip_visrect( DC *dc, RECT *dst, const RECT *src ) { RECT clip; - if (!get_clip_box( dc, &clip )) + if (!GetRgnBox( get_dc_region(dc), &clip )) { *dst = *src; return !is_rect_empty( dst ); @@ -105,13 +84,22 @@ void CLIPPING_UpdateGCRegion( DC * dc ) { if (!dc->hMetaClipRgn) dc->hMetaClipRgn = CreateRectRgn( 0, 0, 0, 0 ); CombineRgn( dc->hMetaClipRgn, dc->hClipRgn, dc->hMetaRgn, RGN_AND ); - clip_rgn = dc->hMetaClipRgn; } else /* only one is set, no need for an intersection */ { if (dc->hMetaClipRgn) DeleteObject( dc->hMetaClipRgn ); dc->hMetaClipRgn = 0; - clip_rgn = dc->hMetaRgn ? dc->hMetaRgn : dc->hClipRgn; + } + clip_rgn = get_clip_region( dc ); + if (clip_rgn || dc->hVisRgn) + { + if (!dc->region) dc->region = CreateRectRgn( 0, 0, 0, 0 ); + CombineRgn( dc->region, dc->hVisRgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY ); + } + else + { + if (dc->region) DeleteObject( dc->region ); + dc->region = 0; } physdev->funcs->pSetDeviceClipping( physdev, dc->hVisRgn, clip_rgn ); } @@ -365,7 +353,6 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y ) { POINT pt; BOOL ret; - HRGN clip; DC *dc = get_dc_ptr( hdc ); TRACE("%p %d,%d\n", hdc, x, y ); @@ -375,8 +362,7 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y ) pt.y = y; LPtoDP( hdc, &pt, 1 ); update_dc( dc ); - ret = PtInRegion( dc->hVisRgn, pt.x, pt.y ); - if (ret && (clip = get_clip_region(dc))) ret = PtInRegion( clip, pt.x, pt.y ); + ret = PtInRegion( get_dc_region(dc), pt.x, pt.y ); release_dc_ptr( dc ); return ret; } @@ -389,7 +375,6 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect ) { RECT tmpRect; BOOL ret; - HRGN clip; DC *dc = get_dc_ptr( hdc ); if (!dc) return FALSE; TRACE("%p %s\n", hdc, wine_dbgstr_rect( rect )); @@ -398,14 +383,7 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect ) LPtoDP( hdc, (POINT *)&tmpRect, 2 ); update_dc( dc ); - if ((clip = get_clip_region(dc))) - { - HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 ); - CombineRgn( hrgn, dc->hVisRgn, clip, RGN_AND ); - ret = RectInRegion( hrgn, &tmpRect ); - DeleteObject( hrgn ); - } - else ret = RectInRegion( dc->hVisRgn, &tmpRect ); + ret = RectInRegion( get_dc_region(dc), &tmpRect ); release_dc_ptr( dc ); return ret; } @@ -421,7 +399,7 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect ) if (!dc) return ERROR; update_dc( dc ); - ret = get_clip_box( dc, rect ); + ret = GetRgnBox( get_dc_region(dc), rect ); if (dc->layout & LAYOUT_RTL) { int tmp = rect->left; diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index b357cee..77897e9 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -103,6 +103,7 @@ DC *alloc_dc_ptr( WORD magic ) dc->hMetaRgn = 0; dc->hMetaClipRgn = 0; dc->hVisRgn = 0; + dc->region = 0; dc->hPen = GDI_inc_ref_count( GetStockObject( BLACK_PEN )); dc->hBrush = GDI_inc_ref_count( GetStockObject( WHITE_BRUSH )); dc->hFont = GDI_inc_ref_count( GetStockObject( SYSTEM_FONT )); @@ -174,6 +175,7 @@ static void free_dc_state( DC *dc ) if (dc->hMetaRgn) DeleteObject( dc->hMetaRgn ); if (dc->hMetaClipRgn) DeleteObject( dc->hMetaClipRgn ); if (dc->hVisRgn) DeleteObject( dc->hVisRgn ); + if (dc->region) DeleteObject( dc->region ); if (dc->path) free_gdi_path( dc->path ); HeapFree( GetProcessHeap(), 0, dc ); } @@ -418,6 +420,7 @@ INT nulldrv_SaveDC( PHYSDEV dev ) /* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */ + newdc->region = 0; newdc->hVisRgn = 0; newdc->hClipRgn = 0; newdc->hMetaRgn = 0; diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index c01c2f5..f499de0 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -104,10 +104,11 @@ typedef struct tagDC int flags; DWORD layout; - HRGN hClipRgn; /* Clip region (may be 0) */ - HRGN hMetaRgn; /* Meta region (may be 0) */ - HRGN hMetaClipRgn; /* Intersection of meta and clip regions (may be 0) */ - HRGN hVisRgn; /* Visible region (must never be 0) */ + HRGN hClipRgn; /* Clip region */ + HRGN hMetaRgn; /* Meta region */ + HRGN hMetaClipRgn; /* Intersection of meta and clip regions */ + HRGN hVisRgn; /* Visible region */ + HRGN region; /* Total DC region (intersection of clip and visible) */ HPEN hPen; HBRUSH hBrush; HFONT hFont; @@ -223,6 +224,12 @@ static inline HRGN get_clip_region( DC * dc ) return dc->hClipRgn; } +/* Return the total DC region (if any) */ +static inline HRGN get_dc_region( DC *dc ) +{ + return dc->region; +} + /* dc.c */ extern DC *alloc_dc_ptr( WORD magic ) DECLSPEC_HIDDEN; extern void free_dc_ptr( DC *dc ) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : gdi32: Add a helper function to clip a rectangle to the DC visible rect.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: 1e2dd7cad83a5e1de5fbb71709e9a69510f4a83f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e2dd7cad83a5e1de5fbb7170…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 6 12:57:30 2011 +0100 gdi32: Add a helper function to clip a rectangle to the DC visible rect. --- dlls/gdi32/bitblt.c | 12 +++--------- dlls/gdi32/clipping.c | 19 ++++++++++++++++++- dlls/gdi32/dib.c | 18 +++++++----------- dlls/gdi32/font.c | 4 +--- dlls/gdi32/gdi_private.h | 2 +- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index a7c4918..bfb56a6 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -104,7 +104,7 @@ BOOL intersect_vis_rectangles( struct bitblt_coords *dst, struct bitblt_coords * static BOOL get_vis_rectangles( DC *dc_dst, struct bitblt_coords *dst, DC *dc_src, struct bitblt_coords *src ) { - RECT rect, clip; + RECT rect; /* get the destination visible rectangle */ @@ -124,10 +124,7 @@ static BOOL get_vis_rectangles( DC *dc_dst, struct bitblt_coords *dst, } get_bounding_rect( &rect, dst->x, dst->y, dst->width, dst->height ); - if (get_clip_box( dc_dst, &clip )) - intersect_rect( &dst->visrect, &rect, &clip ); - else - dst->visrect = rect; + clip_visrect( dc_dst, &dst->visrect, &rect ); /* get the source visible rectangle */ @@ -408,7 +405,6 @@ BOOL nulldrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert, struct gdi_image_bits bits; unsigned int i; POINT *pts; - RECT clip; BOOL ret = TRUE; DWORD err; HRGN rgn; @@ -437,9 +433,7 @@ BOOL nulldrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert, dst.y = dst.visrect.top; dst.width = dst.visrect.right - dst.visrect.left; dst.height = dst.visrect.bottom - dst.visrect.top; - - if (get_clip_box( dc, &clip )) intersect_rect( &dst.visrect, &dst.visrect, &clip ); - if (is_rect_empty( &dst.visrect )) goto done; + if (!clip_visrect( dc, &dst.visrect, &dst.visrect )) goto done; /* query the bitmap format */ info->bmiHeader.biSize = sizeof(info->bmiHeader); diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index 70e0e32..53ad56b 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -57,7 +57,7 @@ static inline RECT get_clip_rect( DC * dc, int left, int top, int right, int bot * * Get the clipping rectangle in device coordinates. */ -int get_clip_box( DC *dc, RECT *rect ) +static int get_clip_box( DC *dc, RECT *rect ) { int ret = ERROR; HRGN rgn, clip = get_clip_region( dc ); @@ -74,6 +74,23 @@ int get_clip_box( DC *dc, RECT *rect ) } /*********************************************************************** + * clip_visrect + * + * Clip a rectangle to the DC visible rect. + */ +BOOL clip_visrect( DC *dc, RECT *dst, const RECT *src ) +{ + RECT clip; + + if (!get_clip_box( dc, &clip )) + { + *dst = *src; + return !is_rect_empty( dst ); + } + return intersect_rect( dst, src, &clip ); +} + +/*********************************************************************** * CLIPPING_UpdateGCRegion * * Update the GC clip region when the ClipRgn or VisRgn have changed. diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index bc9564a..0b8bb76 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -403,7 +403,7 @@ INT nulldrv_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT he INT ret = 0; INT height = abs( src_info->bmiHeader.biHeight ); BOOL top_down = src_info->bmiHeader.biHeight < 0, non_stretch_from_origin = FALSE; - RECT rect, clip_rect; + RECT rect; TRACE("%d %d %d %d <- %d %d %d %d rop %08x\n", xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, rop); @@ -487,11 +487,7 @@ INT nulldrv_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT he get_bounding_rect( &rect, dst.x, dst.y, dst.width, dst.height ); - if (get_clip_box( dc, &clip_rect )) - intersect_rect( &dst.visrect, &rect, &clip_rect ); - else - dst.visrect = rect; - if (is_rect_empty( &dst.visrect )) goto done; + if (!clip_visrect( dc, &dst.visrect, &rect )) goto done; if (!intersect_vis_rectangles( &dst, &src )) goto done; @@ -796,11 +792,11 @@ INT nulldrv_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD cx, DWOR dst.height = cy; if (GetLayout( dev->hdc ) & LAYOUT_RTL) dst.x -= cx - 1; - dst.visrect.left = dst.x; - dst.visrect.top = dst.y; - dst.visrect.right = dst.x + cx; - dst.visrect.bottom = dst.y + cy; - if (get_clip_box( dc, &rect )) intersect_rect( &dst.visrect, &dst.visrect, &rect ); + rect.left = dst.x; + rect.top = dst.y; + rect.right = dst.x + cx; + rect.bottom = dst.y + cy; + if (!clip_visrect( dc, &dst.visrect, &rect )) goto done; offset_rect( &src.visrect, dst.x - src.x, dst.y - src.y ); intersect_rect( &rect, &src.visrect, &dst.visrect ); diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index a785283..0d308b0 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1863,13 +1863,11 @@ BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect struct gdi_image_bits bits; struct bitblt_coords src, dst; PHYSDEV dst_dev; - RECT clip; dst_dev = GET_DC_PHYSDEV( dc, pPutImage ); src.visrect = get_total_extents( dev->hdc, x, y, flags, aa_flags, str, count, dx ); if (flags & ETO_CLIPPED) intersect_rect( &src.visrect, &src.visrect, rect ); - if (get_clip_box( dc, &clip )) intersect_rect( &src.visrect, &src.visrect, &clip ); - if (is_rect_empty( &src.visrect )) return TRUE; + if (!clip_visrect( dc, &src.visrect, &src.visrect )) return TRUE; /* FIXME: check for ETO_OPAQUE and avoid GetImage */ src.x = src.visrect.left; diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index fe879ac..c01c2f5 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -212,7 +212,7 @@ extern DWORD stretch_bits( const BITMAPINFO *src_info, struct bitblt_coords *src extern BOOL get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void **bits, UINT *usage ) DECLSPEC_HIDDEN; /* clipping.c */ -extern int get_clip_box( DC *dc, RECT *rect ) DECLSPEC_HIDDEN; +extern BOOL clip_visrect( DC *dc, RECT *dst, const RECT *src ) DECLSPEC_HIDDEN; extern void CLIPPING_UpdateGCRegion( DC * dc ) DECLSPEC_HIDDEN; /* Return the total clip region (if any) */
1
0
0
0
Jacek Caban : mshtml: Don' t use WINAPI for assembly functions to avoid linker warnings on mingw.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: 3284d17ec28382177be1e42dbccf66ae5435d21b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3284d17ec28382177be1e42db…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Dec 6 11:09:40 2011 +0100 mshtml: Don't use WINAPI for assembly functions to avoid linker warnings on mingw. --- dlls/mshtml/ifacewrap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/mshtml/ifacewrap.c b/dlls/mshtml/ifacewrap.c index 006afd2..0e49190 100644 --- a/dlls/mshtml/ifacewrap.c +++ b/dlls/mshtml/ifacewrap.c @@ -88,7 +88,7 @@ static HRESULT WINAPI wrapper_Release(IUnknown *iface) #ifdef __i386__ #define DEFINE_WRAPPER_FUNC(n, off, x) \ - HRESULT WINAPI wrapper_func_##n(IUnknown*); \ + HRESULT wrapper_func_##n(IUnknown*); \ __ASM_GLOBAL_FUNC(wrapper_func_##n, \ "movl 4(%esp), %eax\n\t" \ "movl 4(%eax), %eax\n\t" \
1
0
0
0
Jacek Caban : jscript: Use bytecode for '^=' expression implementation.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: 9749de29bcd39e39bb9b29f33c2529d88999d97f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9749de29bcd39e39bb9b29f33…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Dec 6 10:42:30 2011 +0100 jscript: Use bytecode for '^=' expression implementation. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 29 ----------------------------- dlls/jscript/engine.h | 1 - dlls/jscript/parser.y | 2 +- 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 22d5a5f..645217a 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -501,6 +501,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_mod); case EXPR_ASSIGNOR: return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_or); + case EXPR_ASSIGNXOR: + return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_xor); case EXPR_BITNEG: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_bneg); case EXPR_BOR: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 9816b64..8e5e5f1 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2170,25 +2170,6 @@ static HRESULT interp_or(exec_ctx_t *ctx) } /* ECMA-262 3rd Edition 11.10 */ -static HRESULT xor_eval(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) -{ - INT li, ri; - HRESULT hres; - - hres = to_int32(ctx, lval, ei, &li); - if(FAILED(hres)) - return hres; - - hres = to_int32(ctx, rval, ei, &ri); - if(FAILED(hres)) - return hres; - - V_VT(retv) = VT_I4; - V_I4(retv) = li^ri; - return S_OK; -} - -/* ECMA-262 3rd Edition 11.10 */ static HRESULT interp_xor(exec_ctx_t *ctx) { INT l, r; @@ -3365,16 +3346,6 @@ HRESULT assign_and_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD return assign_oper_eval(ctx, expr->expression1, expr->expression2, bitand_eval, ei, ret); } -/* ECMA-262 3rd Edition 11.13.2 */ -HRESULT assign_xor_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) -{ - binary_expression_t *expr = (binary_expression_t*)_expr; - - TRACE("\n"); - - return assign_oper_eval(ctx, expr->expression1, expr->expression2, xor_eval, ei, ret); -} - static HRESULT interp_jmp(exec_ctx_t *ctx) { const unsigned arg = ctx->parser->code->instrs[ctx->ip].arg1.uint; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 49c7aa8..d613267 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -577,7 +577,6 @@ HRESULT assign_lshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept HRESULT assign_rshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_rrshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_and_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT assign_xor_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT compiled_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 0192eff..bf3732d 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1351,7 +1351,7 @@ static const expression_eval_t expression_eval_table[] = { compiled_expression_eval, assign_and_expression_eval, compiled_expression_eval, - assign_xor_expression_eval, + compiled_expression_eval, compiled_expression_eval, array_expression_eval, member_expression_eval,
1
0
0
0
Jacek Caban : jscript: Use bytecode for '|=' expression.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: c74641acf23a991a9c570f7ff483e7959d3fd8bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c74641acf23a991a9c570f7ff…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Dec 6 10:42:21 2011 +0100 jscript: Use bytecode for '|=' expression. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 29 ----------------------------- dlls/jscript/engine.h | 1 - dlls/jscript/parser.y | 2 +- 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 9a0a471..22d5a5f 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -499,6 +499,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_div); case EXPR_ASSIGNMOD: return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_mod); + case EXPR_ASSIGNOR: + return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_or); case EXPR_BITNEG: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_bneg); case EXPR_BOR: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 9e9c04d..9816b64 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2151,25 +2151,6 @@ static HRESULT interp_jmp_z(exec_ctx_t *ctx) } /* ECMA-262 3rd Edition 11.10 */ -static HRESULT bitor_eval(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) -{ - INT li, ri; - HRESULT hres; - - hres = to_int32(ctx, lval, ei, &li); - if(FAILED(hres)) - return hres; - - hres = to_int32(ctx, rval, ei, &ri); - if(FAILED(hres)) - return hres; - - V_VT(retv) = VT_I4; - V_I4(retv) = li|ri; - return S_OK; -} - -/* ECMA-262 3rd Edition 11.10 */ static HRESULT interp_or(exec_ctx_t *ctx) { INT l, r; @@ -3385,16 +3366,6 @@ HRESULT assign_and_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD } /* ECMA-262 3rd Edition 11.13.2 */ -HRESULT assign_or_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) -{ - binary_expression_t *expr = (binary_expression_t*)_expr; - - TRACE("\n"); - - return assign_oper_eval(ctx, expr->expression1, expr->expression2, bitor_eval, ei, ret); -} - -/* ECMA-262 3rd Edition 11.13.2 */ HRESULT assign_xor_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { binary_expression_t *expr = (binary_expression_t*)_expr; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 330dc34..49c7aa8 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -577,7 +577,6 @@ HRESULT assign_lshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept HRESULT assign_rshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_rrshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_and_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT assign_or_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_xor_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT compiled_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 8051c8a..0192eff 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1350,7 +1350,7 @@ static const expression_eval_t expression_eval_table[] = { compiled_expression_eval, compiled_expression_eval, assign_and_expression_eval, - assign_or_expression_eval, + compiled_expression_eval, assign_xor_expression_eval, compiled_expression_eval, array_expression_eval,
1
0
0
0
Jacek Caban : jscript: Added bytecode version of member expression.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: a289b8e0a40a29a0e2aa0fdc959766a189b0135d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a289b8e0a40a29a0e2aa0fdc9…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Dec 6 10:42:09 2011 +0100 jscript: Added bytecode version of member expression. --- dlls/jscript/compile.c | 14 ++++++++++++++ dlls/jscript/engine.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ dlls/jscript/engine.h | 1 + 3 files changed, 60 insertions(+), 0 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index af227c0..9a0a471 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -210,6 +210,18 @@ static HRESULT compile_unary_expression(compiler_ctx_t *ctx, unary_expression_t return push_instr(ctx, op) == -1 ? E_OUTOFMEMORY : S_OK; } +/* ECMA-262 3rd Edition 11.2.1 */ +static HRESULT compile_member_expression(compiler_ctx_t *ctx, member_expression_t *expr) +{ + HRESULT hres; + + hres = compile_expression(ctx, expr->expression); + if(FAILED(hres)) + return hres; + + return push_instr_bstr(ctx, OP_member, expr->identifier); +} + /* ECMA-262 3rd Edition 11.14 */ static HRESULT compile_comma_expression(compiler_ctx_t *ctx, binary_expression_t *expr) { @@ -519,6 +531,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_literal(ctx, ((literal_expression_t*)expr)->literal); case EXPR_LOGNEG: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_neg); + case EXPR_MEMBER: + return compile_member_expression(ctx, (member_expression_t*)expr); case EXPR_MINUS: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_minus); case EXPR_MOD: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 0696e77..9e9c04d 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -153,6 +153,22 @@ static HRESULT stack_pop_number(exec_ctx_t *ctx, VARIANT *r) return hres; } +static HRESULT stack_pop_object(exec_ctx_t *ctx, IDispatch **r) +{ + VARIANT *v; + HRESULT hres; + + v = stack_pop(ctx); + if(V_VT(v) == VT_DISPATCH) { + *r = V_DISPATCH(v); + return S_OK; + } + + hres = to_object(ctx->parser->script, v, r); + VariantClear(v); + return hres; +} + static inline HRESULT stack_pop_int(exec_ctx_t *ctx, INT *r) { return to_int32(ctx->parser->script, stack_pop(ctx), &ctx->ei, r); @@ -1591,6 +1607,35 @@ HRESULT member_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla } /* ECMA-262 3rd Edition 11.2.1 */ +static HRESULT interp_member(exec_ctx_t *ctx) +{ + const BSTR arg = ctx->parser->code->instrs[ctx->ip].arg1.bstr; + IDispatch *obj; + VARIANT v; + DISPID id; + HRESULT hres; + + TRACE("\n"); + + hres = stack_pop_object(ctx, &obj); + if(FAILED(hres)) + return hres; + + hres = disp_get_id(ctx->parser->script, obj, arg, 0, &id); + if(SUCCEEDED(hres)) { + hres = disp_propget(ctx->parser->script, obj, id, &v, &ctx->ei, NULL/*FIXME*/); + }else if(hres == DISP_E_UNKNOWNNAME) { + V_VT(&v) = VT_EMPTY; + hres = S_OK; + } + IDispatch_Release(obj); + if(FAILED(hres)) + return hres; + + return stack_push(ctx, &v); +} + +/* ECMA-262 3rd Edition 11.2.1 */ static HRESULT interp_memberid(exec_ctx_t *ctx) { VARIANT *objv, *namev; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 54e28a9..330dc34 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -62,6 +62,7 @@ typedef struct _func_stack { X(jmp_z, 0, ARG_ADDR, 0) \ X(lt, 1, 0,0) \ X(lteq, 1, 0,0) \ + X(member, 1, ARG_BSTR, 0) \ X(memberid, 1, 0,0) \ X(minus, 1, 0,0) \ X(mod, 1, 0,0) \
1
0
0
0
Jacek Caban : jscript: Use bytecode for '%=' expression implementation.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: 822fdde42dc5bbcadf0b114a87ad4dcd3b98f9de URL:
http://source.winehq.org/git/wine.git/?a=commit;h=822fdde42dc5bbcadf0b114a8…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Dec 6 10:41:57 2011 +0100 jscript: Use bytecode for '%=' expression implementation. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 28 ---------------------------- dlls/jscript/engine.h | 1 - dlls/jscript/parser.y | 2 +- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index bcbbaf3..af227c0 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -485,6 +485,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_mul); case EXPR_ASSIGNDIV: return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_div); + case EXPR_ASSIGNMOD: + return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_mod); case EXPR_BITNEG: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_bneg); case EXPR_BOR: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index ef43451..0696e77 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2459,24 +2459,6 @@ static HRESULT interp_div(exec_ctx_t *ctx) } /* ECMA-262 3rd Edition 11.5.3 */ -static HRESULT mod_eval(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) -{ - VARIANT lnum, rnum; - HRESULT hres; - - hres = to_number(ctx, lval, ei, &lnum); - if(FAILED(hres)) - return hres; - - hres = to_number(ctx, rval, ei, &rnum); - if(FAILED(hres)) - return hres; - - num_set_val(retv, fmod(num_val(&lnum), num_val(&rnum))); - return S_OK; -} - -/* ECMA-262 3rd Edition 11.5.3 */ static HRESULT interp_mod(exec_ctx_t *ctx) { VARIANT l, r; @@ -3348,16 +3330,6 @@ HRESULT assign_rrshift_expression_eval(script_ctx_t *ctx, expression_t *_expr, D } /* ECMA-262 3rd Edition 11.13.2 */ -HRESULT assign_mod_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) -{ - binary_expression_t *expr = (binary_expression_t*)_expr; - - TRACE("\n"); - - return assign_oper_eval(ctx, expr->expression1, expr->expression2, mod_eval, ei, ret); -} - -/* ECMA-262 3rd Edition 11.13.2 */ HRESULT assign_and_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { binary_expression_t *expr = (binary_expression_t*)_expr; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 18f4401..54e28a9 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -575,7 +575,6 @@ HRESULT right2_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_ HRESULT assign_lshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_rshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_rrshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT assign_mod_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_and_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_or_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_xor_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 36c5ecf..8051c8a 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1348,7 +1348,7 @@ static const expression_eval_t expression_eval_table[] = { compiled_expression_eval, compiled_expression_eval, compiled_expression_eval, - assign_mod_expression_eval, + compiled_expression_eval, assign_and_expression_eval, assign_or_expression_eval, assign_xor_expression_eval,
1
0
0
0
Jacek Caban : jscript: Use bytecode for '/=' expression implementation.
by Alexandre Julliard
06 Dec '11
06 Dec '11
Module: wine Branch: master Commit: e9bd2e47f88c8ec96ee66a1fab62e05812ca3746 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e9bd2e47f88c8ec96ee66a1fa…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Dec 6 10:41:45 2011 +0100 jscript: Use bytecode for '/=' expression implementation. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 28 ---------------------------- dlls/jscript/engine.h | 1 - dlls/jscript/parser.y | 2 +- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 8688d5d..bcbbaf3 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -483,6 +483,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_sub); case EXPR_ASSIGNMUL: return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_mul); + case EXPR_ASSIGNDIV: + return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_div); case EXPR_BITNEG: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_bneg); case EXPR_BOR: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index c9ad519..ef43451 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2440,24 +2440,6 @@ static HRESULT interp_mul(exec_ctx_t *ctx) } /* ECMA-262 3rd Edition 11.5.2 */ -static HRESULT div_eval(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) -{ - VARIANT lnum, rnum; - HRESULT hres; - - hres = to_number(ctx, lval, ei, &lnum); - if(FAILED(hres)) - return hres; - - hres = to_number(ctx, rval, ei, &rnum); - if(FAILED(hres)) - return hres; - - num_set_val(retv, num_val(&lnum) / num_val(&rnum)); - return S_OK; -} - -/* ECMA-262 3rd Edition 11.5.2 */ static HRESULT interp_div(exec_ctx_t *ctx) { VARIANT l, r; @@ -3366,16 +3348,6 @@ HRESULT assign_rrshift_expression_eval(script_ctx_t *ctx, expression_t *_expr, D } /* ECMA-262 3rd Edition 11.13.2 */ -HRESULT assign_div_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) -{ - binary_expression_t *expr = (binary_expression_t*)_expr; - - TRACE("\n"); - - return assign_oper_eval(ctx, expr->expression1, expr->expression2, div_eval, ei, ret); -} - -/* ECMA-262 3rd Edition 11.13.2 */ HRESULT assign_mod_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { binary_expression_t *expr = (binary_expression_t*)_expr; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 580b9f5..18f4401 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -575,7 +575,6 @@ HRESULT right2_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_ HRESULT assign_lshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_rshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_rrshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT assign_div_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_mod_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_and_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_or_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 66ef886..36c5ecf 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1347,7 +1347,7 @@ static const expression_eval_t expression_eval_table[] = { compiled_expression_eval, compiled_expression_eval, compiled_expression_eval, - assign_div_expression_eval, + compiled_expression_eval, assign_mod_expression_eval, assign_and_expression_eval, assign_or_expression_eval,
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
81
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
Results per page:
10
25
50
100
200