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
Aric Stewart : usp10: Handle advance for multi-glyph clusters correctly.
by Alexandre Julliard
18 Oct '11
18 Oct '11
Module: wine Branch: master Commit: 42db0c0593ed5236668cbc58c62f6d109d9f9294 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=42db0c0593ed5236668cbc58c…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Oct 17 10:40:53 2011 -0500 usp10: Handle advance for multi-glyph clusters correctly. --- dlls/usp10/usp10.c | 64 +++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 53 insertions(+), 11 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 941b918..8f472ac 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -1641,6 +1641,39 @@ static inline int get_cluster_size(const WORD *pwLogClust, int cChars, int item, return clust_size; } +static inline int get_glyph_cluster_advance(const int* piAdvance, const SCRIPT_VISATTR *pva, const WORD *pwLogClust, int cGlyphs, int cChars, int glyph, int direction) +{ + int advance; + int log_clust_max = 0; + int i; + + advance = piAdvance[glyph]; + + for (i = 0; i < cChars; i++) + { + if (pwLogClust[i] > log_clust_max) + log_clust_max = pwLogClust[i]; + } + + if (glyph > log_clust_max) + return advance; + + for (glyph+=direction; glyph < cGlyphs && glyph >= 0; glyph +=direction) + { + if (pva[glyph].fClusterStart) + break; + for (i = 0; i < cChars; i++) + if (pwLogClust[i] == glyph) break; + if (i != cChars) + break; + if (glyph > log_clust_max) + break; + advance += piAdvance[glyph]; + } + + return advance; +} + /*********************************************************************** * ScriptCPtoX (USP10.@) * @@ -1662,6 +1695,7 @@ HRESULT WINAPI ScriptCPtoX(int iCP, int clust_size = 1; float special_size = 0.0; int iMaxPos = 0; + int advance = 0; BOOL rtl = FALSE; TRACE("(%d,%d,%d,%d,%p,%p,%p,%p,%p)\n", @@ -1702,10 +1736,12 @@ HRESULT WINAPI ScriptCPtoX(int iCP, clust_size = get_cluster_size(pwLogClust, cChars, item, 1, &iCluster, &check); + advance = get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, clust, 1); + if (check >= cChars && !iMaxPos) { for (check = clust; check < cChars; check++) - special_size += piAdvance[check]; + special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, check, 1); iSpecial = item; special_size /= (cChars - item); iPosX += special_size; @@ -1716,24 +1752,25 @@ HRESULT WINAPI ScriptCPtoX(int iCP, { clust_size --; if (clust_size == 0) - iPosX += piAdvance[clust]; + iPosX += advance; } else - iPosX += piAdvance[clust] / (float)clust_size; + iPosX += advance / (float)clust_size; } } else if (iSpecial != -1) iPosX += special_size; else /* (iCluster != -1) */ { + int adv = get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, pwLogClust[iCluster], 1); if (scriptInformation[psa->eScript].props.fNeedsCaretInfo) { clust_size --; if (clust_size == 0) - iPosX += piAdvance[pwLogClust[iCluster]]; + iPosX += adv; } else - iPosX += piAdvance[pwLogClust[iCluster]] / (float)clust_size; + iPosX += adv / (float)clust_size; } } @@ -1770,6 +1807,7 @@ HRESULT WINAPI ScriptXtoCP(int iX, int iCluster = -1; int clust_size = 1; int cjump = 0; + int advance; float special_size = 0.0; int direction = 1; @@ -1830,11 +1868,12 @@ HRESULT WINAPI ScriptXtoCP(int iX, cjump = 0; clust_size = get_cluster_size(pwLogClust, cChars, item, direction, &iCluster, &check); + advance = get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, clust, direction); if (check >= cChars && direction > 0) { for (check = clust; check < cChars; check++) - special_size += piAdvance[check]; + special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, check, direction); iSpecial = item; special_size /= (cChars - item); iPosX += special_size; @@ -1844,25 +1883,26 @@ HRESULT WINAPI ScriptXtoCP(int iX, if (scriptInformation[psa->eScript].props.fNeedsCaretInfo) { if (!cjump) - iPosX += piAdvance[clust]; + iPosX += advance; cjump++; } else - iPosX += piAdvance[clust] / (float)clust_size; + iPosX += advance / (float)clust_size; } } else if (iSpecial != -1) iPosX += special_size; else /* (iCluster != -1) */ { + int adv = get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, pwLogClust[iCluster], direction); if (scriptInformation[psa->eScript].props.fNeedsCaretInfo) { if (!cjump) - iPosX += piAdvance[pwLogClust[iCluster]]; + iPosX += adv; cjump++; } else - iPosX += piAdvance[pwLogClust[iCluster]] / (float)clust_size; + iPosX += adv / (float)clust_size; } } @@ -2584,9 +2624,11 @@ HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piD int glyph = analysis->glyphs[i].pwLogClust[j]; int clust_size = get_cluster_size(analysis->glyphs[i].pwLogClust, cChar, j, direction, NULL, NULL); + int advance = get_glyph_cluster_advance(analysis->glyphs[i].piAdvance, analysis->glyphs[i].psva, analysis->glyphs[i].pwLogClust, analysis->glyphs[i].numGlyphs, cChar, glyph, direction); + for (k = 0; k < clust_size; k++) { - piDx[next] = analysis->glyphs[i].piAdvance[glyph] / clust_size; + piDx[next] = advance / clust_size; next++; if (k) j++; }
1
0
0
0
Aric Stewart : usp10: Break out get_cluster_size and use it to correct ScriptStringGetLogicalWidths for clusters .
by Alexandre Julliard
18 Oct '11
18 Oct '11
Module: wine Branch: master Commit: 6fb71f53541d14afe125912e567b6186b7acdb64 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6fb71f53541d14afe125912e5…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Oct 17 10:40:46 2011 -0500 usp10: Break out get_cluster_size and use it to correct ScriptStringGetLogicalWidths for clusters. --- dlls/usp10/usp10.c | 69 +++++++++++++++++++++++++++++++-------------------- 1 files changed, 42 insertions(+), 27 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 3f323b2..941b918 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -1617,6 +1617,30 @@ HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa) return S_OK; } +static inline int get_cluster_size(const WORD *pwLogClust, int cChars, int item, + int direction, int* iCluster, int *check_out) +{ + int clust_size = 1; + int check; + WORD clust = pwLogClust[item]; + + for (check = item+direction; check < cChars && check >= 0; check+=direction) + { + if (pwLogClust[check] == clust) + { + clust_size ++; + if (iCluster && *iCluster == -1) + *iCluster = item; + } + else break; + } + + if (check_out) + *check_out = check; + + return clust_size; +} + /*********************************************************************** * ScriptCPtoX (USP10.@) * @@ -1674,19 +1698,9 @@ HRESULT WINAPI ScriptCPtoX(int iCP, int check; int clust = pwLogClust[item]; - clust_size = 1; iCluster = -1; - - for (check = item+1; check < cChars; check++) - { - if (pwLogClust[check] == clust) - { - clust_size ++; - if (iCluster == -1) - iCluster = item; - } - else break; - } + clust_size = get_cluster_size(pwLogClust, cChars, item, 1, &iCluster, + &check); if (check >= cChars && !iMaxPos) { @@ -1812,20 +1826,10 @@ HRESULT WINAPI ScriptXtoCP(int iX, int check; int clust = pwLogClust[item]; - clust_size = 1; iCluster = -1; cjump = 0; - - for (check = item+direction; check < cChars && check >= 0; check+=direction) - { - if (pwLogClust[check] == clust) - { - clust_size ++; - if (iCluster == -1) - iCluster = item; - } - else break; - } + clust_size = get_cluster_size(pwLogClust, cChars, item, direction, + &iCluster, &check); if (check >= cChars && direction > 0) { @@ -2569,12 +2573,23 @@ HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piD for (i = 0; i < analysis->numItems; i++) { int cChar = analysis->pItem[i+1].iCharPos - analysis->pItem[i].iCharPos; + int direction = 1; + + if (analysis->pItem[i].a.fRTL && ! analysis->pItem[i].a.fLogicalOrder) + direction = -1; + for (j = 0; j < cChar; j++) { - + int k; int glyph = analysis->glyphs[i].pwLogClust[j]; - piDx[next] = analysis->glyphs[i].piAdvance[glyph]; - next++; + int clust_size = get_cluster_size(analysis->glyphs[i].pwLogClust, + cChar, j, direction, NULL, NULL); + for (k = 0; k < clust_size; k++) + { + piDx[next] = analysis->glyphs[i].piAdvance[glyph] / clust_size; + next++; + if (k) j++; + } } } return S_OK;
1
0
0
0
Alexandre Julliard : gdi32: Return the correct error code when selecting objects in a metafile.
by Alexandre Julliard
18 Oct '11
18 Oct '11
Module: wine Branch: master Commit: 013f5a9b2317710997a4ccba66c861fef82b16e3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=013f5a9b2317710997a4ccba6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Oct 18 15:01:19 2011 +0200 gdi32: Return the correct error code when selecting objects in a metafile. --- dlls/gdi32/mfdrv/objects.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gdi32/mfdrv/objects.c b/dlls/gdi32/mfdrv/objects.c index 7a5039d..46b1218 100644 --- a/dlls/gdi32/mfdrv/objects.c +++ b/dlls/gdi32/mfdrv/objects.c @@ -284,7 +284,7 @@ HBRUSH MFDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush ) return 0; GDI_hdc_using_object(hbrush, dev->hdc); } - return MFDRV_SelectObject( dev, index ) ? hbrush : HGDI_ERROR; + return MFDRV_SelectObject( dev, index ) ? hbrush : 0; } /****************************************************************** @@ -408,7 +408,7 @@ HPEN MFDRV_SelectPen( PHYSDEV dev, HPEN hpen ) return 0; GDI_hdc_using_object(hpen, dev->hdc); } - return MFDRV_SelectObject( dev, index ) ? hpen : HGDI_ERROR; + return MFDRV_SelectObject( dev, index ) ? hpen : 0; }
1
0
0
0
Alexandre Julliard : gdi32: Get rid of the DC_FUNCTIONS typedef.
by Alexandre Julliard
18 Oct '11
18 Oct '11
Module: wine Branch: master Commit: 5267c1316b40b44617f1414b46cf2c50b35fc8ae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5267c1316b40b44617f1414b4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 17 20:39:54 2011 +0200 gdi32: Get rid of the DC_FUNCTIONS typedef. --- dlls/gdi32/bitmap.c | 2 +- dlls/gdi32/dc.c | 2 +- dlls/gdi32/dibdrv/dc.c | 2 +- dlls/gdi32/driver.c | 4 ++-- dlls/gdi32/enhmfdrv/init.c | 2 +- dlls/gdi32/gdi_private.h | 10 ++++------ dlls/gdi32/mfdrv/init.c | 2 +- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index 7c8fa54..9fdedb3 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -762,7 +762,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc ) */ static BOOL BITMAP_DeleteObject( HGDIOBJ handle ) { - const DC_FUNCTIONS *funcs; + const struct gdi_dc_funcs *funcs; BITMAPOBJ *bmp = GDI_GetObjPtr( handle, OBJ_BITMAP ); if (!bmp) return FALSE; diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index b50ea70..74d3747 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -598,7 +598,7 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output, { HDC hdc; DC * dc; - const DC_FUNCTIONS *funcs; + const struct gdi_dc_funcs *funcs; WCHAR buf[300]; GDI_CheckNotLock(); diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index 2099388..2331e7c 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -509,7 +509,7 @@ static INT dibdrv_SetROP2( PHYSDEV dev, INT rop ) return next->funcs->pSetROP2( next, rop ); } -const DC_FUNCTIONS dib_driver = +const struct gdi_dc_funcs dib_driver = { NULL, /* pAbortDoc */ NULL, /* pAbortPath */ diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 8647b95..565e0ad 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -138,7 +138,7 @@ static const struct gdi_dc_funcs *get_display_driver(void) /********************************************************************** * DRIVER_load_driver */ -const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name ) +const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name ) { HMODULE module; struct graphics_driver *driver, *new_driver; @@ -651,7 +651,7 @@ static BOOL nulldrv_wglUseFontBitmapsW( PHYSDEV dev, DWORD start, DWORD count, D return FALSE; } -const DC_FUNCTIONS null_driver = +const struct gdi_dc_funcs null_driver = { nulldrv_AbortDoc, /* pAbortDoc */ nulldrv_AbortPath, /* pAbortPath */ diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 292f505..56e3de8 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile); static BOOL EMFDRV_DeleteDC( PHYSDEV dev ); -static const DC_FUNCTIONS EMFDRV_Funcs = +static const struct gdi_dc_funcs EMFDRV_Funcs = { NULL, /* pAbortDoc */ EMFDRV_AbortPath, /* pAbortPath */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 1fc8573..67bdd2c 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -72,8 +72,6 @@ typedef struct tagGDIOBJHDR struct hdc_list *hdcs; } GDIOBJHDR; -typedef struct gdi_dc_funcs DC_FUNCTIONS; - /* It should not be necessary to access the contents of the GdiPath * structure directly; if you find that the exported functions don't * allow you to do what you want, then please place a new exported @@ -198,7 +196,7 @@ typedef struct tagBITMAPOBJ GDIOBJHDR header; BITMAP bitmap; SIZE size; /* For SetBitmapDimension() */ - const DC_FUNCTIONS *funcs; /* DC function table */ + const struct gdi_dc_funcs *funcs; /* DC function table */ /* For device-independent bitmaps: */ DIBSECTION *dib; RGBQUAD *color_table; /* DIB color table if <= 8bpp */ @@ -270,9 +268,9 @@ extern DWORD blend_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struc BLENDFUNCTION blend ) DECLSPEC_HIDDEN; /* driver.c */ -extern const DC_FUNCTIONS null_driver DECLSPEC_HIDDEN; -extern const DC_FUNCTIONS dib_driver DECLSPEC_HIDDEN; -extern const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name ) DECLSPEC_HIDDEN; +extern const struct gdi_dc_funcs null_driver DECLSPEC_HIDDEN; +extern const struct gdi_dc_funcs dib_driver DECLSPEC_HIDDEN; +extern const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name ) DECLSPEC_HIDDEN; extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size ) DECLSPEC_HIDDEN; /* enhmetafile.c */ diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 0c93571..92680d3 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -79,7 +79,7 @@ static INT MFDRV_GetDeviceCaps(PHYSDEV dev, INT cap) } -static const DC_FUNCTIONS MFDRV_Funcs = +static const struct gdi_dc_funcs MFDRV_Funcs = { NULL, /* pAbortDoc */ MFDRV_AbortPath, /* pAbortPath */
1
0
0
0
Alexandre Julliard : wineps: Get rid of the StretchDIBits entry point.
by Alexandre Julliard
18 Oct '11
18 Oct '11
Module: wine Branch: master Commit: 2dfa00230d43384cb3543719bfddb156ab0a1760 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2dfa00230d43384cb3543719b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 17 20:12:59 2011 +0200 wineps: Get rid of the StretchDIBits entry point. --- dlls/wineps.drv/bitmap.c | 158 +--------------------------------------------- dlls/wineps.drv/init.c | 2 +- dlls/wineps.drv/psdrv.h | 4 - 3 files changed, 3 insertions(+), 161 deletions(-) diff --git a/dlls/wineps.drv/bitmap.c b/dlls/wineps.drv/bitmap.c index fd153ba..ef6e482 100644 --- a/dlls/wineps.drv/bitmap.c +++ b/dlls/wineps.drv/bitmap.c @@ -38,7 +38,7 @@ static inline int get_dib_width_bytes( int width, int depth ) /*************************************************************************** * PSDRV_WriteImageHeader * - * Helper for PSDRV_StretchDIBits + * Helper for PSDRV_PutImage * * BUGS * Uses level 2 PostScript @@ -79,7 +79,7 @@ static BOOL PSDRV_WriteImageHeader(PHYSDEV dev, const BITMAPINFO *info, INT xDst /*************************************************************************** * PSDRV_WriteImageMaskHeader * - * Helper for PSDRV_StretchDIBits + * Helper for PSDRV_PutImage * * We use the imagemask operator for 1bpp bitmaps since the output * takes much less time for the printer to render. @@ -276,157 +276,3 @@ update_format: info->bmiHeader.biCompression = BI_RGB; return ERROR_BAD_FORMAT; } - -/*************************************************************************** - * - * PSDRV_StretchDIBits - * - * BUGS - * Doesn't work correctly if xSrc isn't byte aligned - this affects 1 and 4 - * bit depths. - * Compression not implemented. - */ -INT PSDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, - INT heightDst, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, const void *bits, - BITMAPINFO *info, UINT wUsage, DWORD dwRop ) -{ - INT stride; - INT line; - POINT pt[2]; - const BYTE *src_ptr; - BYTE *dst_ptr, *bitmap; - DWORD bitmap_size; - - TRACE("%p (%d,%d %dx%d) -> (%d,%d %dx%d)\n", dev->hdc, - xSrc, ySrc, widthSrc, heightSrc, xDst, yDst, widthDst, heightDst); - - stride = get_dib_width_bytes( info->bmiHeader.biWidth, info->bmiHeader.biBitCount ); - - TRACE("full size=%dx%d bpp=%d compression=%d rop=%08x\n", info->bmiHeader.biWidth, - info->bmiHeader.biHeight, info->bmiHeader.biBitCount, info->bmiHeader.biCompression, dwRop); - - - if(info->bmiHeader.biCompression != BI_RGB) { - FIXME("Compression not supported\n"); - return FALSE; - } - - pt[0].x = xDst; - pt[0].y = yDst; - pt[1].x = xDst + widthDst; - pt[1].y = yDst + heightDst; - LPtoDP( dev->hdc, pt, 2 ); - xDst = pt[0].x; - yDst = pt[0].y; - widthDst = pt[1].x - pt[0].x; - heightDst = pt[1].y - pt[0].y; - - switch (info->bmiHeader.biBitCount) { - - case 1: - src_ptr = bits; - src_ptr += (ySrc * stride); - if(xSrc & 7) - FIXME("This won't work...\n"); - bitmap_size = heightSrc * ((widthSrc + 7) / 8); - dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size); - for(line = 0; line < heightSrc; line++, src_ptr += stride, dst_ptr += ((widthSrc + 7) / 8)) - memcpy(dst_ptr, src_ptr + xSrc / 8, (widthSrc + 7) / 8); - break; - - case 4: - src_ptr = bits; - src_ptr += (ySrc * stride); - if(xSrc & 1) - FIXME("This won't work...\n"); - bitmap_size = heightSrc * ((widthSrc + 1) / 2); - dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size); - for(line = 0; line < heightSrc; line++, src_ptr += stride, dst_ptr += ((widthSrc + 1) / 2)) - memcpy(dst_ptr, src_ptr + xSrc/2, (widthSrc+1)/2); - break; - - case 8: - src_ptr = bits; - src_ptr += (ySrc * stride); - bitmap_size = heightSrc * widthSrc; - dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size); - for(line = 0; line < heightSrc; line++, src_ptr += stride, dst_ptr += widthSrc) - memcpy(dst_ptr, src_ptr + xSrc, widthSrc); - break; - - case 16: - src_ptr = bits; - src_ptr += (ySrc * stride); - bitmap_size = heightSrc * widthSrc * 3; - dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size); - - for(line = 0; line < heightSrc; line++, src_ptr += stride) { - const WORD *words = (const WORD *)src_ptr + xSrc; - int i; - for(i = 0; i < widthSrc; i++) { - BYTE r, g, b; - - /* We want 0x0 -- 0x1f to map to 0x0 -- 0xff */ - r = words[i] >> 10 & 0x1f; - r = r << 3 | r >> 2; - g = words[i] >> 5 & 0x1f; - g = g << 3 | g >> 2; - b = words[i] & 0x1f; - b = b << 3 | b >> 2; - dst_ptr[0] = r; - dst_ptr[1] = g; - dst_ptr[2] = b; - dst_ptr += 3; - } - } - break; - - case 24: - src_ptr = bits; - src_ptr += (ySrc * stride); - bitmap_size = heightSrc * widthSrc * 3; - dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size); - for(line = 0; line < heightSrc; line++, src_ptr += stride) { - const BYTE *byte = src_ptr + xSrc * 3; - int i; - for(i = 0; i < widthSrc; i++) { - dst_ptr[0] = byte[i * 3 + 2]; - dst_ptr[1] = byte[i * 3 + 1]; - dst_ptr[2] = byte[i * 3]; - dst_ptr += 3; - } - } - break; - - case 32: - src_ptr = bits; - src_ptr += (ySrc * stride); - bitmap_size = heightSrc * widthSrc * 3; - dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size); - for(line = 0; line < heightSrc; line++, src_ptr += stride) { - const BYTE *byte = src_ptr + xSrc * 4; - int i; - for(i = 0; i < widthSrc; i++) { - dst_ptr[0] = byte[i * 4 + 2]; - dst_ptr[1] = byte[i * 4 + 1]; - dst_ptr[2] = byte[i * 4]; - dst_ptr += 3; - } - } - break; - - default: - FIXME("Unsupported depth\n"); - return FALSE; - - } - - PSDRV_SetClip(dev); - PSDRV_WriteGSave(dev); - PSDRV_WriteImageBits( dev, info, xDst, yDst, widthDst, heightDst, - widthSrc, heightSrc, bitmap, bitmap_size ); - HeapFree(GetProcessHeap(), 0, bitmap); - PSDRV_WriteGRestore(dev); - PSDRV_ResetClip(dev); - return abs(heightSrc); -} diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 3a6f89f..4532097 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -931,7 +931,7 @@ static const struct gdi_dc_funcs psdrv_funcs = PSDRV_StartDoc, /* pStartDoc */ PSDRV_StartPage, /* pStartPage */ NULL, /* pStretchBlt */ - PSDRV_StretchDIBits, /* pStretchDIBits */ + NULL, /* pStretchDIBits */ NULL, /* pStrokeAndFillPath */ NULL, /* pStrokePath */ NULL, /* pSwapBuffers */ diff --git a/dlls/wineps.drv/psdrv.h b/dlls/wineps.drv/psdrv.h index 8047942..3f48991 100644 --- a/dlls/wineps.drv/psdrv.h +++ b/dlls/wineps.drv/psdrv.h @@ -459,10 +459,6 @@ extern COLORREF PSDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDD extern COLORREF PSDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF PSDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern INT PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc ) DECLSPEC_HIDDEN; -extern INT PSDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, - INT heightDst, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, const void *bits, - BITMAPINFO *info, UINT wUsage, DWORD dwRop ) DECLSPEC_HIDDEN; extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2, PRINTERINFO *pi) DECLSPEC_HIDDEN;
1
0
0
0
Ričardas Barkauskas : ddraw: COM cleanup for IDirect3DDevice7 interface.
by Alexandre Julliard
17 Oct '11
17 Oct '11
Module: wine Branch: master Commit: 472a8f7a678e85de57e42de20d0563fb2006a221 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=472a8f7a678e85de57e42de20…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Oct 17 16:58:51 2011 +0300 ddraw: COM cleanup for IDirect3DDevice7 interface. --- dlls/ddraw/ddraw.c | 2 +- dlls/ddraw/ddraw_private.h | 4 +- dlls/ddraw/device.c | 100 ++++++++++++++++++++++---------------------- dlls/ddraw/executebuffer.c | 6 +- dlls/ddraw/light.c | 6 +- dlls/ddraw/main.c | 2 +- dlls/ddraw/material.c | 2 +- dlls/ddraw/vertexbuffer.c | 6 +- dlls/ddraw/viewport.c | 6 +- 9 files changed, 67 insertions(+), 67 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=472a8f7a678e85de57e42…
1
0
0
0
Ričardas Barkauskas : ddraw: Use impl_from_IDirect3DDevice7 for application provided interfaces.
by Alexandre Julliard
17 Oct '11
17 Oct '11
Module: wine Branch: master Commit: 7dc08745d1edcf81347dcdf5fbe5b57ea1baf970 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7dc08745d1edcf81347dcdf5f…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Oct 17 16:58:40 2011 +0300 ddraw: Use impl_from_IDirect3DDevice7 for application provided interfaces. --- dlls/ddraw/ddraw.c | 4 +- dlls/ddraw/ddraw_private.h | 5 ++ dlls/ddraw/device.c | 88 ++++++++++++++++++++++---------------------- dlls/ddraw/surface.c | 4 +- 4 files changed, 54 insertions(+), 47 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7dc08745d1edcf81347dc…
1
0
0
0
Ričardas Barkauskas : ddraw: Use unsafe_impl_from_IDirect3DDevice7 for application provided interfaces.
by Alexandre Julliard
17 Oct '11
17 Oct '11
Module: wine Branch: master Commit: 31cf68dd95c407f74a8ead9f5e46eda393bd292e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=31cf68dd95c407f74a8ead9f5…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Oct 17 16:58:25 2011 +0300 ddraw: Use unsafe_impl_from_IDirect3DDevice7 for application provided interfaces. --- dlls/ddraw/ddraw_private.h | 1 + dlls/ddraw/device.c | 7 +++++++ dlls/ddraw/vertexbuffer.c | 18 +++++++++--------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 7031e15..f75fcbf 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -343,6 +343,7 @@ static inline IDirect3DDeviceImpl *impl_from_IDirect3DDevice3(IDirect3DDevice3 * IDirect3DDeviceImpl *unsafe_impl_from_IDirect3DDevice(IDirect3DDevice *iface) DECLSPEC_HIDDEN; IDirect3DDeviceImpl *unsafe_impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface) DECLSPEC_HIDDEN; IDirect3DDeviceImpl *unsafe_impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface) DECLSPEC_HIDDEN; +IDirect3DDeviceImpl *unsafe_impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface) DECLSPEC_HIDDEN; /***************************************************************************** * IDirectDrawClipper implementation structure diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 8513f71..e29ee15 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -6770,6 +6770,13 @@ static const struct IDirect3DDeviceVtbl d3d_device1_vtbl = IDirect3DDeviceImpl_1_GetDirect3D }; +IDirect3DDeviceImpl *unsafe_impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface) +{ + if (!iface) return NULL; + assert((iface->lpVtbl == &d3d_device7_fpu_preserve_vtbl) || (iface->lpVtbl == &d3d_device7_fpu_setup_vtbl)); + return CONTAINING_RECORD(iface, IDirect3DDeviceImpl, lpVtbl); +} + IDirect3DDeviceImpl *unsafe_impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface) { if (!iface) return NULL; diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index f675cda..8c4d201 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -303,16 +303,16 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_1_Unlock(IDirect3DVertexBuffer * *****************************************************************************/ static HRESULT WINAPI IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface, DWORD VertexOp, DWORD DestIndex, DWORD Count, IDirect3DVertexBuffer7 *SrcBuffer, - DWORD SrcIndex, IDirect3DDevice7 *D3DDevice, DWORD Flags) + DWORD SrcIndex, IDirect3DDevice7 *device, DWORD Flags) { IDirect3DVertexBufferImpl *This = impl_from_IDirect3DVertexBuffer7(iface); IDirect3DVertexBufferImpl *Src = unsafe_impl_from_IDirect3DVertexBuffer7(SrcBuffer); - IDirect3DDeviceImpl *D3D = (IDirect3DDeviceImpl *)D3DDevice; + IDirect3DDeviceImpl *device_impl = unsafe_impl_from_IDirect3DDevice7(device); BOOL oldClip, doClip; HRESULT hr; TRACE("iface %p, vertex_op %#x, dst_idx %u, count %u, src_buffer %p, src_idx %u, device %p, flags %#x.\n", - iface, VertexOp, DestIndex, Count, SrcBuffer, SrcIndex, D3DDevice, Flags); + iface, VertexOp, DestIndex, Count, SrcBuffer, SrcIndex, device, Flags); /* Vertex operations: * D3DVOP_CLIP: Clips vertices outside the viewing frustrum. Needs clipping information @@ -332,19 +332,19 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexB * the vertex ops */ doClip = VertexOp & D3DVOP_CLIP ? TRUE : FALSE; - wined3d_device_get_render_state(D3D->wined3d_device, WINED3DRS_CLIPPING, (DWORD *)&oldClip); + wined3d_device_get_render_state(device_impl->wined3d_device, WINED3DRS_CLIPPING, (DWORD *)&oldClip); if (doClip != oldClip) - wined3d_device_set_render_state(D3D->wined3d_device, WINED3DRS_CLIPPING, doClip); + wined3d_device_set_render_state(device_impl->wined3d_device, WINED3DRS_CLIPPING, doClip); - wined3d_device_set_stream_source(D3D->wined3d_device, + wined3d_device_set_stream_source(device_impl->wined3d_device, 0, Src->wineD3DVertexBuffer, 0, get_flexible_vertex_size(Src->fvf)); - wined3d_device_set_vertex_declaration(D3D->wined3d_device, Src->wineD3DVertexDeclaration); - hr = wined3d_device_process_vertices(D3D->wined3d_device, SrcIndex, DestIndex, + wined3d_device_set_vertex_declaration(device_impl->wined3d_device, Src->wineD3DVertexDeclaration); + hr = wined3d_device_process_vertices(device_impl->wined3d_device, SrcIndex, DestIndex, Count, This->wineD3DVertexBuffer, NULL, Flags, This->fvf); /* Restore the states if needed */ if (doClip != oldClip) - wined3d_device_set_render_state(D3D->wined3d_device, WINED3DRS_CLIPPING, oldClip); + wined3d_device_set_render_state(device_impl->wined3d_device, WINED3DRS_CLIPPING, oldClip); LeaveCriticalSection(&ddraw_cs); return hr; }
1
0
0
0
Ričardas Barkauskas : ddraw: COM cleanup for IDirect3DDevice3 interface.
by Alexandre Julliard
17 Oct '11
17 Oct '11
Module: wine Branch: master Commit: 6b7e3e77d0c1d9bd0cd5795b0fa8811c1e7cd47b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b7e3e77d0c1d9bd0cd5795b0…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Oct 17 16:58:11 2011 +0300 ddraw: COM cleanup for IDirect3DDevice3 interface. --- dlls/ddraw/ddraw.c | 11 +++++++-- dlls/ddraw/ddraw_private.h | 4 +- dlls/ddraw/device.c | 48 ++++++++++++++++++++++---------------------- dlls/ddraw/material.c | 4 +- dlls/ddraw/viewport.c | 8 +++--- 5 files changed, 40 insertions(+), 35 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6b7e3e77d0c1d9bd0cd57…
1
0
0
0
Ričardas Barkauskas : ddraw: Rename device_from_device3 to impl_from_IDirect3DDevice3.
by Alexandre Julliard
17 Oct '11
17 Oct '11
Module: wine Branch: master Commit: bd530d3aba2e356b6ae7d2a82ba5aba283cbe9d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bd530d3aba2e356b6ae7d2a82…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Oct 17 16:58:00 2011 +0300 ddraw: Rename device_from_device3 to impl_from_IDirect3DDevice3. --- dlls/ddraw/ddraw_private.h | 4 +- dlls/ddraw/device.c | 104 +++++++++++++++++++++++++++----------------- 2 files changed, 66 insertions(+), 42 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=bd530d3aba2e356b6ae7d…
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
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