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
August 2012
----- 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
541 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11: Remove unnecessary cleanups on process exit.
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: f9a383323f7413da56a75c345a8317f3f295e726 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f9a383323f7413da56a75c345…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 14 14:54:39 2012 +0200 winex11: Remove unnecessary cleanups on process exit. --- dlls/winex11.drv/clipboard.c | 10 ---------- dlls/winex11.drv/ime.c | 5 ----- dlls/winex11.drv/init.c | 10 ---------- dlls/winex11.drv/palette.c | 16 ---------------- dlls/winex11.drv/x11drv.h | 7 ------- dlls/winex11.drv/x11drv_main.c | 22 ---------------------- dlls/winex11.drv/xrender.c | 18 ------------------ dlls/winex11.drv/xvidmode.c | 9 --------- 8 files changed, 0 insertions(+), 97 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index dde0270..ce7ddfa 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -3303,13 +3303,3 @@ void X11DRV_SelectionClear( HWND hWnd, XEvent *xev ) X11DRV_CLIPBOARD_ReleaseSelection( event->display, event->selection, event->window, hWnd, event->time ); } - -/*********************************************************************** - * X11DRV_Clipboard_Cleanup - */ -void X11DRV_Clipboard_Cleanup(void) -{ - selectionAcquired = S_NOSELECTION; - - X11DRV_EmptyClipboard(FALSE); -} diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c index b343a64..6a99c24 100644 --- a/dlls/winex11.drv/ime.c +++ b/dlls/winex11.drv/ime.c @@ -153,11 +153,6 @@ static void IME_RegisterClasses(void) WM_MSIME_DOCUMENTFEED = RegisterWindowMessageA("MSIMEDocumentFeed"); } -void IME_UnregisterClasses(void) -{ - UnregisterClassW(UI_CLASS_NAME, x11drv_module); -} - static HIMCC ImeCreateBlankCompStr(void) { HIMCC rc; diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index ec494ee..8124ab5 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -100,16 +100,6 @@ static void device_init(void) vert_size = MulDiv( screen_height, 254, log_pixels_y * 10 ); } -/********************************************************************** - * X11DRV_GDI_Finalize - */ -void X11DRV_GDI_Finalize(void) -{ - X11DRV_PALETTE_Cleanup(); - /* don't bother to close the display, it often triggers X bugs */ - /* XCloseDisplay( gdi_display ); */ -} - static X11DRV_PDEVICE *create_x11_physdev( Drawable drawable ) { diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c index a2eb5e9..b6d6c47 100644 --- a/dlls/winex11.drv/palette.c +++ b/dlls/winex11.drv/palette.c @@ -249,22 +249,6 @@ int X11DRV_PALETTE_Init(void) } /*********************************************************************** - * X11DRV_PALETTE_Cleanup - * - * Free external colors we grabbed in the FillDefaultPalette() - */ -void X11DRV_PALETTE_Cleanup(void) -{ - if( COLOR_gapFilled ) - { - XFreeColors(gdi_display, X11DRV_PALETTE_PaletteXColormap, - (unsigned long*)(X11DRV_PALETTE_PaletteToXPixel + COLOR_gapStart), - COLOR_gapFilled, 0); - } - DeleteCriticalSection(&palette_cs); -} - -/*********************************************************************** * X11DRV_PALETTE_ComputeChannelShift * * Calculate conversion parameters for a given color mask diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 59bc672..8c3b38d 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -221,13 +221,11 @@ extern int client_side_with_render DECLSPEC_HIDDEN; extern int client_side_antialias_with_core DECLSPEC_HIDDEN; extern int client_side_antialias_with_render DECLSPEC_HIDDEN; extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void) DECLSPEC_HIDDEN; -extern void X11DRV_XRender_Finalize(void) DECLSPEC_HIDDEN; extern const struct gdi_dc_funcs *get_glx_driver(void) DECLSPEC_HIDDEN; extern BOOL destroy_glxpixmap(Display *display, XID glxpixmap) DECLSPEC_HIDDEN; /* IME support */ -extern void IME_UnregisterClasses(void) DECLSPEC_HIDDEN; extern void IME_SetOpenStatus(BOOL fOpen) DECLSPEC_HIDDEN; extern void IME_SetCompositionStatus(BOOL fOpen) DECLSPEC_HIDDEN; extern INT IME_GetCursorPos(void) DECLSPEC_HIDDEN; @@ -247,8 +245,6 @@ extern void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event ) DECL * X11 GDI driver */ -extern void X11DRV_GDI_Finalize(void) DECLSPEC_HIDDEN; - extern Display *gdi_display DECLSPEC_HIDDEN; /* display to use for all GDI functions */ /* X11 GDI palette driver */ @@ -269,7 +265,6 @@ extern ColorShifts X11DRV_PALETTE_default_shifts DECLSPEC_HIDDEN; extern int X11DRV_PALETTE_mapEGAPixel[16] DECLSPEC_HIDDEN; extern int X11DRV_PALETTE_Init(void) DECLSPEC_HIDDEN; -extern void X11DRV_PALETTE_Cleanup(void) DECLSPEC_HIDDEN; extern BOOL X11DRV_IsSolidColor(COLORREF color) DECLSPEC_HIDDEN; extern COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel) DECLSPEC_HIDDEN; @@ -618,7 +613,6 @@ extern XContext winContext DECLSPEC_HIDDEN; extern void X11DRV_InitClipboard(void) DECLSPEC_HIDDEN; extern int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow) DECLSPEC_HIDDEN; -extern void X11DRV_Clipboard_Cleanup(void) DECLSPEC_HIDDEN; extern void X11DRV_ResetSelectionOwner(void) DECLSPEC_HIDDEN; extern void CDECL X11DRV_SetFocus( HWND hwnd ) DECLSPEC_HIDDEN; extern void set_window_cursor( Window window, HCURSOR handle ) DECLSPEC_HIDDEN; @@ -661,7 +655,6 @@ struct x11drv_mode_info *X11DRV_Settings_SetHandlers(const char *name, int reserve_depths) DECLSPEC_HIDDEN; void X11DRV_XF86VM_Init(void) DECLSPEC_HIDDEN; -void X11DRV_XF86VM_Cleanup(void) DECLSPEC_HIDDEN; void X11DRV_XRandR_Init(void) DECLSPEC_HIDDEN; /* XIM support */ diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 756737b..f660953 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -611,25 +611,6 @@ static void thread_detach(void) } -/*********************************************************************** - * X11DRV process termination routine - */ -static void process_detach(void) -{ - X11DRV_Clipboard_Cleanup(); - /* cleanup XVidMode */ - X11DRV_XF86VM_Cleanup(); - X11DRV_XRender_Finalize(); - - /* cleanup GDI */ - X11DRV_GDI_Finalize(); - - IME_UnregisterClasses(); - DeleteCriticalSection( &X11DRV_CritSection ); - TlsFree( thread_data_tls_index ); -} - - /* store the display fd into the message queue */ static void set_queue_display_fd( Display *display ) { @@ -713,9 +694,6 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) case DLL_THREAD_DETACH: thread_detach(); break; - case DLL_PROCESS_DETACH: - process_detach(); - break; } return ret; } diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 2ad6f15..5d88450 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -1039,20 +1039,6 @@ static void lfsz_calc_hash(LFANDSIZE *plfsz) return; } -/*********************************************************************** - * X11DRV_XRender_Finalize - */ -void X11DRV_XRender_Finalize(void) -{ - int i; - - EnterCriticalSection(&xrender_cs); - for(i = mru; i >= 0; i = glyphsetCache[i].next) - FreeEntry(i); - LeaveCriticalSection(&xrender_cs); - DeleteCriticalSection(&xrender_cs); -} - /********************************************************************** * xrenderdrv_SelectFont */ @@ -2515,8 +2501,4 @@ const struct gdi_dc_funcs *X11DRV_XRender_Init(void) return NULL; } -void X11DRV_XRender_Finalize(void) -{ -} - #endif /* SONAME_LIBXRENDER */ diff --git a/dlls/winex11.drv/xvidmode.c b/dlls/winex11.drv/xvidmode.c index 530665b..3c92df5 100644 --- a/dlls/winex11.drv/xvidmode.c +++ b/dlls/winex11.drv/xvidmode.c @@ -248,11 +248,6 @@ sym_not_found: usexvidmode = 0; } -void X11DRV_XF86VM_Cleanup(void) -{ - if (real_xf86vm_modes) XFree(real_xf86vm_modes); -} - /***** GAMMA CONTROL *****/ /* (only available in XF86VidMode 2.x) */ @@ -391,10 +386,6 @@ void X11DRV_XF86VM_Init(void) TRACE("XVidMode support not compiled in.\n"); } -void X11DRV_XF86VM_Cleanup(void) -{ -} - #endif /* SONAME_LIBXXF86VM */ /***********************************************************************
1
0
0
0
Aric Stewart : usp10: Correct rounding of negative offsets in GPOS.
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: cd8c1b28ad32ec115a304377b277f96a0e5a671e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cd8c1b28ad32ec115a304377b…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue Aug 14 09:32:08 2012 -0500 usp10: Correct rounding of negative offsets in GPOS. --- dlls/usp10/opentype.c | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index a21e0f1..05ac53f 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -43,6 +43,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(uniscribe); #define GET_BE_DWORD(x) RtlUlongByteSwap(x) #endif +#define round(x) (((x) < 0) ? (int)((x) - 0.5) : (int)((x) + 0.5)) + /* These are all structures needed for the cmap format 12 table */ #define CMAP_TAG MS_MAKE_TAG('c', 'm', 'a', 'p') @@ -1403,13 +1405,13 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, I if (adjust.x || adjust.y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, adjust.x, adjust.y, &devX, &devY); - pGoffset[glyph_index].du += (int)(devX+0.5); - pGoffset[glyph_index].dv += (int)(devY+0.5); + pGoffset[glyph_index].du += round(devX); + pGoffset[glyph_index].dv += round(devY); } if (advance.x || advance.y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, advance.x, advance.y, &devX, &devY); - piAdvance[glyph_index] += (int)(devX+0.5); + piAdvance[glyph_index] += round(devX); if (advance.y) FIXME("Unhandled adjustment to Y advancement\n"); } @@ -1424,24 +1426,24 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, I if (adjust[0].x || adjust[0].y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, adjust[0].x, adjust[0].y, &devX, &devY); - pGoffset[glyph_index].du += (int)(devX+0.5); - pGoffset[glyph_index].dv += (int)(devY+0.5); + pGoffset[glyph_index].du += round(devX); + pGoffset[glyph_index].dv += round(devY); } if (advance[0].x || advance[0].y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, advance[0].x, advance[0].y, &devX, &devY); - piAdvance[glyph_index] += (int)(devX+0.5); + piAdvance[glyph_index] += round(devX); } if (adjust[1].x || adjust[1].y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, adjust[1].x, adjust[1].y, &devX, &devY); - pGoffset[glyph_index + write_dir].du += (int)(devX+0.5); - pGoffset[glyph_index + write_dir].dv += (int)(devY+0.5); + pGoffset[glyph_index + write_dir].du += round(devX); + pGoffset[glyph_index + write_dir].dv += round(devY); } if (advance[1].x || advance[1].y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, advance[1].x, advance[1].y, &devX, &devY); - piAdvance[glyph_index + write_dir] += (int)(devX+0.5); + piAdvance[glyph_index + write_dir] += round(devX); } return index; } @@ -1453,8 +1455,8 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, I if (desU.x || desU.y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, desU.x, desU.y, &devX, &devY); - pGoffset[glyph_index].du += ((int)(devX+0.5) - piAdvance[glyph_index-1]); - pGoffset[glyph_index].dv += (int)(devY+0.5); + pGoffset[glyph_index].du += (round(devX) - piAdvance[glyph_index-1]); + pGoffset[glyph_index].dv += round(devY); } break; }
1
0
0
0
Aric Stewart : usp10: Correct implementation of Pair Positioning Adjustment : Format 1.
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: e2250ce6cb5c364242f4f7d954561cf2df75e534 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e2250ce6cb5c364242f4f7d95…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue Aug 14 09:32:02 2012 -0500 usp10: Correct implementation of Pair Positioning Adjustment: Format 1. --- dlls/usp10/opentype.c | 67 +++++++++++++++++++++++++----------------------- 1 files changed, 35 insertions(+), 32 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index cc57f65..a21e0f1 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -1174,44 +1174,47 @@ static INT GPOS_apply_PairAdjustment(const OT_LookupTable *look, const WORD *gly ppf1 = (const GPOS_PairPosFormat1*)((const BYTE*)look+offset); if (GET_BE_WORD(ppf1->PosFormat) == 1) { + int index; offset = GET_BE_WORD(ppf1->Coverage); - if (GSUB_is_glyph_covered((const BYTE*)ppf1+offset, glyphs[glyph_index]) != -1) + index = GSUB_is_glyph_covered((const BYTE*)ppf1+offset, glyphs[glyph_index]); + if (index != -1 && index < GET_BE_WORD(ppf1->PairSetCount)) { - int i; - int count = GET_BE_WORD(ppf1->PairSetCount); - for (i = 0; i < count; i++) + int k; + int pair_count; + const GPOS_PairSet *ps; + offset = GET_BE_WORD(ppf1->PairSetOffset[index]); + ps = (const GPOS_PairSet*)((const BYTE*)ppf1+offset); + pair_count = GET_BE_WORD(ps->PairValueCount); + for (k = 0; k < pair_count; k++) { - int k; - int pair_count; - const GPOS_PairSet *ps; - offset = GET_BE_WORD(ppf1->PairSetOffset[i]); - ps = (const GPOS_PairSet*)((const BYTE*)ppf1+offset); - pair_count = GET_BE_WORD(ps->PairValueCount); - for (k = 0; k < pair_count; k++) + WORD second_glyph = GET_BE_WORD(ps->PairValueRecord[k].SecondGlyph); + if (glyphs[glyph_index+write_dir] == second_glyph) { - if (glyphs[glyph_index+write_dir] == GET_BE_WORD(ps->PairValueRecord[k].SecondGlyph)) + int next = 1; + GPOS_ValueRecord ValueRecord1 = {0,0,0,0,0,0,0,0}; + GPOS_ValueRecord ValueRecord2 = {0,0,0,0,0,0,0,0}; + WORD ValueFormat1 = GET_BE_WORD(ppf1->ValueFormat1); + WORD ValueFormat2 = GET_BE_WORD(ppf1->ValueFormat2); + + TRACE("Format 1: Found Pair %x,%x\n",glyphs[glyph_index],glyphs[glyph_index+write_dir]); + + offset = GPOS_get_value_record(ValueFormat1, ps->PairValueRecord[k].Value1, &ValueRecord1); + GPOS_get_value_record(ValueFormat2, (WORD*)((const BYTE*)(ps->PairValueRecord[k].Value2)+offset), &ValueRecord2); + if (ValueFormat1) + { + GPOS_get_value_record_offsets((const BYTE*)ppf1, &ValueRecord1, ValueFormat1, ppem, &ptAdjust[0], &ptAdvance[0]); + TRACE("Glyph 1 resulting cumulative offset is %i,%i design units\n",ptAdjust[0].x,ptAdjust[0].y); + TRACE("Glyph 1 resulting cumulative advance is %i,%i design units\n",ptAdvance[0].x,ptAdvance[0].y); + } + if (ValueFormat2) { - GPOS_ValueRecord ValueRecord1 = {0,0,0,0,0,0,0,0}; - GPOS_ValueRecord ValueRecord2 = {0,0,0,0,0,0,0,0}; - WORD ValueFormat1 = GET_BE_WORD(ppf1->ValueFormat1); - WORD ValueFormat2 = GET_BE_WORD(ppf1->ValueFormat2); - - TRACE("Format 1: Found Pair %x,%x\n",glyphs[glyph_index],glyphs[glyph_index+write_dir]); - - offset = GPOS_get_value_record(ValueFormat1, ps->PairValueRecord[k].Value1, &ValueRecord1); - GPOS_get_value_record(ValueFormat2, (WORD*)((const BYTE*)(ps->PairValueRecord[k].Value2)+offset), &ValueRecord2); - if (ValueFormat1) - { - GPOS_get_value_record_offsets((const BYTE*)ppf1, &ValueRecord1, ValueFormat1, ppem, &ptAdjust[0], &ptAdvance[0]); - TRACE("Glyph 1 resulting cumulative offset is %i,%i design units\n",ptAdjust[0].x,ptAdjust[0].y); - } - if (ValueFormat2) - { - GPOS_get_value_record_offsets((const BYTE*)ppf1, &ValueRecord2, ValueFormat2, ppem, &ptAdjust[1], &ptAdvance[1]); - TRACE("Glyph 2 resulting cumulative offset is %i,%i design units\n",ptAdjust[1].x,ptAdjust[1].y); - return glyph_index+2; - } + GPOS_get_value_record_offsets((const BYTE*)ppf1, &ValueRecord2, ValueFormat2, ppem, &ptAdjust[1], &ptAdvance[1]); + TRACE("Glyph 2 resulting cumulative offset is %i,%i design units\n",ptAdjust[1].x,ptAdjust[1].y); + TRACE("Glyph 2 resulting cumulative advance is %i,%i design units\n",ptAdvance[1].x,ptAdvance[1].y); + next++; } + if (next) + return glyph_index + next; } } }
1
0
0
0
Dmitry Timoshkov : gdiplus: Forward GdipDrawImage to GdipDrawImagePointRect .
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: fa7a34b907ea842134a31b1ad24660d7630d09c0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fa7a34b907ea842134a31b1ad…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Aug 15 12:08:22 2012 +0900 gdiplus: Forward GdipDrawImage to GdipDrawImagePointRect. --- dlls/gdiplus/graphics.c | 12 ++---------- 1 files changed, 2 insertions(+), 10 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 5c0ddf9..77f2f8d 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2943,7 +2943,6 @@ GpStatus WINGDIPAPI GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x, GpStatus WINGDIPAPI GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, REAL y) { UINT width, height; - GpPointF points[3]; TRACE("(%p, %p, %.2f, %.2f)\n", graphics, image, x, y); @@ -2953,15 +2952,8 @@ GpStatus WINGDIPAPI GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, GdipGetImageWidth(image, &width); GdipGetImageHeight(image, &height); - /* FIXME: we should use the graphics and image dpi, somehow */ - - points[0].X = points[2].X = x; - points[0].Y = points[1].Y = y; - points[1].X = x + width; - points[2].Y = y + height; - - return GdipDrawImagePointsRect(graphics, image, points, 3, 0, 0, width, height, - UnitPixel, NULL, NULL, NULL); + return GdipDrawImagePointRect(graphics, image, x, y, + 0.0, 0.0, (REAL)width, (REAL)height, UnitPixel); } GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x,
1
0
0
0
Dmitry Timoshkov : gdiplus: Add a test for GdipDrawImage scaling.
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: 3b8f437f447554c6d56997247f401f24dff7fa32 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3b8f437f447554c6d56997247…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Aug 15 12:07:40 2012 +0900 gdiplus: Add a test for GdipDrawImage scaling. --- dlls/gdiplus/tests/image.c | 109 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 109 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 0595cc2..24cb434 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -2,6 +2,7 @@ * Unit test suite for images * * Copyright (C) 2007 Google (Evan Stade) + * Copyright (C) 2012 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -3607,6 +3608,112 @@ static void test_bitmapbits(void) } } +static void test_DrawImage(void) +{ + BYTE black_1x1[4] = { 0,0,0,0 }; + BYTE white_2x2[16] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }; + BYTE black_2x2[16] = { 0,0,0,0,0,0,0xff,0xff, + 0,0,0,0,0,0,0xff,0xff }; + GpStatus status; + union + { + GpBitmap *bitmap; + GpImage *image; + } u1, u2; + GpGraphics *graphics; + int match; + + status = GdipCreateBitmapFromScan0(1, 1, 4, PixelFormat24bppRGB, black_1x1, &u1.bitmap); + expect(Ok, status); + status = GdipBitmapSetResolution(u1.bitmap, 100.0, 100.0); + expect(Ok, status); + + status = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat24bppRGB, white_2x2, &u2.bitmap); + expect(Ok, status); + status = GdipBitmapSetResolution(u2.bitmap, 300.0, 300.0); + expect(Ok, status); + status = GdipGetImageGraphicsContext(u2.image, &graphics); + expect(Ok, status); + status = GdipSetInterpolationMode(graphics, InterpolationModeNearestNeighbor); + expect(Ok, status); + + status = GdipDrawImageI(graphics, u1.image, 0, 0); + expect(Ok, status); + + match = memcmp(white_2x2, black_2x2, sizeof(black_2x2)) == 0; +todo_wine + ok(match, "data should match\n"); + if (!match) + { + UINT i, size = sizeof(white_2x2); + BYTE *bits = white_2x2; + for (i = 0; i < size; i++) + printf(" %02x", bits[i]); + printf("\n"); + } + + status = GdipDeleteGraphics(graphics); + expect(Ok, status); + status = GdipDisposeImage(u1.image); + expect(Ok, status); + status = GdipDisposeImage(u2.image); + expect(Ok, status); +} + +static void test_GdipDrawImagePointRect(void) +{ + BYTE black_1x1[4] = { 0,0,0,0 }; + BYTE white_2x2[16] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }; + BYTE black_2x2[16] = { 0,0,0,0,0,0,0xff,0xff, + 0,0,0,0,0,0,0xff,0xff }; + GpStatus status; + union + { + GpBitmap *bitmap; + GpImage *image; + } u1, u2; + GpGraphics *graphics; + int match; + + status = GdipCreateBitmapFromScan0(1, 1, 4, PixelFormat24bppRGB, black_1x1, &u1.bitmap); + expect(Ok, status); + status = GdipBitmapSetResolution(u1.bitmap, 100.0, 100.0); + expect(Ok, status); + + status = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat24bppRGB, white_2x2, &u2.bitmap); + expect(Ok, status); + status = GdipBitmapSetResolution(u2.bitmap, 300.0, 300.0); + expect(Ok, status); + status = GdipGetImageGraphicsContext(u2.image, &graphics); + expect(Ok, status); + status = GdipSetInterpolationMode(graphics, InterpolationModeNearestNeighbor); + expect(Ok, status); + + status = GdipDrawImagePointRectI(graphics, u1.image, 0, 0, 0, 0, 1, 1, UnitPixel); + expect(Ok, status); + + match = memcmp(white_2x2, black_2x2, sizeof(black_2x2)) == 0; +todo_wine + ok(match, "data should match\n"); + if (!match) + { + UINT i, size = sizeof(white_2x2); + BYTE *bits = white_2x2; + for (i = 0; i < size; i++) + printf(" %02x", bits[i]); + printf("\n"); + } + + status = GdipDeleteGraphics(graphics); + expect(Ok, status); + status = GdipDisposeImage(u1.image); + expect(Ok, status); + status = GdipDisposeImage(u2.image); + expect(Ok, status); +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -3619,6 +3726,8 @@ START_TEST(image) GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + test_DrawImage(); + test_GdipDrawImagePointRect(); test_bitmapbits(); test_tiff_palette(); test_GdipGetAllPropertyItems();
1
0
0
0
Dmitry Timoshkov : gdiplus: Add a test for font height scaling.
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: 50931d89854ee19f047f3bb77bb97aa40c28d71f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=50931d89854ee19f047f3bb77…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Aug 15 12:06:59 2012 +0900 gdiplus: Add a test for font height scaling. --- dlls/gdiplus/tests/graphics.c | 98 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 647c26a..1c6ef6e 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3674,6 +3674,103 @@ static void test_transform(void) } } +/* Many people on the net ask why there is so much difference in rendered + * text height between gdiplus and gdi32, this test suggests an answer to + * that question. Important: this test assumes that font dpi == device dpi. + */ +static void test_font_height_scaling(void) +{ + static const WCHAR tahomaW[] = { 'T','a','h','o','m','a',0 }; + static const WCHAR string[] = { '1','2','3','4','5','6','7',0 }; + HDC hdc; + GpStringFormat *format; + GpGraphics *graphics; + GpFontFamily *family; + GpFont *font; + GpStatus status; + RectF bounds, rect; + REAL height, dpi; + PointF ptf; + GpUnit gfx_unit, font_unit; + + status = GdipCreateStringFormat(0, LANG_NEUTRAL, &format); + expect(Ok, status); + status = GdipCreateFontFamilyFromName(tahomaW, NULL, &family); + expect(Ok, status); + + hdc = CreateCompatibleDC(0); + status = GdipCreateFromHDC(hdc, &graphics); + + status = GdipGetDpiY(graphics, &dpi); + expect(Ok, status); + + /* UnitPixel = 2, UnitPoint = 3, UnitInch = 4, UnitDocument = 5, UnitMillimeter = 6 */ + /* UnitPixel as a font base unit is not tested because it drastically + differs in behaviour */ + for (font_unit = 3; font_unit <= 6; font_unit++) + { + /* There is a bug somewhere in native gdiplus that leads + * to extra conversion from points to pixels, so in order + * to get a 100 pixel text height it's needed to convert + * 100 pixels to points, and only then convert the result + * to desired units. The scale factor is 1.333333 at 96 dpi! + * Perhaps an implementor took name of GdipTransformPoints + * directly and assumed that it takes value in *points*? + */ + status = GdipSetPageUnit(graphics, UnitPoint); + expect(Ok, status); + ptf.X = 0; + ptf.Y = 100.0; + status = GdipTransformPoints(graphics, CoordinateSpaceWorld, CoordinateSpaceDevice, &ptf, 1); + expect(Ok, status); + trace("100.0 pixels, %.1f dpi => %f points\n", dpi, ptf.Y); + status = GdipSetPageUnit(graphics, font_unit); + expect(Ok, status); + status = GdipTransformPoints(graphics, CoordinateSpaceWorld, CoordinateSpaceDevice, &ptf, 1); + expect(Ok, status); + height = ptf.Y; + trace("height %f units\n", height); + status = GdipCreateFont(family, height, FontStyleRegular, font_unit, &font); + expect(Ok, status); + + /* UnitPixel = 2, UnitPoint = 3, UnitInch = 4, UnitDocument = 5, UnitMillimeter = 6 */ + for (gfx_unit = 2; gfx_unit <= 6; gfx_unit++) + { + int match; + + status = GdipSetPageUnit(graphics, gfx_unit); + expect(Ok, status); + + rect.X = 0.0; + rect.Y = 0.0; + rect.Width = 0; + rect.Height = 0; + bounds.X = 0.0; + bounds.Y = 0.0; + bounds.Width = 0; + bounds.Height = 0; + status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, NULL, NULL); + expect(Ok, status); + + ptf.X = 0; + ptf.Y = bounds.Height; + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, &ptf, 1); + expect(Ok, status); + match = fabs(100.0 - ptf.Y) <= 1.0; + ok(match || broken(!match) /* before win7 */, "Expected 100.0, got %f\n", ptf.Y); + + /* verify the result */ + ptf.Y = units_to_pixels(bounds.Height, gfx_unit, dpi); + match = fabs(100.0 - ptf.Y) <= 1.1; + ok(match || broken(!match) /* before win7 */, "Expected 100.0, got %f\n", ptf.Y); + } + } + + status = GdipDeleteGraphics(graphics); + expect(Ok, status); + DeleteDC(hdc); +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -3700,6 +3797,7 @@ START_TEST(graphics) GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + test_font_height_scaling(); test_transform(); test_GdipMeasureString(); test_constructor_destructor();
1
0
0
0
Dmitry Timoshkov : gdiplus: Replace convert_unit() by a clearer units_to_pixels() helper.
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: 6bb353858e8a8d9c21ad5eff6f78aa8b087f6914 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6bb353858e8a8d9c21ad5eff6…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Aug 15 12:04:52 2012 +0900 gdiplus: Replace convert_unit() by a clearer units_to_pixels() helper. --- dlls/gdiplus/gdiplus.c | 23 ----------------------- dlls/gdiplus/gdiplus_private.h | 1 - dlls/gdiplus/graphics.c | 11 +++++------ dlls/gdiplus/image.c | 35 ++++++----------------------------- 4 files changed, 11 insertions(+), 59 deletions(-) diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 0146a0f..9ada462 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -320,29 +320,6 @@ GpStatus hresult_to_status(HRESULT res) } } -/* converts a given unit to its value in inches */ -REAL convert_unit(REAL logpixels, GpUnit unit) -{ - switch(unit) - { - case UnitInch: - return logpixels; - case UnitPoint: - return logpixels / 72.0; - case UnitDocument: - return logpixels / 300.0; - case UnitMillimeter: - return logpixels / 25.4; - case UnitWorld: - ERR("cannot convert UnitWorld\n"); - return 0.0; - case UnitPixel: - case UnitDisplay: - default: - return 1.0; - } -} - /* converts a given unit to its value in pixels */ REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi) { diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index ac070fe..fbc6772 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -48,7 +48,6 @@ extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2, REAL startAngle, REAL sweepAngle) DECLSPEC_HIDDEN; extern REAL gdiplus_atan2(REAL dy, REAL dx) DECLSPEC_HIDDEN; extern GpStatus hresult_to_status(HRESULT res) DECLSPEC_HIDDEN; -extern REAL convert_unit(REAL logpixels, GpUnit unit) DECLSPEC_HIDDEN; extern REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi) DECLSPEC_HIDDEN; extern REAL pixels_to_units(REAL pixels, GpUnit unit, REAL dpi) DECLSPEC_HIDDEN; extern REAL units_scale(GpUnit from, GpUnit to, REAL dpi) DECLSPEC_HIDDEN; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 16e1bc0..5c0ddf9 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -254,8 +254,7 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen) width = sqrt((pt[1].X - pt[0].X) * (pt[1].X - pt[0].X) + (pt[1].Y - pt[0].Y) * (pt[1].Y - pt[0].Y)) / sqrt(2.0); - width *= pen->width * convert_unit(graphics->xres, - pen->unit == UnitWorld ? graphics->unit : pen->unit); + width *= units_to_pixels(pen->width, pen->unit == UnitWorld ? graphics->unit : pen->unit, graphics->xres); } if(pen->dash == DashStyleCustom){ @@ -311,8 +310,8 @@ static void transform_and_round_points(GpGraphics *graphics, POINT *pti, GpMatrix *matrix; int i; - scale_x = convert_unit(graphics->xres, graphics->unit); - scale_y = convert_unit(graphics->yres, graphics->unit); + scale_x = units_to_pixels(1.0, graphics->unit, graphics->xres); + scale_y = units_to_pixels(1.0, graphics->unit, graphics->yres); /* apply page scale */ if(graphics->unit != UnitDisplay) @@ -5990,8 +5989,8 @@ static GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace d if (dst_space != src_space && stat == Ok) { - scale_x = convert_unit(graphics->xres, graphics->unit); - scale_y = convert_unit(graphics->yres, graphics->unit); + scale_x = units_to_pixels(1.0, graphics->unit, graphics->xres); + scale_y = units_to_pixels(1.0, graphics->unit, graphics->yres); if(graphics->unit != UnitDisplay) { diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index f415a45..64ce8b6 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -2256,18 +2256,9 @@ GpStatus WINGDIPAPI GdipGetImageDimension(GpImage *image, REAL *width, return InvalidParameter; if(image->type == ImageTypeMetafile){ - HDC hdc = GetDC(0); - REAL res = (REAL)GetDeviceCaps(hdc, LOGPIXELSX); - - ReleaseDC(0, hdc); - - *height = convert_unit(res, ((GpMetafile*)image)->unit) * - ((GpMetafile*)image)->bounds.Height; - - *width = convert_unit(res, ((GpMetafile*)image)->unit) * - ((GpMetafile*)image)->bounds.Width; + *height = units_to_pixels(((GpMetafile*)image)->bounds.Height, ((GpMetafile*)image)->unit, image->yres); + *width = units_to_pixels(((GpMetafile*)image)->bounds.Width, ((GpMetafile*)image)->unit, image->xres); } - else if(image->type == ImageTypeBitmap){ *height = ((GpBitmap*)image)->height; *width = ((GpBitmap*)image)->width; @@ -2326,15 +2317,8 @@ GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height) if(!image || !height) return InvalidParameter; - if(image->type == ImageTypeMetafile){ - HDC hdc = GetDC(0); - REAL res = (REAL)GetDeviceCaps(hdc, LOGPIXELSX); - - ReleaseDC(0, hdc); - - *height = roundr(convert_unit(res, ((GpMetafile*)image)->unit) * - ((GpMetafile*)image)->bounds.Height); - } + if(image->type == ImageTypeMetafile) + *height = units_to_pixels(((GpMetafile*)image)->bounds.Height, ((GpMetafile*)image)->unit, image->yres); else if(image->type == ImageTypeBitmap) *height = ((GpBitmap*)image)->height; else @@ -2433,15 +2417,8 @@ GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width) if(!image || !width) return InvalidParameter; - if(image->type == ImageTypeMetafile){ - HDC hdc = GetDC(0); - REAL res = (REAL)GetDeviceCaps(hdc, LOGPIXELSX); - - ReleaseDC(0, hdc); - - *width = roundr(convert_unit(res, ((GpMetafile*)image)->unit) * - ((GpMetafile*)image)->bounds.Width); - } + if(image->type == ImageTypeMetafile) + *width = units_to_pixels(((GpMetafile*)image)->bounds.Width, ((GpMetafile*)image)->unit, image->xres); else if(image->type == ImageTypeBitmap) *width = ((GpBitmap*)image)->width; else
1
0
0
0
Dmitry Timoshkov : gdiplus: GdipMeasureString should apply its internal scaling factors to layout rectangle .
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: 6f4625559ef2139a34d1e9f8bec819335024646a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6f4625559ef2139a34d1e9f8b…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Aug 15 12:04:07 2012 +0900 gdiplus: GdipMeasureString should apply its internal scaling factors to layout rectangle. --- dlls/gdiplus/graphics.c | 10 ++++++++-- dlls/gdiplus/tests/graphics.c | 31 +------------------------------ 2 files changed, 9 insertions(+), 32 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 41034e5..16e1bc0 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4999,7 +4999,7 @@ static GpStatus measure_string_callback(HDC hdc, REAL new_width, new_height; new_width = bounds->Width / args->rel_width; - new_height = (bounds->Height + bounds->Y - args->bounds->Y) / args->rel_height; + new_height = (bounds->Height + bounds->Y) / args->rel_height - args->bounds->Y; if (new_width > args->bounds->Width) args->bounds->Width = new_width; @@ -5029,6 +5029,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, struct measure_string_args args; HDC temp_hdc=NULL, hdc; GpPointF pt[3]; + RectF scaled_rect; TRACE("(%p, %s, %i, %p, %s, %p, %p, %p, %p)\n", graphics, debugstr_wn(string, length), length, font, debugstr_rectf(rect), format, @@ -5066,6 +5067,11 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, get_font_hfont(graphics, font, &gdifont); oldfont = SelectObject(hdc, gdifont); + scaled_rect.X = rect->X * args.rel_width; + scaled_rect.Y = rect->Y * args.rel_height; + scaled_rect.Width = rect->Width * args.rel_width; + scaled_rect.Height = rect->Height * args.rel_height; + bounds->X = rect->X; bounds->Y = rect->Y; bounds->Width = 0.0; @@ -5075,7 +5081,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, args.codepointsfitted = codepointsfitted; args.linesfilled = linesfilled; - gdip_format_string(hdc, string, length, font, rect, format, + gdip_format_string(hdc, string, length, font, &scaled_rect, format, measure_string_callback, &args); SelectObject(hdc, oldfont); diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index fb0c1cd..647c26a 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3513,13 +3513,6 @@ static void test_GdipMeasureString(void) expect(Ok, status); expectf(50.0, bounds.X); expectf(50.0, bounds.Y); - /* FIXME: remove once Wine is fixed */ - if (fabs(height - bounds.Height) > height / 100.0) - { - /* further testing is useless */ - GdipDeleteGraphics(graphics); - continue; - } expectf_(height, bounds.Height, height / 100.0); expectf_(bounds.Height / base_cy, bounds.Width / base_cx, 0.05); expect(7, chars); @@ -3584,23 +3577,8 @@ static void test_GdipMeasureString(void) base_cy = bounds.Height; } - /* FIXME: remove once Wine is fixed */ - if (fabs(height - bounds.Height) > height / 85.0) - { - /* further testing is useless */ - GdipDeleteGraphics(graphics); - continue; - } - expectf(0.0, bounds.X); expectf(0.0, bounds.Y); - /* FIXME: remove once Wine is fixed */ - if (fabs(height - bounds.Height) > height / 85.0) - { - /* further testing is useless */ - GdipDeleteGraphics(graphics); - continue; - } expectf_(height, bounds.Height, height / 85.0); expectf_(bounds.Height / base_cy, bounds.Width / base_cx, 0.05); expect(7, chars); @@ -3617,13 +3595,6 @@ static void test_GdipMeasureString(void) expect(Ok, status); expectf(50.0, bounds.X); expectf(50.0, bounds.Y); - /* FIXME: remove once Wine is fixed */ - if (fabs(height - bounds.Height) > height / 85.0) - { - /* further testing is useless */ - GdipDeleteGraphics(graphics); - continue; - } expectf_(height, bounds.Height, height / 85.0); expectf_(bounds.Height / base_cy, bounds.Width / base_cx, 0.05); expect(7, chars); @@ -3635,7 +3606,7 @@ static void test_GdipMeasureString(void) height *= td[i].page_scale; /*trace("%u: unit %u, %.1fx%.1f dpi, scale %.1f, height %f, pixels %f\n", i, td[i].unit, td[i].res_x, td[i].res_y, td[i].page_scale, bounds.Height, height);*/ - expectf_(100.0, height, 1.0); + expectf_(100.0, height, 1.1); status = GdipDeleteGraphics(graphics); expect(Ok, status);
1
0
0
0
Vincent Povirk : windowscodecs: Implement getters on IWICBitmapLock.
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: 46bbbd27412ec4b2245d1ccfc406ba3f289a3d4b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=46bbbd27412ec4b2245d1ccfc…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 14 15:24:58 2012 -0500 windowscodecs: Implement getters on IWICBitmapLock. --- dlls/windowscodecs/bitmap.c | 85 ++++++++++++++++++++++++++++++++++--- dlls/windowscodecs/tests/bitmap.c | 50 +++++++++++----------- 2 files changed, 103 insertions(+), 32 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=46bbbd27412ec4b2245d1…
1
0
0
0
Vincent Povirk : windowscodecs: Implement IWICBitmap::Lock.
by Alexandre Julliard
15 Aug '12
15 Aug '12
Module: wine Branch: master Commit: 297c10a2bc33d793646d667b2424e3012882f71b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=297c10a2bc33d793646d667b2…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 14 14:50:07 2012 -0500 windowscodecs: Implement IWICBitmap::Lock. --- dlls/windowscodecs/bitmap.c | 166 ++++++++++++++++++++++++++++++++++++- dlls/windowscodecs/tests/bitmap.c | 71 ++++++++-------- 2 files changed, 201 insertions(+), 36 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=297c10a2bc33d793646d6…
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
55
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
Results per page:
10
25
50
100
200