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
January 2012
----- 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
972 discussions
Start a n
N
ew thread
Alexandre Julliard : gdi32: Always store a DIBSECTION structure in the bitmap object.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: e896af40655a58681aeb6513fc6a439d46f0264f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e896af40655a58681aeb6513f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 10 16:04:17 2012 +0100 gdi32: Always store a DIBSECTION structure in the bitmap object. --- dlls/gdi32/bitmap.c | 6 +-- dlls/gdi32/brush.c | 10 ++-- dlls/gdi32/dib.c | 97 ++++++++++++++++++++-------------------------- dlls/gdi32/dibdrv/dc.c | 6 +- dlls/gdi32/gdi_private.h | 10 +++- 5 files changed, 58 insertions(+), 71 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e896af40655a58681aeb6…
1
0
0
0
Alexandre Julliard : gdi32: Get rid of the get_bitmap_funcs function.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: 8a9be0a30bd9e8b5fd5ab4e7c78905cfabefeb6b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8a9be0a30bd9e8b5fd5ab4e7c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 9 14:11:50 2012 +0100 gdi32: Get rid of the get_bitmap_funcs function. DIBs no longer use the display driver functions. --- dlls/gdi32/bitmap.c | 11 +++-------- dlls/gdi32/brush.c | 4 +--- dlls/gdi32/dib.c | 12 +++--------- dlls/gdi32/gdi_private.h | 6 ------ 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index ab93525..af96111 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -337,10 +337,8 @@ LONG WINAPI GetBitmapBits( struct bitblt_coords src; int dst_stride, max, ret; BITMAPOBJ *bmp = GDI_GetObjPtr( hbitmap, OBJ_BITMAP ); - const struct gdi_dc_funcs *funcs; if (!bmp) return 0; - funcs = get_bitmap_funcs( bmp ); dst_stride = get_bitmap_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); ret = max = dst_stride * bmp->bitmap.bmHeight; @@ -356,7 +354,7 @@ LONG WINAPI GetBitmapBits( src.width = src.visrect.right - src.visrect.left; src.height = src.visrect.bottom - src.visrect.top; - if (!funcs->pGetImage( NULL, hbitmap, info, &src_bits, &src )) + if (!bmp->funcs->pGetImage( NULL, hbitmap, info, &src_bits, &src )) { const char *src_ptr = src_bits.ptr; int src_stride = get_dib_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount ); @@ -410,15 +408,12 @@ LONG WINAPI SetBitmapBits( struct bitblt_coords src, dst; struct gdi_image_bits src_bits; HRGN clip = NULL; - const struct gdi_dc_funcs *funcs; if (!bits) return 0; bmp = GDI_GetObjPtr( hbitmap, OBJ_BITMAP ); if (!bmp) return 0; - funcs = get_bitmap_funcs( bmp ); - if (count < 0) { WARN("(%d): Negative number of bytes passed???\n", count ); count = -count; @@ -487,14 +482,14 @@ LONG WINAPI SetBitmapBits( info->bmiHeader.biWidth = 0; info->bmiHeader.biHeight = 0; info->bmiHeader.biSizeImage = 0; - err = funcs->pPutImage( NULL, hbitmap, 0, info, NULL, NULL, NULL, SRCCOPY ); + err = bmp->funcs->pPutImage( NULL, hbitmap, 0, info, NULL, NULL, NULL, SRCCOPY ); if (!err || err == ERROR_BAD_FORMAT) { info->bmiHeader.biWidth = bmp->bitmap.bmWidth; info->bmiHeader.biHeight = -dst.height; info->bmiHeader.biSizeImage = dst.height * dst_stride; - err = funcs->pPutImage( NULL, hbitmap, clip, info, &src_bits, &src, &dst, SRCCOPY ); + err = bmp->funcs->pPutImage( NULL, hbitmap, clip, info, &src_bits, &src, &dst, SRCCOPY ); } if (err) count = 0; diff --git a/dlls/gdi32/brush.c b/dlls/gdi32/brush.c index 7513fca..f8c91c1 100644 --- a/dlls/gdi32/brush.c +++ b/dlls/gdi32/brush.c @@ -58,7 +58,6 @@ static const struct gdi_obj_funcs brush_funcs = /* fetch the contents of the brush bitmap and cache them in the brush pattern */ void cache_pattern_bits( PHYSDEV physdev, struct brush_pattern *pattern ) { - const struct gdi_dc_funcs *funcs; struct gdi_image_bits bits; struct bitblt_coords src; BITMAPINFO *info; @@ -76,8 +75,7 @@ void cache_pattern_bits( PHYSDEV physdev, struct brush_pattern *pattern ) src.visrect.top = src.y = 0; src.visrect.right = src.width = bmp->bitmap.bmWidth; src.visrect.bottom = src.height = bmp->bitmap.bmHeight; - funcs = get_bitmap_funcs( bmp ); - if (funcs->pGetImage( NULL, pattern->bitmap, info, &bits, &src )) + if (bmp->funcs->pGetImage( NULL, pattern->bitmap, info, &bits, &src )) { HeapFree( GetProcessHeap(), 0, info ); goto done; diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 143cc47..55ac726 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -657,7 +657,6 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, struct bitblt_coords src, dst; INT src_to_dst_offset; HRGN clip = 0; - const struct gdi_dc_funcs *funcs; if (!bitmapinfo_from_user_bitmapinfo( src_info, info, coloruse, TRUE ) || coloruse > DIB_PAL_COLORS) { @@ -715,8 +714,6 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, if (lines < src.visrect.bottom) src.visrect.bottom = lines; } - funcs = get_bitmap_funcs( bitmap ); - result = lines; offset_rect( &src.visrect, 0, src_to_dst_offset ); @@ -736,11 +733,11 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, copy_bitmapinfo( dst_info, src_info ); - err = funcs->pPutImage( NULL, hbitmap, clip, dst_info, &src_bits, &src, &dst, 0 ); + err = bitmap->funcs->pPutImage( NULL, hbitmap, clip, dst_info, &src_bits, &src, &dst, 0 ); if (err == ERROR_BAD_FORMAT) { err = convert_bits( src_info, &src, dst_info, &src_bits, FALSE ); - if (!err) err = funcs->pPutImage( NULL, hbitmap, clip, dst_info, &src_bits, &src, &dst, 0 ); + if (!err) err = bitmap->funcs->pPutImage( NULL, hbitmap, clip, dst_info, &src_bits, &src, &dst, 0 ); } if(err) result = 0; @@ -1212,7 +1209,6 @@ INT WINAPI GetDIBits( BITMAPINFO *dst_info = (BITMAPINFO *)dst_bmibuf; char src_bmibuf[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; BITMAPINFO *src_info = (BITMAPINFO *)src_bmibuf; - const struct gdi_dc_funcs *funcs; struct gdi_image_bits src_bits; struct bitblt_coords src, dst; BOOL empty_rect = FALSE; @@ -1239,8 +1235,6 @@ INT WINAPI GetDIBits( return 0; } - funcs = get_bitmap_funcs( bmp ); - src.visrect.left = 0; src.visrect.top = 0; src.visrect.right = bmp->bitmap.bmWidth; @@ -1348,7 +1342,7 @@ INT WINAPI GetDIBits( lines = src.height; } - err = funcs->pGetImage( NULL, hbitmap, src_info, bits ? &src_bits : NULL, bits ? &src : NULL ); + err = bmp->funcs->pGetImage( NULL, hbitmap, src_info, bits ? &src_bits : NULL, bits ? &src : NULL ); if (err) goto done; diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 081ecfd..b5a80ca 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -486,12 +486,6 @@ static inline void copy_bitmapinfo( BITMAPINFO *dst, const BITMAPINFO *src ) memcpy( dst, src, get_dib_info_size( src, DIB_RGB_COLORS )); } -static inline const struct gdi_dc_funcs *get_bitmap_funcs( const BITMAPOBJ *bitmap ) -{ - if( bitmap->dib ) return &dib_driver; - return bitmap->funcs; -} - extern void free_heap_bits( struct gdi_image_bits *bits ) DECLSPEC_HIDDEN; extern HMODULE gdi32_module DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : gdi32: Use the bpp info from the bitmap structure now that it' s identical to the DIB one.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: 66774baba3e67f8c6002f7954401abd7ae625444 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=66774baba3e67f8c6002f7954…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 9 19:38:54 2012 +0100 gdi32: Use the bpp info from the bitmap structure now that it's identical to the DIB one. --- dlls/gdi32/bitmap.c | 9 +++------ dlls/gdi32/dib.c | 26 +++++++++----------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index dcccd3d..ab93525 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -342,9 +342,7 @@ LONG WINAPI GetBitmapBits( if (!bmp) return 0; funcs = get_bitmap_funcs( bmp ); - if (bmp->dib) dst_stride = get_bitmap_stride( bmp->dib->dsBmih.biWidth, bmp->dib->dsBmih.biBitCount ); - else dst_stride = get_bitmap_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); - + dst_stride = get_bitmap_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); ret = max = dst_stride * bmp->bitmap.bmHeight; if (!bits) goto done; if (count > max) count = max; @@ -426,8 +424,7 @@ LONG WINAPI SetBitmapBits( count = -count; } - if (bmp->dib) src_stride = get_bitmap_stride( bmp->dib->dsBmih.biWidth, bmp->dib->dsBmih.biBitCount ); - else src_stride = get_bitmap_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); + src_stride = get_bitmap_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); count = min( count, src_stride * bmp->bitmap.bmHeight ); dst_stride = get_dib_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); @@ -481,7 +478,7 @@ LONG WINAPI SetBitmapBits( /* query the color info */ info->bmiHeader.biSize = sizeof(info->bmiHeader); info->bmiHeader.biPlanes = 1; - info->bmiHeader.biBitCount = bmp->dib ? bmp->dib->dsBmih.biBitCount : bmp->bitmap.bmBitsPixel; + info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel; info->bmiHeader.biCompression = BI_RGB; info->bmiHeader.biXPelsPerMeter = 0; info->bmiHeader.biYPelsPerMeter = 0; diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 3a8fadb..143cc47 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -975,25 +975,17 @@ static int fill_query_info( BITMAPINFO *info, BITMAPOBJ *bmp ) header.biWidth = bmp->bitmap.bmWidth; header.biHeight = bmp->bitmap.bmHeight; header.biPlanes = 1; + header.biBitCount = bmp->bitmap.bmBitsPixel; - if (bmp->dib) + switch (header.biBitCount) { - header.biBitCount = bmp->dib->dsBm.bmBitsPixel; - switch (bmp->dib->dsBm.bmBitsPixel) - { - case 16: - case 32: - header.biCompression = BI_BITFIELDS; - break; - default: - header.biCompression = BI_RGB; - break; - } - } - else - { - header.biCompression = (bmp->bitmap.bmBitsPixel > 8) ? BI_BITFIELDS : BI_RGB; - header.biBitCount = bmp->bitmap.bmBitsPixel; + case 16: + case 32: + header.biCompression = BI_BITFIELDS; + break; + default: + header.biCompression = BI_RGB; + break; } header.biSizeImage = get_dib_image_size( (BITMAPINFO *)&header );
1
0
0
0
Alexandre Julliard : gdi32: Simplify CreateDIBSection and avoid using the reference DC if not needed.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: 8946a33c4b0d85ac1c8dd5129cfb85c932d73438 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8946a33c4b0d85ac1c8dd5129…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 10 14:43:12 2012 +0100 gdi32: Simplify CreateDIBSection and avoid using the reference DC if not needed. --- dlls/gdi32/dib.c | 54 +++++++++++++++--------------------------------------- 1 files changed, 15 insertions(+), 39 deletions(-) diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 0f17972..3a8fadb 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -1486,11 +1486,8 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; BITMAPINFO *info = (BITMAPINFO *)buffer; HBITMAP ret = 0; - DC *dc; - BOOL bDesktopDC = FALSE; DIBSECTION *dib; BITMAPOBJ *bmp; - RGBQUAD *color_table = NULL; void *mapBits = NULL; if (bits) *bits = NULL; @@ -1502,7 +1499,8 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, WARN( "%u planes not properly supported\n", info->bmiHeader.biPlanes ); } - if (!(dib = HeapAlloc( GetProcessHeap(), 0, sizeof(*dib) ))) return 0; + if (!(bmp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*bmp) ))) return 0; + if (!(dib = HeapAlloc( GetProcessHeap(), 0, sizeof(*dib) ))) goto error; TRACE("format (%d,%d), planes %d, bpp %d, %s, size %d %s\n", info->bmiHeader.biWidth, info->bmiHeader.biHeight, @@ -1519,14 +1517,17 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, dib->dsBm.bmBits = NULL; dib->dsBmih = info->bmiHeader; + bmp->funcs = &dib_driver; + bmp->dib = dib; + if (info->bmiHeader.biBitCount <= 8) /* build the color table */ { if (usage == DIB_PAL_COLORS && !fill_color_table_from_pal_colors( info, hdc )) goto error; dib->dsBmih.biClrUsed = info->bmiHeader.biClrUsed; - if (!(color_table = HeapAlloc( GetProcessHeap(), 0, dib->dsBmih.biClrUsed * sizeof(RGBQUAD) ))) + if (!(bmp->color_table = HeapAlloc( GetProcessHeap(), 0, dib->dsBmih.biClrUsed*sizeof(RGBQUAD) ))) goto error; - memcpy( color_table, info->bmiColors, dib->dsBmih.biClrUsed * sizeof(RGBQUAD) ); + memcpy( bmp->color_table, info->bmiColors, dib->dsBmih.biClrUsed * sizeof(RGBQUAD) ); } /* set dsBitfields values */ @@ -1572,46 +1573,21 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, if (!dib->dsBm.bmBits) goto error; - /* If the reference hdc is null, take the desktop dc */ - if (hdc == 0) - { - hdc = CreateCompatibleDC(0); - bDesktopDC = TRUE; - } - - if (!(dc = get_dc_ptr( hdc ))) goto error; - - /* create Device Dependent Bitmap and add DIB pointer */ - ret = CreateBitmap( dib->dsBm.bmWidth, dib->dsBm.bmHeight, 1, - (info->bmiHeader.biBitCount == 1) ? 1 : GetDeviceCaps(hdc, BITSPIXEL), NULL ); + bmp->bitmap = dib->dsBm; + bmp->bitmap.bmWidthBytes = get_bitmap_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount ); + bmp->bitmap.bmBits = NULL; - if (ret && ((bmp = GDI_GetObjPtr(ret, OBJ_BITMAP)))) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pCreateDIBSection ); - bmp->dib = dib; - bmp->header.funcs = &dib_funcs; - bmp->funcs = physdev->funcs; - bmp->color_table = color_table; - GDI_ReleaseObj( ret ); - - if (!physdev->funcs->pCreateDIBSection( physdev, ret, info, usage )) - { - DeleteObject( ret ); - ret = 0; - } - } + if (!(ret = alloc_gdi_handle( &bmp->header, OBJ_BITMAP, &dib_funcs ))) goto error; - release_dc_ptr( dc ); - if (bDesktopDC) DeleteDC( hdc ); - if (ret && bits) *bits = dib->dsBm.bmBits; + if (bits) *bits = dib->dsBm.bmBits; return ret; error: - if (bDesktopDC) DeleteDC( hdc ); if (section) UnmapViewOfFile( mapBits ); - else if (!offset) VirtualFree( dib->dsBm.bmBits, 0, MEM_RELEASE ); - HeapFree( GetProcessHeap(), 0, color_table ); + else VirtualFree( dib->dsBm.bmBits, 0, MEM_RELEASE ); + HeapFree( GetProcessHeap(), 0, bmp->color_table ); HeapFree( GetProcessHeap(), 0, dib ); + HeapFree( GetProcessHeap(), 0, bmp ); return 0; }
1
0
0
0
Alexandre Julliard : gdi32: Add a separate set of GDI object functions for DIBs.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: a51b2c8bd594199bf1a3de36a20845f5b604d366 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a51b2c8bd594199bf1a3de36a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 10 14:37:48 2012 +0100 gdi32: Add a separate set of GDI object functions for DIBs. --- dlls/gdi32/bitmap.c | 45 ++-------------- dlls/gdi32/dib.c | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+), 41 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index 0d637ec..dcccd3d 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -566,7 +566,7 @@ static BOOL BITMAP_SetOwnerDC( HBITMAP hbitmap, PHYSDEV physdev ) if (!(bitmap = GDI_GetObjPtr( hbitmap, OBJ_BITMAP ))) return FALSE; - if (!bitmap->dib && bitmap->funcs != physdev->funcs) + if (bitmap->funcs != physdev->funcs) { /* we can only change from the null driver to some other driver */ if (bitmap->funcs == &null_driver) @@ -634,7 +634,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc ) old_physdev = pop_dc_driver( &dc->physDev ); physdev = GET_DC_PHYSDEV( dc, pSelectBitmap ); - if (bitmap->dib || physdev->funcs == &null_driver) + if (physdev->funcs == &null_driver) { physdev = dc->dibdrv; if (physdev) push_dc_driver( &dc->physDev, physdev, physdev->funcs ); @@ -701,26 +701,6 @@ static BOOL BITMAP_DeleteObject( HGDIOBJ handle ) if (!(bmp = free_gdi_handle( handle ))) return FALSE; HeapFree( GetProcessHeap(), 0, bmp->bitmap.bmBits ); - - if (bmp->dib) - { - DIBSECTION *dib = bmp->dib; - - if (dib->dsBm.bmBits) - { - if (dib->dshSection) - { - SYSTEM_INFO SystemInfo; - GetSystemInfo( &SystemInfo ); - UnmapViewOfFile( (char *)dib->dsBm.bmBits - - (dib->dsOffset % SystemInfo.dwAllocationGranularity) ); - } - else if (!dib->dsOffset) - VirtualFree(dib->dsBm.bmBits, 0L, MEM_RELEASE ); - } - HeapFree(GetProcessHeap(), 0, dib); - HeapFree(GetProcessHeap(), 0, bmp->color_table); - } return HeapFree( GetProcessHeap(), 0, bmp ); } @@ -730,30 +710,13 @@ static BOOL BITMAP_DeleteObject( HGDIOBJ handle ) */ static INT BITMAP_GetObject( HGDIOBJ handle, INT count, LPVOID buffer ) { - INT ret; + INT ret = 0; BITMAPOBJ *bmp = GDI_GetObjPtr( handle, OBJ_BITMAP ); if (!bmp) return 0; if (!buffer) ret = sizeof(BITMAP); - else if (count < sizeof(BITMAP)) ret = 0; - else if (bmp->dib) - { - if (count >= sizeof(DIBSECTION)) - { - DIBSECTION *dib = buffer; - *dib = *bmp->dib; - dib->dsBmih.biHeight = abs( dib->dsBmih.biHeight ); - ret = sizeof(DIBSECTION); - } - else /* if (count >= sizeof(BITMAP)) */ - { - DIBSECTION *dib = bmp->dib; - memcpy( buffer, &dib->dsBm, sizeof(BITMAP) ); - ret = sizeof(BITMAP); - } - } - else + else if (count >= sizeof(BITMAP)) { memcpy( buffer, &bmp->bitmap, sizeof(BITMAP) ); ((BITMAP *) buffer)->bmBits = NULL; diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 5aab956..0f17972 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -72,6 +72,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(bitmap); +static HGDIOBJ DIB_SelectObject( HGDIOBJ handle, HDC hdc ); +static INT DIB_GetObject( HGDIOBJ handle, INT count, LPVOID buffer ); +static BOOL DIB_DeleteObject( HGDIOBJ handle ); + +static const struct gdi_obj_funcs dib_funcs = +{ + DIB_SelectObject, /* pSelectObject */ + DIB_GetObject, /* pGetObjectA */ + DIB_GetObject, /* pGetObjectW */ + NULL, /* pUnrealizeObject */ + DIB_DeleteObject /* pDeleteObject */ +}; + /*********************************************************************** * bitmap_info_size * @@ -1576,6 +1589,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, { PHYSDEV physdev = GET_DC_PHYSDEV( dc, pCreateDIBSection ); bmp->dib = dib; + bmp->header.funcs = &dib_funcs; bmp->funcs = physdev->funcs; bmp->color_table = color_table; GDI_ReleaseObj( ret ); @@ -1600,3 +1614,135 @@ error: HeapFree( GetProcessHeap(), 0, dib ); return 0; } + + +/*********************************************************************** + * DIB_SelectObject + */ +static HGDIOBJ DIB_SelectObject( HGDIOBJ handle, HDC hdc ) +{ + HGDIOBJ ret; + BITMAPOBJ *bitmap; + DC *dc; + PHYSDEV physdev = NULL, old_physdev = NULL, pathdev = NULL; + + if (!(dc = get_dc_ptr( hdc ))) return 0; + + if (GetObjectType( hdc ) != OBJ_MEMDC) + { + ret = 0; + goto done; + } + ret = dc->hBitmap; + if (handle == dc->hBitmap) goto done; /* nothing to do */ + + if (!(bitmap = GDI_GetObjPtr( handle, OBJ_BITMAP ))) + { + ret = 0; + goto done; + } + + if (bitmap->header.selcount) + { + WARN( "Bitmap already selected in another DC\n" ); + GDI_ReleaseObj( handle ); + ret = 0; + goto done; + } + + if (dc->physDev->funcs == &path_driver) pathdev = pop_dc_driver( &dc->physDev ); + + old_physdev = GET_DC_PHYSDEV( dc, pSelectBitmap ); + physdev = dc->dibdrv; + if (old_physdev != dc->dibdrv) + { + if (physdev) push_dc_driver( &dc->physDev, physdev, physdev->funcs ); + else + { + if (!dib_driver.pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL )) goto done; + dc->dibdrv = physdev = dc->physDev; + } + } + + if (!physdev->funcs->pSelectBitmap( physdev, handle )) + { + GDI_ReleaseObj( handle ); + ret = 0; + } + else + { + dc->hBitmap = handle; + GDI_inc_ref_count( handle ); + dc->dirty = 0; + dc->vis_rect.left = 0; + dc->vis_rect.top = 0; + dc->vis_rect.right = bitmap->bitmap.bmWidth; + dc->vis_rect.bottom = bitmap->bitmap.bmHeight; + GDI_ReleaseObj( handle ); + DC_InitDC( dc ); + GDI_dec_ref_count( ret ); + } + + done: + if(!ret) + { + if (old_physdev && old_physdev != dc->dibdrv) pop_dc_driver( &dc->physDev ); + } + if (pathdev) push_dc_driver( &dc->physDev, pathdev, pathdev->funcs ); + release_dc_ptr( dc ); + return ret; +} + + +/*********************************************************************** + * DIB_GetObject + */ +static INT DIB_GetObject( HGDIOBJ handle, INT count, LPVOID buffer ) +{ + INT ret = 0; + BITMAPOBJ *bmp = GDI_GetObjPtr( handle, OBJ_BITMAP ); + + if (!bmp) return 0; + + if (!buffer) ret = sizeof(BITMAP); + else if (count >= sizeof(DIBSECTION)) + { + DIBSECTION *dib = buffer; + *dib = *bmp->dib; + dib->dsBmih.biHeight = abs( dib->dsBmih.biHeight ); + ret = sizeof(DIBSECTION); + } + else if (count >= sizeof(BITMAP)) + { + BITMAP *bitmap = buffer; + *bitmap = bmp->dib->dsBm; + ret = sizeof(BITMAP); + } + + GDI_ReleaseObj( handle ); + return ret; +} + + +/*********************************************************************** + * DIB_DeleteObject + */ +static BOOL DIB_DeleteObject( HGDIOBJ handle ) +{ + BITMAPOBJ *bmp; + + if (!(bmp = free_gdi_handle( handle ))) return FALSE; + + if (bmp->dib->dshSection) + { + SYSTEM_INFO SystemInfo; + GetSystemInfo( &SystemInfo ); + UnmapViewOfFile( (char *)bmp->dib->dsBm.bmBits - + (bmp->dib->dsOffset % SystemInfo.dwAllocationGranularity) ); + } + else VirtualFree( bmp->dib->dsBm.bmBits, 0, MEM_RELEASE ); + + HeapFree(GetProcessHeap(), 0, bmp->dib); + HeapFree(GetProcessHeap(), 0, bmp->color_table); + return HeapFree( GetProcessHeap(), 0, bmp ); +}
1
0
0
0
Alexandre Julliard : winex11: Remove the remainining DIB section locking calls.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: 40bf321e5ae9569b4722780db488b5edfdd53c40 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=40bf321e5ae9569b4722780db…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 9 14:37:50 2012 +0100 winex11: Remove the remainining DIB section locking calls. --- dlls/winex11.drv/bitblt.c | 3 --- dlls/winex11.drv/brush.c | 4 ---- dlls/winex11.drv/xrender.c | 6 ------ 3 files changed, 0 insertions(+), 13 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 8d20277..a54ca49 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1241,9 +1241,6 @@ DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info int height = dst->visrect.bottom - dst->visrect.top; image->data = dst_bits.ptr; - /* hack: make sure the bits are readable if we are reading from a DIB section */ - /* to be removed once we get rid of DIB access protections */ - if (!dst_bits.is_copy) IsBadReadPtr( dst_bits.ptr, height * image->bytes_per_line ); if (bitmap) { diff --git a/dlls/winex11.drv/brush.c b/dlls/winex11.drv/brush.c index 8de8c01..afc1e0b 100644 --- a/dlls/winex11.drv/brush.c +++ b/dlls/winex11.drv/brush.c @@ -215,8 +215,6 @@ static void BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, GetObjectW( hbitmap, sizeof(bitmap), &bitmap ); - X11DRV_DIB_Lock( physBitmap, DIB_Status_GdiMod ); - wine_tsx11_lock(); if (physDev->brush.pixmap) XFreePixmap( gdi_display, physDev->brush.pixmap ); @@ -239,8 +237,6 @@ static void BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, } wine_tsx11_unlock(); - X11DRV_DIB_Unlock( physBitmap, TRUE ); - if (physBitmap->depth > 1) { physDev->brush.fillStyle = FillTiled; diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index cbe9185..dc3d55b 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -1997,9 +1997,6 @@ static DWORD create_image_pixmap( BITMAPINFO *info, const struct gdi_image_bits if (ret) return ret; image->data = dst_bits.ptr; - /* hack: make sure the bits are readable if we are reading from a DIB section */ - /* to be removed once we get rid of DIB access protections */ - if (!dst_bits.is_copy) IsBadReadPtr( dst_bits.ptr, image->height * image->bytes_per_line ); *use_repeat = (width == 1 && height == 1); pa.repeat = *use_repeat ? RepeatNormal : RepeatNone; @@ -2641,8 +2638,6 @@ static HBRUSH xrenderdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct b GetObjectW( bitmap, sizeof(bm), &bm ); - X11DRV_DIB_Lock( physbitmap, DIB_Status_GdiMod ); - wine_tsx11_lock(); pixmap = XCreatePixmap( gdi_display, root_window, bm.bmWidth, bm.bmHeight, physdev->pict_format->depth ); @@ -2662,7 +2657,6 @@ static HBRUSH xrenderdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct b physdev->x11dev->brush.style = BS_PATTERN; wine_tsx11_unlock(); - X11DRV_DIB_Unlock( physbitmap, TRUE ); if (delete_bitmap) DeleteObject( bitmap ); return hbrush;
1
0
0
0
Alexandre Julliard : winex11: Fix support for PALETTEINDEX mapping and get rid of DIBINDEX support.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: c123c2f87af55f6b432e7be8560d65baee603520 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c123c2f87af55f6b432e7be85…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 10 11:56:06 2012 +0100 winex11: Fix support for PALETTEINDEX mapping and get rid of DIBINDEX support. --- dlls/winex11.drv/palette.c | 166 ++++++++++++++++---------------------------- 1 files changed, 61 insertions(+), 105 deletions(-) diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c index e6a2652..ec0f42c 100644 --- a/dlls/winex11.drv/palette.c +++ b/dlls/winex11.drv/palette.c @@ -882,39 +882,26 @@ static inline BOOL colour_is_brighter(RGBQUAD c1, RGBQUAD c2) COLORREF X11DRV_PALETTE_GetColor( X11DRV_PDEVICE *physDev, COLORREF color ) { HPALETTE hPal = GetCurrentObject(physDev->dev.hdc, OBJ_PAL ); - unsigned char spec_type = color >> 24; - unsigned idx = color & 0xffff; PALETTEENTRY entry; - RGBQUAD quad; - switch(spec_type) + if (color & (1 << 24)) /* PALETTEINDEX */ { - case 2: /* PALETTERGB */ - idx = GetNearestPaletteIndex( hPal, color ); - /* fall through to PALETTEINDEX */ - - case 1: /* PALETTEINDEX */ - if (!GetPaletteEntries( hPal, idx, 1, &entry )) - { - WARN("PALETTEINDEX(%x) : idx %d is out of bounds, assuming black\n", color, idx); - return 0; - } + unsigned int idx = LOWORD(color); + if (!GetPaletteEntries( hPal, idx, 1, &entry )) return 0; return RGB( entry.peRed, entry.peGreen, entry.peBlue ); + } - case 0x10: /* DIBINDEX */ - if( GetDIBColorTable( physDev->dev.hdc, idx, 1, &quad ) != 1 ) { - WARN("DIBINDEX(%x) : idx %d is out of bounds, assuming black\n", color , idx); - return 0; - } - return RGB( quad.rgbRed, quad.rgbGreen, quad.rgbBlue ); + if (color >> 24 == 2) /* PALETTERGB */ + { + unsigned int idx = GetNearestPaletteIndex( hPal, color & 0xffffff ); + if (!GetPaletteEntries( hPal, idx, 1, &entry )) return 0; + return RGB( entry.peRed, entry.peGreen, entry.peBlue ); + } - default: - color &= 0xffffff; - /* fall through to RGB */ + if (color >> 16 == 0x10ff) /* DIBINDEX */ + return 0; - case 0: /* RGB */ - return color; - } + return color & 0xffffff; } /*********************************************************************** @@ -926,7 +913,6 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) { WORD index = 0; HPALETTE hPal = GetCurrentObject(physDev->dev.hdc, OBJ_PAL ); - unsigned char spec_type = color >> 24; int *mapping = palette_get_mapping( hPal ); PALETTEENTRY entry; ColorShifts *shifts = &X11DRV_PALETTE_default_shifts; @@ -939,47 +925,35 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) /* there is no colormap limitation; we are going to have to compute * the pixel value from the visual information stored earlier */ + unsigned long red, green, blue; - unsigned long red, green, blue; - unsigned idx = color & 0xffff; - - switch(spec_type) + if (color & (1 << 24)) /* PALETTEINDEX */ { - case 0x10: /* DIBINDEX */ - color = X11DRV_PALETTE_GetColor( physDev, color ); - break; - - case 1: /* PALETTEINDEX */ + unsigned int idx = LOWORD( color ); + if (!GetPaletteEntries( hPal, idx, 1, &entry )) { WARN("PALETTEINDEX(%x) : idx %d is out of bounds, assuming black\n", color, idx); return 0; } if (mapping) return mapping[idx]; - color = RGB( entry.peRed, entry.peGreen, entry.peBlue ); - break; - - default: - color &= 0xffffff; - /* fall through to RGB */ - - case 0: /* RGB */ - if (physDev->depth == 1) - { - int white = 1; - RGBQUAD table[2]; - - if (GetDIBColorTable( physDev->dev.hdc, 0, 2, table ) == 2) - { - if(!colour_is_brighter(table[1], table[0])) white = 0; - } - return (((color >> 16) & 0xff) + - ((color >> 8) & 0xff) + (color & 0xff) > 255*3/2) ? white : 1 - white; - } - - } - - red = GetRValue(color); green = GetGValue(color); blue = GetBValue(color); + red = entry.peRed; + green = entry.peGreen; + blue = entry.peBlue; + } + else if (color >> 16 == 0x10ff) /* DIBINDEX */ + { + return 0; + } + else /* RGB */ + { + if (physDev->depth == 1) + return (((color >> 16) & 0xff) + + ((color >> 8) & 0xff) + (color & 0xff) > 255*3/2) ? 1 : 0; + red = GetRValue( color ); + green = GetGValue( color ); + blue = GetBValue( color ); + } if (X11DRV_PALETTE_Graymax) { @@ -1013,51 +987,33 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) if (!mapping) WARN("Palette %p is not realized\n", hPal); - switch(spec_type) /* we have to peruse DC and system palette */ - { - default: - color &= 0xffffff; - /* fall through to RGB */ - - case 0: /* RGB */ - if (physDev->depth == 1) - { - int white = 1; - RGBQUAD table[2]; - - if (GetDIBColorTable( physDev->dev.hdc, 0, 2, table ) == 2) - { - if(!colour_is_brighter(table[1], table[0])) - white = 0; - } - return (((color >> 16) & 0xff) + - ((color >> 8) & 0xff) + (color & 0xff) > 255*3/2) ? white : 1 - white; - } - - EnterCriticalSection( &palette_cs ); - index = X11DRV_SysPaletteLookupPixel( color, FALSE); - if (X11DRV_PALETTE_PaletteToXPixel) index = X11DRV_PALETTE_PaletteToXPixel[index]; - LeaveCriticalSection( &palette_cs ); - - /* TRACE(palette,"RGB(%lx) -> pixel %i\n", color, index); - */ - break; - case 1: /* PALETTEINDEX */ - index = color & 0xffff; - if (!GetPaletteEntries( hPal, index, 1, &entry )) - WARN("PALETTEINDEX(%x) : index %i is out of bounds\n", color, index); - else if (mapping) index = mapping[index]; - - /* TRACE(palette,"PALETTEINDEX(%04x) -> pixel %i\n", (WORD)color, index); - */ - break; - case 2: /* PALETTERGB */ - index = GetNearestPaletteIndex( hPal, color ); - if (mapping) index = mapping[index]; - /* TRACE(palette,"PALETTERGB(%lx) -> pixel %i\n", color, index); - */ - break; - } + if (color & (1 << 24)) /* PALETTEINDEX */ + { + index = LOWORD( color ); + if (!GetPaletteEntries( hPal, index, 1, &entry )) + WARN("PALETTEINDEX(%x) : index %i is out of bounds\n", color, index); + else if (mapping) index = mapping[index]; + } + else if (color >> 24 == 2) /* PALETTERGB */ + { + index = GetNearestPaletteIndex( hPal, color ); + if (mapping) index = mapping[index]; + } + else if (color >> 16 == 0x10ff) /* DIBINDEX */ + { + return 0; + } + else /* RGB */ + { + if (physDev->depth == 1) + return (((color >> 16) & 0xff) + + ((color >> 8) & 0xff) + (color & 0xff) > 255*3/2) ? 1 : 0; + + EnterCriticalSection( &palette_cs ); + index = X11DRV_SysPaletteLookupPixel( color & 0xffffff, FALSE); + if (X11DRV_PALETTE_PaletteToXPixel) index = X11DRV_PALETTE_PaletteToXPixel[index]; + LeaveCriticalSection( &palette_cs ); + } } return index; }
1
0
0
0
Alexandre Julliard : opengl32: Get rid of the DIB section sync support.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: b88b6b74f0a45c4ee1bb89dfdcc8e951e6a1d8e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b88b6b74f0a45c4ee1bb89dfd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 9 14:34:41 2012 +0100 opengl32: Get rid of the DIB section sync support. --- dlls/opengl32/opengl_ext.h | 3 +-- dlls/opengl32/wgl.c | 36 ------------------------------------ dlls/winex11.drv/init.c | 8 +------- dlls/winex11.drv/opengl.c | 7 +------ 4 files changed, 3 insertions(+), 51 deletions(-) diff --git a/dlls/opengl32/opengl_ext.h b/dlls/opengl32/opengl_ext.h index 988317f..c768560 100644 --- a/dlls/opengl32/opengl_ext.h +++ b/dlls/opengl32/opengl_ext.h @@ -42,8 +42,7 @@ extern void (*wine_tsx11_lock_ptr)(void); extern void (*wine_tsx11_unlock_ptr)(void); /* As GLX relies on X, this is needed */ -void enter_gl(void); -#define ENTER_GL() enter_gl() +#define ENTER_GL() wine_tsx11_lock_ptr() #define LEAVE_GL() wine_tsx11_unlock_ptr() diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index cdd6686..98b04d4 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -81,22 +81,6 @@ MAKE_FUNCPTR(gluTessVertex) #undef MAKE_FUNCPTR #endif /* SONAME_LIBGLU */ -/* x11drv GDI escapes */ -#define X11DRV_ESCAPE 6789 -enum x11drv_escape_codes -{ - X11DRV_GET_DISPLAY, /* get X11 display for a DC */ - X11DRV_GET_DRAWABLE, /* get current drawable for a DC */ - X11DRV_GET_FONT, /* get current X font for a DC */ - X11DRV_SET_DRAWABLE, /* set current drawable for a DC */ - X11DRV_START_EXPOSURES, /* start graphics exposures */ - X11DRV_END_EXPOSURES, /* end graphics exposures */ - X11DRV_GET_DCE, /* get the DCE pointer */ - X11DRV_SET_DCE, /* set the DCE pointer */ - X11DRV_GET_GLX_DRAWABLE, /* get current glx drawable for a DC */ - X11DRV_SYNC_PIXMAP /* sync the dibsection to its pixmap */ -}; - void (*wine_tsx11_lock_ptr)(void) = NULL; void (*wine_tsx11_unlock_ptr)(void) = NULL; @@ -106,26 +90,6 @@ static void* libglu_handle = NULL; static char* internal_gl_disabled_extensions = NULL; static char* internal_gl_extensions = NULL; -typedef struct wine_glcontext { - HDC hdc; - BOOL do_escape; - /* ... more stuff here */ -} Wine_GLContext; - -void enter_gl(void) -{ - Wine_GLContext *curctx = NtCurrentTeb()->glContext; - - if (curctx && curctx->do_escape) - { - enum x11drv_escape_codes escape = X11DRV_SYNC_PIXMAP; - ExtEscape(curctx->hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape, 0, NULL); - } - - wine_tsx11_lock_ptr(); - return; -} - const GLubyte * WINAPI wine_glGetString( GLenum name ); /*********************************************************************** diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 15ab4c2..15f110b 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -429,6 +429,7 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d break; case X11DRV_GET_DCE: case X11DRV_SET_DCE: + case X11DRV_SYNC_PIXMAP: FIXME( "%x escape no longer supported\n", *(const enum x11drv_escape_codes *)in_data ); break; case X11DRV_GET_GLX_DRAWABLE: @@ -438,13 +439,6 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d return TRUE; } break; - case X11DRV_SYNC_PIXMAP: - if(physDev->bitmap) - { - X11DRV_CoerceDIBSection(physDev, DIB_Status_GdiMod); - return TRUE; - } - return FALSE; case X11DRV_FLUSH_GL_DRAWABLE: flush_gl_drawable(physDev); return TRUE; diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 0d4d822..e8d0f89 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -111,7 +111,6 @@ typedef struct wine_glpixelformat { typedef struct wine_glcontext { HDC hdc; - BOOL do_escape; BOOL has_been_current; BOOL sharing; DWORD tid; @@ -1950,11 +1949,7 @@ BOOL X11DRV_wglMakeCurrent(PHYSDEV dev, HGLRC hglrc) ctx->drawables[1] = drawable; ctx->refresh_drawables = FALSE; - if (type == OBJ_MEMDC) - { - ctx->do_escape = TRUE; - pglDrawBuffer(GL_FRONT_LEFT); - } + if (type == OBJ_MEMDC) pglDrawBuffer(GL_FRONT_LEFT); } else SetLastError(ERROR_INVALID_HANDLE);
1
0
0
0
Kusanagi Kouichi : gdi32: GetGlyphIndices doesn't substitute glyph.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: fecb1d8b6f81c2bfff7116e80380b1d4f7b7befc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fecb1d8b6f81c2bfff7116e80…
Author: Kusanagi Kouichi <slash(a)ac.auone-net.jp> Date: Tue Jan 10 19:08:03 2012 +0900 gdi32: GetGlyphIndices doesn't substitute glyph. --- dlls/gdi32/freetype.c | 8 ++++++-- dlls/gdi32/tests/font.c | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index b907209..537d81a 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -4988,7 +4988,7 @@ static FT_UInt get_glyph_index(const GdiFont *font, UINT glyph) else ret = pFT_Get_Char_Index(font->ft_face, (unsigned char)buf); TRACE("%04x (%02x) -> ret %d def_used %d\n", glyph, buf, ret, default_used); - return get_GSUB_vert_glyph(font,ret); + return ret; } if(font->ft_face->charmap->encoding == FT_ENCODING_MS_SYMBOL) @@ -5001,7 +5001,7 @@ static FT_UInt get_glyph_index(const GdiFont *font, UINT glyph) } else glyphId = pFT_Get_Char_Index(font->ft_face, glyph); - return get_GSUB_vert_glyph(font,glyphId); + return glyphId; } /************************************************************* @@ -6373,7 +6373,10 @@ static BOOL get_glyph_index_linked(GdiFont *font, UINT c, GdiFont **linked_font, *linked_font = font; if((*glyph = get_glyph_index(font, c))) + { + *glyph = get_GSUB_vert_glyph(font, *glyph); return TRUE; + } LIST_FOR_EACH_ENTRY(child_font, &font->child_fonts, CHILD_FONT, entry) { @@ -6384,6 +6387,7 @@ static BOOL get_glyph_index_linked(GdiFont *font, UINT c, GdiFont **linked_font, if(!child_font->font->ft_face) continue; g = get_glyph_index(child_font->font, c); + g = get_GSUB_vert_glyph(child_font->font, g); if(g) { *glyph = g; diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 41ceff4..8d30cdb 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -4070,13 +4070,14 @@ todo_wine DeleteFile(ttf_name); } -static void check_vertical_font(const char *name, BOOL *installed, BOOL *selected, GLYPHMETRICS *gm) +static void check_vertical_font(const char *name, BOOL *installed, BOOL *selected, GLYPHMETRICS *gm, WORD *gi) { LOGFONTA lf; HFONT hfont, hfont_prev; HDC hdc; char facename[100]; DWORD ret; + static const WCHAR str[] = { 0x2025 }; *installed = is_truetype_font_installed(name); @@ -4112,6 +4113,9 @@ static void check_vertical_font(const char *name, BOOL *installed, BOOL *selecte if (!*selected) memset(gm, 0, sizeof *gm); + ret = pGetGlyphIndicesW(hdc, str, 1, gi, 0); + ok(ret != GDI_ERROR, "GetGlyphIndicesW failed\n"); + SelectObject(hdc, hfont_prev); DeleteObject(hfont); ReleaseDC(NULL, hdc); @@ -4123,10 +4127,11 @@ static void test_vertical_font(void) int num; BOOL ret, installed, selected; GLYPHMETRICS gm; + WORD hgi, vgi; - if (!pAddFontResourceExA || !pRemoveFontResourceExA) + if (!pAddFontResourceExA || !pRemoveFontResourceExA || !pGetGlyphIndicesW) { - win_skip("AddFontResourceExA is not available on this platform\n"); + win_skip("AddFontResourceExA or GetGlyphIndicesW is not available on this platform\n"); return; } @@ -4139,20 +4144,22 @@ static void test_vertical_font(void) num = pAddFontResourceExA(ttf_name, FR_PRIVATE, 0); ok(num == 2, "AddFontResourceExA should add 2 fonts from vertical.ttf\n"); - check_vertical_font("@WineTestVertical", &installed, &selected, &gm); + check_vertical_font("@WineTestVertical", &installed, &selected, &gm, &hgi); ok(installed, "@WineTestVertical is not installed\n"); ok(selected, "@WineTestVertical is not selected\n"); ok(gm.gmBlackBoxX > gm.gmBlackBoxY, "gmBlackBoxX(%u) should be greater than gmBlackBoxY(%u) if horizontal\n", gm.gmBlackBoxX, gm.gmBlackBoxY); - check_vertical_font("@@WineTestVertical", &installed, &selected, &gm); + check_vertical_font("@@WineTestVertical", &installed, &selected, &gm, &vgi); ok(installed, "@@WineTestVertical is not installed\n"); ok(selected, "@@WineTestVertical is not selected\n"); ok(gm.gmBlackBoxX < gm.gmBlackBoxY, "gmBlackBoxX(%u) should be less than gmBlackBoxY(%u) if vertical\n", gm.gmBlackBoxX, gm.gmBlackBoxY); + ok(hgi == vgi, "different glyph h:%u v:%u\n", hgi, vgi); + ret = pRemoveFontResourceExA(ttf_name, FR_PRIVATE, 0); ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError());
1
0
0
0
Hwang YunSong : po: Updated Korean translation.
by Alexandre Julliard
10 Jan '12
10 Jan '12
Module: wine Branch: master Commit: 2dda47fe6fbccc25264fbaa14b5fc2d75efe84ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2dda47fe6fbccc25264fbaa14…
Author: Hwang YunSong <hys545(a)dreamwiz.com> Date: Mon Jan 9 21:58:07 2012 +0900 po: Updated Korean translation. --- po/ko.po | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/po/ko.po b/po/ko.po index 173148d..516e3f2 100644 --- a/po/ko.po +++ b/po/ko.po @@ -8361,9 +8361,8 @@ msgid "The specified device handle is invalid." msgstr "지정된 장치 핸들은 적합하지 않습니다." #: winmm.rc:34 -#, fuzzy msgid "There is no driver installed on your system!" -msgstr "당신의 시스템에는 어떤 드라이버도 설치되어 있지 않습니다 !\n" +msgstr "당신의 시스템에는 어떤 드라이버도 설치되어 있지 않습니다 !" #: winmm.rc:35 winmm.rc:61 msgid "" @@ -12961,7 +12960,7 @@ msgstr "다시 부르는 명령의 갯수(&N):" #: wineconsole.rc:76 msgid "&Remove doubles" -msgstr "두번 제거(&R)" +msgstr "두번 제거(&R)" #: wineconsole.rc:84 msgid "&Font" @@ -12972,9 +12971,8 @@ msgid "&Color" msgstr "색상(&C)" #: wineconsole.rc:97 -#, fuzzy msgid "Configuration" -msgstr " 설정 " +msgstr "설정 " #: wineconsole.rc:100 msgid "Buffer zone"
1
0
0
0
← Newer
1
...
70
71
72
73
74
75
76
...
98
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Results per page:
10
25
50
100
200