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
July 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
838 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11: Add support for rops in PutImage.
by Alexandre Julliard
14 Jul '11
14 Jul '11
Module: wine Branch: master Commit: 611b168b358310e7faac53b90161c021fd7f0bb2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=611b168b358310e7faac53b90…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 14 13:09:04 2011 +0200 winex11: Add support for rops in PutImage. --- dlls/winex11.drv/bitblt.c | 45 ++++++++++++++++++++++++++++++++++++++------- 1 files changed, 38 insertions(+), 7 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index e9004ce..d76ceba 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1747,6 +1747,8 @@ DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, const str struct gdi_image_bits dst_bits; const XPixmapFormatValues *format; const ColorShifts *color_shifts; + int width = rect->right - rect->left; + int height = rect->bottom - rect->top; if (hbitmap) { @@ -1767,6 +1769,7 @@ DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, const str if (info->bmiHeader.biPlanes != 1) goto update_format; if (info->bmiHeader.biBitCount != format->bits_per_pixel) goto update_format; if (info->bmiHeader.biHeight > 0) goto update_format; /* bottom-up not supported */ + /* FIXME: could try to handle 1-bpp using XCopyPlane */ if (info->bmiHeader.biCompression == BI_BITFIELDS) { @@ -1814,18 +1817,46 @@ DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, const str { wine_tsx11_lock(); XPutImage( gdi_display, bitmap->pixmap, get_bitmap_gc(depth), image, dst_bits.offset, 0, - rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top ); + rect->left, rect->top, width, height ); wine_tsx11_unlock(); } else { - /* FIXME: copy rop handling from BitBlt here */ + const BYTE *opcode = BITBLT_Opcodes[(rop >> 16) & 0xff]; + X11DRV_LockDIBSection( physdev, DIB_Status_GdiMod ); - wine_tsx11_lock(); - XPutImage( gdi_display, physdev->drawable, physdev->gc, image, dst_bits.offset, 0, - physdev->dc_rect.left + rect->left, physdev->dc_rect.top + rect->top, - rect->right - rect->left, rect->bottom - rect->top ); - wine_tsx11_unlock(); + + /* optimization for single-op ROPs */ + if (!opcode[1] && OP_SRCDST(opcode[0]) == OP_ARGS(SRC,DST)) + { + wine_tsx11_lock(); + XSetFunction( gdi_display, physdev->gc, OP_ROP(*opcode) ); + XPutImage( gdi_display, physdev->drawable, physdev->gc, image, dst_bits.offset, 0, + physdev->dc_rect.left + rect->left, physdev->dc_rect.top + rect->top, + width, height ); + wine_tsx11_unlock(); + } + else + { + Pixmap src_pixmap; + GC gc; + + wine_tsx11_lock(); + gc = XCreateGC( gdi_display, physdev->drawable, 0, NULL ); + XSetSubwindowMode( gdi_display, gc, IncludeInferiors ); + XSetGraphicsExposures( gdi_display, gc, False ); + src_pixmap = XCreatePixmap( gdi_display, root_window, width, height, depth ); + XPutImage( gdi_display, src_pixmap, gc, image, dst_bits.offset, 0, 0, 0, width, height ); + wine_tsx11_unlock(); + + execute_rop( physdev, src_pixmap, gc, rect, rop ); + + wine_tsx11_lock(); + XFreePixmap( gdi_display, src_pixmap ); + XFreeGC( gdi_display, gc ); + wine_tsx11_unlock(); + } + X11DRV_UnlockDIBSection( physdev, !ret ); } image->data = NULL;
1
0
0
0
Alexandre Julliard : winex11: Move the execution of rop operations from X11DRV_StretchBlt to a separate function .
by Alexandre Julliard
14 Jul '11
14 Jul '11
Module: wine Branch: master Commit: c02bbb78b8c9b83191cf230942501736fbf50524 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c02bbb78b8c9b83191cf23094…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 14 13:08:56 2011 +0200 winex11: Move the execution of rop operations from X11DRV_StretchBlt to a separate function. --- dlls/winex11.drv/bitblt.c | 127 +++++++++++++++++++++++++-------------------- 1 files changed, 70 insertions(+), 57 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 21a664c..e9004ce 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1105,7 +1105,7 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe * Retrieve an area from the destination DC, mapping all the * pixels to Windows colors. */ -static int BITBLT_GetDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, GC gc, RECT *visRectDst) +static int BITBLT_GetDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, GC gc, const RECT *visRectDst) { int exposures = 0; INT width = visRectDst->right - visRectDst->left; @@ -1165,7 +1165,7 @@ static int BITBLT_GetDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, GC gc, RECT * Put an area back into the destination DC, mapping the pixel * colors to X pixels. */ -static int BITBLT_PutDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, RECT *visRectDst) +static int BITBLT_PutDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, const RECT *visRectDst) { int exposures = 0; INT width = visRectDst->right - visRectDst->left; @@ -1331,6 +1331,65 @@ static BOOL same_format(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst) return FALSE; } +static void execute_rop( X11DRV_PDEVICE *physdev, Pixmap src_pixmap, GC gc, + const RECT *visrect, DWORD rop ) +{ + Pixmap pixmaps[3]; + Pixmap result = src_pixmap; + BOOL null_brush; + const BYTE *opcode = BITBLT_Opcodes[(rop >> 16) & 0xff]; + BOOL use_pat = (((rop >> 4) & 0x0f0000) != (rop & 0x0f0000)); + BOOL use_dst = (((rop >> 1) & 0x550000) != (rop & 0x550000)); + int width = visrect->right - visrect->left; + int height = visrect->bottom - visrect->top; + + pixmaps[SRC] = src_pixmap; + pixmaps[TMP] = 0; + wine_tsx11_lock(); + pixmaps[DST] = XCreatePixmap( gdi_display, root_window, width, height, physdev->depth ); + wine_tsx11_unlock(); + + if (use_dst) BITBLT_GetDstArea( physdev, pixmaps[DST], gc, visrect ); + null_brush = use_pat && !X11DRV_SetupGCForPatBlt( physdev, gc, TRUE ); + + wine_tsx11_lock(); + for ( ; *opcode; opcode++) + { + if (OP_DST(*opcode) == DST) result = pixmaps[DST]; + XSetFunction( gdi_display, gc, OP_ROP(*opcode) ); + switch(OP_SRCDST(*opcode)) + { + case OP_ARGS(DST,TMP): + case OP_ARGS(SRC,TMP): + if (!pixmaps[TMP]) + pixmaps[TMP] = XCreatePixmap( gdi_display, root_window, width, height, physdev->depth ); + /* fall through */ + case OP_ARGS(DST,SRC): + case OP_ARGS(SRC,DST): + case OP_ARGS(TMP,SRC): + case OP_ARGS(TMP,DST): + XCopyArea( gdi_display, pixmaps[OP_SRC(*opcode)], pixmaps[OP_DST(*opcode)], gc, + 0, 0, width, height, 0, 0 ); + break; + + case OP_ARGS(PAT,TMP): + if (!pixmaps[TMP] && !null_brush) + pixmaps[TMP] = XCreatePixmap( gdi_display, root_window, width, height, physdev->depth ); + /* fall through */ + case OP_ARGS(PAT,DST): + case OP_ARGS(PAT,SRC): + if (!null_brush) + XFillRectangle( gdi_display, pixmaps[OP_DST(*opcode)], gc, 0, 0, width, height ); + break; + } + } + XSetFunction( gdi_display, physdev->gc, GXcopy ); + physdev->exposures += BITBLT_PutDstArea( physdev, result, visrect ); + XFreePixmap( gdi_display, pixmaps[DST] ); + if (pixmaps[TMP]) XFreePixmap( gdi_display, pixmaps[TMP] ); + wine_tsx11_unlock(); +} + /*********************************************************************** * X11DRV_PatBlt */ @@ -1397,17 +1456,15 @@ BOOL X11DRV_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, { X11DRV_PDEVICE *physDevDst = get_x11drv_dev( dst_dev ); X11DRV_PDEVICE *physDevSrc = get_x11drv_dev( src_dev ); /* FIXME: check that it's really an x11 dev */ - BOOL usePat, useDst, destUsed, fStretch, fNullBrush; + BOOL fStretch; INT width, height; INT sDst, sSrc = DIB_Status_None; const BYTE *opcode; - Pixmap pixmaps[3] = { 0, 0, 0 }; /* pixmaps for DST, SRC, TMP */ - GC tmpGC = 0; + Pixmap src_pixmap; + GC tmpGC; if (IsRectEmpty( &dst->visrect )) return TRUE; - usePat = (((rop >> 4) & 0x0f0000) != (rop & 0x0f0000)); - useDst = (((rop >> 1) & 0x550000) != (rop & 0x550000)); fStretch = (src->width != dst->width) || (src->height != dst->height); if (physDevDst != physDevSrc) @@ -1491,67 +1548,23 @@ BOOL X11DRV_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, tmpGC = XCreateGC( gdi_display, physDevDst->drawable, 0, NULL ); XSetSubwindowMode( gdi_display, tmpGC, IncludeInferiors ); XSetGraphicsExposures( gdi_display, tmpGC, False ); - pixmaps[DST] = XCreatePixmap( gdi_display, root_window, width, height, - physDevDst->depth ); - pixmaps[SRC] = XCreatePixmap( gdi_display, root_window, width, height, - physDevDst->depth ); + src_pixmap = XCreatePixmap( gdi_display, root_window, width, height, physDevDst->depth ); wine_tsx11_unlock(); if (physDevDst != physDevSrc) X11DRV_CoerceDIBSection( physDevSrc, DIB_Status_GdiMod ); - if(!X11DRV_XRender_GetSrcAreaStretch( physDevSrc, physDevDst, pixmaps[SRC], tmpGC, src, dst )) + if(!X11DRV_XRender_GetSrcAreaStretch( physDevSrc, physDevDst, src_pixmap, tmpGC, src, dst )) { if (fStretch) - BITBLT_GetSrcAreaStretch( physDevSrc, physDevDst, pixmaps[SRC], tmpGC, src, dst ); + BITBLT_GetSrcAreaStretch( physDevSrc, physDevDst, src_pixmap, tmpGC, src, dst ); else - BITBLT_GetSrcArea( physDevSrc, physDevDst, pixmaps[SRC], tmpGC, &src->visrect ); + BITBLT_GetSrcArea( physDevSrc, physDevDst, src_pixmap, tmpGC, &src->visrect ); } - if (useDst) BITBLT_GetDstArea( physDevDst, pixmaps[DST], tmpGC, &dst->visrect ); - if (usePat) fNullBrush = !X11DRV_SetupGCForPatBlt( physDevDst, tmpGC, TRUE ); - else fNullBrush = FALSE; - destUsed = FALSE; + execute_rop( physDevDst, src_pixmap, tmpGC, &dst->visrect, rop ); wine_tsx11_lock(); - for ( ; *opcode; opcode++) - { - if (OP_DST(*opcode) == DST) destUsed = TRUE; - XSetFunction( gdi_display, tmpGC, OP_ROP(*opcode) ); - switch(OP_SRCDST(*opcode)) - { - case OP_ARGS(DST,TMP): - case OP_ARGS(SRC,TMP): - if (!pixmaps[TMP]) - pixmaps[TMP] = XCreatePixmap( gdi_display, root_window, - width, height, physDevDst->depth ); - /* fall through */ - case OP_ARGS(DST,SRC): - case OP_ARGS(SRC,DST): - case OP_ARGS(TMP,SRC): - case OP_ARGS(TMP,DST): - XCopyArea( gdi_display, pixmaps[OP_SRC(*opcode)], - pixmaps[OP_DST(*opcode)], tmpGC, - 0, 0, width, height, 0, 0 ); - break; - - case OP_ARGS(PAT,TMP): - if (!pixmaps[TMP] && !fNullBrush) - pixmaps[TMP] = XCreatePixmap( gdi_display, root_window, - width, height, physDevDst->depth ); - /* fall through */ - case OP_ARGS(PAT,DST): - case OP_ARGS(PAT,SRC): - if (!fNullBrush) - XFillRectangle( gdi_display, pixmaps[OP_DST(*opcode)], - tmpGC, 0, 0, width, height ); - break; - } - } - XSetFunction( gdi_display, physDevDst->gc, GXcopy ); - physDevDst->exposures += BITBLT_PutDstArea( physDevDst, pixmaps[destUsed ? DST : SRC], &dst->visrect ); - XFreePixmap( gdi_display, pixmaps[DST] ); - if (pixmaps[SRC]) XFreePixmap( gdi_display, pixmaps[SRC] ); - if (pixmaps[TMP]) XFreePixmap( gdi_display, pixmaps[TMP] ); + XFreePixmap( gdi_display, src_pixmap ); XFreeGC( gdi_display, tmpGC ); wine_tsx11_unlock();
1
0
0
0
Alexandre Julliard : winex11: Add an implementation for the PutImage entry point.
by Alexandre Julliard
14 Jul '11
14 Jul '11
Module: wine Branch: master Commit: ce9a5c6659df7cff8515c8a153b6ff47ead4d06d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ce9a5c6659df7cff8515c8a15…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 14 12:59:48 2011 +0200 winex11: Add an implementation for the PutImage entry point. --- dlls/winex11.drv/bitblt.c | 112 +++++++++++++++++++++++++++++++++++++++++++++ dlls/winex11.drv/init.c | 2 +- dlls/winex11.drv/x11drv.h | 2 + 3 files changed, 115 insertions(+), 1 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 3e2ef2c..21a664c 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1721,6 +1721,118 @@ static DWORD copy_image_bits( BITMAPINFO *info, const ColorShifts *color_shifts, } /*********************************************************************** + * X11DRV_PutImage + */ +DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, const struct gdi_image_bits *bits, + const RECT *rect, DWORD rop ) +{ + X11DRV_PDEVICE *physdev; + X_PHYSBITMAP *bitmap; + DWORD ret = ERROR_SUCCESS; + XImage *image; + int depth; + struct gdi_image_bits dst_bits; + const XPixmapFormatValues *format; + const ColorShifts *color_shifts; + + if (hbitmap) + { + if (!(bitmap = X11DRV_get_phys_bitmap( hbitmap ))) return ERROR_INVALID_HANDLE; + physdev = NULL; + depth = bitmap->pixmap_depth; + color_shifts = &bitmap->pixmap_color_shifts; + } + else + { + physdev = get_x11drv_dev( dev ); + bitmap = NULL; + depth = physdev->depth; + color_shifts = physdev->color_shifts; + } + format = pixmap_formats[depth]; + + if (info->bmiHeader.biPlanes != 1) goto update_format; + if (info->bmiHeader.biBitCount != format->bits_per_pixel) goto update_format; + if (info->bmiHeader.biHeight > 0) goto update_format; /* bottom-up not supported */ + + if (info->bmiHeader.biCompression == BI_BITFIELDS) + { + DWORD *masks = (DWORD *)((char *)info + info->bmiHeader.biSize); + if (color_shifts->logicalRed.max << color_shifts->logicalRed.shift != masks[0] || + color_shifts->logicalGreen.max << color_shifts->logicalGreen.shift != masks[1] || + color_shifts->logicalBlue.max << color_shifts->logicalBlue.shift != masks[2]) + goto update_format; + } + else if (info->bmiHeader.biCompression == BI_RGB) + { + switch (info->bmiHeader.biBitCount) + { + case 16: + if (color_shifts->logicalRed.max << color_shifts->logicalRed.shift != 0x7c00 || + color_shifts->logicalGreen.max << color_shifts->logicalGreen.shift != 0x03e0 || + color_shifts->logicalBlue.max << color_shifts->logicalBlue.shift != 0x001f) + goto update_format; + break; + case 24: + case 32: + if (color_shifts->logicalRed.max << color_shifts->logicalRed.shift != 0xff0000 || + color_shifts->logicalGreen.max << color_shifts->logicalGreen.shift != 0x00ff00 || + color_shifts->logicalBlue.max << color_shifts->logicalBlue.shift != 0x0000ff) + goto update_format; + break; + } + } + else goto update_format; + + if (!bits) return ret; /* just querying the format */ + + wine_tsx11_lock(); + image = XCreateImage( gdi_display, visual, depth, ZPixmap, 0, NULL, + info->bmiHeader.biWidth, -info->bmiHeader.biHeight, 32, 0 ); + wine_tsx11_unlock(); + if (!image) return ERROR_OUTOFMEMORY; + + ret = copy_image_bits( info, color_shifts, image, bits, &dst_bits ); + + if (!ret) + { + image->data = dst_bits.ptr; + if (bitmap) + { + wine_tsx11_lock(); + XPutImage( gdi_display, bitmap->pixmap, get_bitmap_gc(depth), image, dst_bits.offset, 0, + rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top ); + wine_tsx11_unlock(); + } + else + { + /* FIXME: copy rop handling from BitBlt here */ + X11DRV_LockDIBSection( physdev, DIB_Status_GdiMod ); + wine_tsx11_lock(); + XPutImage( gdi_display, physdev->drawable, physdev->gc, image, dst_bits.offset, 0, + physdev->dc_rect.left + rect->left, physdev->dc_rect.top + rect->top, + rect->right - rect->left, rect->bottom - rect->top ); + wine_tsx11_unlock(); + X11DRV_UnlockDIBSection( physdev, !ret ); + } + image->data = NULL; + } + + wine_tsx11_lock(); + XDestroyImage( image ); + wine_tsx11_unlock(); + if (dst_bits.free) dst_bits.free( &dst_bits ); + return ret; + +update_format: + info->bmiHeader.biPlanes = 1; + info->bmiHeader.biBitCount = format->bits_per_pixel; + if (info->bmiHeader.biHeight > 0) info->bmiHeader.biHeight = -info->bmiHeader.biHeight; + set_color_info( physdev->color_shifts, info ); + return ERROR_BAD_FORMAT; +} + +/*********************************************************************** * X11DRV_GetImage */ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index f78e20e..5562fb9 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -512,7 +512,7 @@ static const struct gdi_dc_funcs x11drv_funcs = X11DRV_Polygon, /* pPolygon */ X11DRV_Polyline, /* pPolyline */ NULL, /* pPolylineTo */ - NULL, /* pPutImage */ + X11DRV_PutImage, /* pPutImage */ X11DRV_RealizeDefaultPalette, /* pRealizeDefaultPalette */ X11DRV_RealizePalette, /* pRealizePalette */ X11DRV_Rectangle, /* pRectangle */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index ecf608e..d1fbbf3 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -221,6 +221,8 @@ extern BOOL X11DRV_Polyline( PHYSDEV dev,const POINT* pt,INT count) DECLSPEC_HID extern BOOL X11DRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN; extern BOOL X11DRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygons) DECLSPEC_HIDDEN; extern BOOL X11DRV_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polylines) DECLSPEC_HIDDEN; +extern DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, const struct gdi_image_bits *bits, + const RECT *rect, DWORD rop ) DECLSPEC_HIDDEN; extern UINT X11DRV_RealizeDefaultPalette( PHYSDEV dev ) DECLSPEC_HIDDEN; extern UINT X11DRV_RealizePalette( PHYSDEV dev, HPALETTE hpal, BOOL primary ) DECLSPEC_HIDDEN; extern BOOL X11DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : winex11: Add support for byte swapping in GetImage.
by Alexandre Julliard
14 Jul '11
14 Jul '11
Module: wine Branch: master Commit: c2a9b4a8dc3a9fb0d646885da157aa04241f3c77 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2a9b4a8dc3a9fb0d646885da…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 14 12:47:45 2011 +0200 winex11: Add support for byte swapping in GetImage. --- dlls/winex11.drv/bitblt.c | 166 ++++++++++++++++++++++++++++++++++++++------- 1 files changed, 142 insertions(+), 24 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 14f90ef..3e2ef2c 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -30,6 +30,7 @@ #include "winbase.h" #include "wingdi.h" #include "winuser.h" +#include "winternl.h" #include "x11drv.h" #include "wine/debug.h" @@ -443,6 +444,41 @@ static const unsigned char BITBLT_Opcodes[256][MAX_OP_LEN] = { OP(PAT,DST,GXset) } /* 0xff 1 */ }; +static const unsigned char bit_swap[256] = +{ + 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, + 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, + 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, + 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, + 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, + 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, + 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, + 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, + 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, + 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, + 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, + 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, + 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, + 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, + 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, + 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, + 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, + 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, + 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, + 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, + 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, + 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, + 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, + 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, + 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, + 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, + 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, + 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, + 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, + 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, + 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, + 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff +}; #ifdef BITBLT_TEST /* Opcodes test */ @@ -1587,6 +1623,103 @@ static void set_color_info( const ColorShifts *color_shifts, BITMAPINFO *info ) } } +/* copy the image bits, fixing up alignment and byte swapping as necessary */ +static DWORD copy_image_bits( BITMAPINFO *info, const ColorShifts *color_shifts, XImage *image, + const struct gdi_image_bits *src_bits, struct gdi_image_bits *dst_bits ) +{ + BOOL need_byteswap; + int x, y, height = -info->bmiHeader.biHeight; + unsigned int width_bytes = image->bytes_per_line; + unsigned char *src, *dst; + + switch (info->bmiHeader.biBitCount) + { + case 1: + need_byteswap = (image->bitmap_bit_order != MSBFirst); + break; + case 4: + need_byteswap = (image->byte_order != MSBFirst); + break; + case 16: + case 32: + need_byteswap = (image->byte_order != LSBFirst); + break; + case 24: + need_byteswap = ((image->byte_order == LSBFirst && color_shifts->logicalBlue.shift == 16) || + (image->byte_order == MSBFirst && color_shifts->logicalBlue.shift == 0)); + break; + default: + need_byteswap = FALSE; + break; + } + + if ((need_byteswap && !src_bits->is_copy) || (width_bytes & 3)) + { + width_bytes = (width_bytes + 3) & ~3; + info->bmiHeader.biSizeImage = height * width_bytes; + if (!(dst_bits->ptr = HeapAlloc( GetProcessHeap(), 0, info->bmiHeader.biSizeImage ))) + return ERROR_OUTOFMEMORY; + dst_bits->offset = src_bits->offset; + dst_bits->is_copy = TRUE; + dst_bits->free = free_heap_bits; + } + else + { + /* swap bits in place */ + dst_bits->ptr = src_bits->ptr; + dst_bits->offset = src_bits->offset; + dst_bits->is_copy = src_bits->is_copy; + dst_bits->free = NULL; + if (!need_byteswap) return ERROR_SUCCESS; /* nothing to do */ + } + + src = src_bits->ptr; + dst = dst_bits->ptr; + + if (need_byteswap) + { + switch (info->bmiHeader.biBitCount) + { + case 1: + for (y = 0; y < height; y++, src += image->bytes_per_line, dst += width_bytes) + for (x = 0; x < image->bytes_per_line; x++) + dst[x] = bit_swap[src[x]]; + break; + case 4: + for (y = 0; y < height; y++, src += image->bytes_per_line, dst += width_bytes) + for (x = 0; x < image->bytes_per_line; x++) + dst[x] = (src[x] << 4) | (src[x] >> 4); + break; + case 16: + for (y = 0; y < height; y++, src += image->bytes_per_line, dst += width_bytes) + for (x = 0; x < info->bmiHeader.biWidth; x++) + ((USHORT *)dst)[x] = RtlUshortByteSwap( ((const USHORT *)src)[x] ); + break; + case 24: + for (y = 0; y < height; y++, src += image->bytes_per_line, dst += width_bytes) + for (x = 0; x < info->bmiHeader.biWidth; x++) + { + unsigned char tmp = src[3 * x]; + dst[3 * x] = src[3 * x + 2]; + dst[3 * x + 1] = src[3 * x + 1]; + dst[3 * x + 2] = tmp; + } + break; + case 32: + for (y = 0; y < height; y++, src += image->bytes_per_line, dst += width_bytes) + for (x = 0; x < info->bmiHeader.biWidth; x++) + ((ULONG *)dst)[x] = RtlUlongByteSwap( ((const ULONG *)src)[x] ); + break; + } + } + else + { + for (y = 0; y < height; y++, src += image->bytes_per_line, dst += width_bytes) + memcpy( dst, src, image->bytes_per_line ); + } + return ERROR_SUCCESS; +} + /*********************************************************************** * X11DRV_GetImage */ @@ -1597,8 +1730,9 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, X_PHYSBITMAP *bitmap; DWORD ret = ERROR_SUCCESS; XImage *image; - UINT i, align, x, y, width, height; + UINT align, x, y, width, height; int depth; + struct gdi_image_bits src_bits; const XPixmapFormatValues *format; const ColorShifts *color_shifts; @@ -1631,8 +1765,8 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, FIXME( "depth %u bpp %u not supported yet\n", depth, format->bits_per_pixel ); return ERROR_BAD_FORMAT; } - bits->offset = rect->left & (align - 1); - x = rect->left - bits->offset; + src_bits.offset = rect->left & (align - 1); + x = rect->left - src_bits.offset; y = rect->top; width = rect->right - x; height = rect->bottom - rect->top; @@ -1687,31 +1821,15 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, info->bmiHeader.biClrImportant = 0; set_color_info( color_shifts, info ); - /* check if we need to copy the bits */ - if (image->bytes_per_line & 3) - { - UINT width_bytes = (image->bytes_per_line + 3) & ~3; - info->bmiHeader.biSizeImage = height * width_bytes; - if ((bits->ptr = HeapAlloc( GetProcessHeap(), 0, info->bmiHeader.biSizeImage ))) - { - bits->is_copy = TRUE; - bits->free = free_heap_bits; - for (i = 0; i < height; i++) - memcpy( (char *)bits->ptr + i * width_bytes, - (char *)image->data + i * image->bytes_per_line, - image->bytes_per_line ); - /* FIXME: byte swapping */ - } - else ret = ERROR_OUTOFMEMORY; - } - else + src_bits.ptr = image->data; + src_bits.is_copy = TRUE; + ret = copy_image_bits( info, color_shifts, image, &src_bits, bits ); + + if (!ret && bits->ptr == image->data) { - bits->ptr = image->data; - bits->is_copy = TRUE; bits->free = free_ximage_bits; image->data = NULL; } - wine_tsx11_lock(); XDestroyImage( image ); wine_tsx11_unlock();
1
0
0
0
Alexandre Julliard : winex11: Add an implementation for the GetImage entry point.
by Alexandre Julliard
14 Jul '11
14 Jul '11
Module: wine Branch: master Commit: e6fcbc543ee5fdae32d662731d782cd0bce661c6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e6fcbc543ee5fdae32d662731…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 14 12:37:04 2011 +0200 winex11: Add an implementation for the GetImage entry point. --- dlls/winex11.drv/bitblt.c | 172 ++++++++++++++++++++++++++++++++++++++++++++- dlls/winex11.drv/init.c | 2 +- dlls/winex11.drv/x11drv.h | 2 + 3 files changed, 174 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 54e635a..14f90ef 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1,7 +1,7 @@ /* * GDI bit-blit operations * - * Copyright 1993, 1994 Alexandre Julliard + * Copyright 1993, 1994, 2011 Alexandre Julliard * Copyright 2006 Damjan Jovanovic * * This library is free software; you can redistribute it and/or @@ -1547,3 +1547,173 @@ BOOL X11DRV_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst, return XRender_AlphaBlend( physDevDst, dst, physDevSrc, src, blendfn ); } + + +static void free_heap_bits( struct gdi_image_bits *bits ) +{ + HeapFree( GetProcessHeap(), 0, bits->ptr ); +} + +static void free_ximage_bits( struct gdi_image_bits *bits ) +{ + wine_tsx11_lock(); + XFree( bits->ptr ); + wine_tsx11_unlock(); +} + +/* store the palette or color mask data in the bitmap info structure */ +static void set_color_info( const ColorShifts *color_shifts, BITMAPINFO *info ) +{ + DWORD *colors = (DWORD *)((char *)info + info->bmiHeader.biSize); + + switch (info->bmiHeader.biBitCount) + { + case 1: + case 4: + case 8: + info->bmiHeader.biCompression = BI_RGB; + /* FIXME: set color palette */ + break; + case 16: + case 32: + info->bmiHeader.biCompression = BI_BITFIELDS; + colors[0] = color_shifts->logicalRed.max << color_shifts->logicalRed.shift; + colors[1] = color_shifts->logicalGreen.max << color_shifts->logicalGreen.shift; + colors[2] = color_shifts->logicalBlue.max << color_shifts->logicalBlue.shift; + break; + case 24: + info->bmiHeader.biCompression = BI_RGB; + break; + } +} + +/*********************************************************************** + * X11DRV_GetImage + */ +DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, + struct gdi_image_bits *bits, const RECT *rect ) +{ + X11DRV_PDEVICE *physdev; + X_PHYSBITMAP *bitmap; + DWORD ret = ERROR_SUCCESS; + XImage *image; + UINT i, align, x, y, width, height; + int depth; + const XPixmapFormatValues *format; + const ColorShifts *color_shifts; + + if (hbitmap) + { + if (!(bitmap = X11DRV_get_phys_bitmap( hbitmap ))) return ERROR_INVALID_HANDLE; + physdev = NULL; + depth = bitmap->pixmap_depth; + color_shifts = &bitmap->pixmap_color_shifts; + } + else + { + physdev = get_x11drv_dev( dev ); + bitmap = NULL; + depth = physdev->depth; + color_shifts = physdev->color_shifts; + } + format = pixmap_formats[depth]; + + /* align start and width to 32-bit boundary */ + switch (format->bits_per_pixel) + { + case 1: align = 32; break; + case 4: align = 8; break; + case 8: align = 4; break; + case 16: align = 2; break; + case 24: align = 4; break; + case 32: align = 1; break; + default: + FIXME( "depth %u bpp %u not supported yet\n", depth, format->bits_per_pixel ); + return ERROR_BAD_FORMAT; + } + bits->offset = rect->left & (align - 1); + x = rect->left - bits->offset; + y = rect->top; + width = rect->right - x; + height = rect->bottom - rect->top; + if (format->scanline_pad != 32) width = (width + (align - 1)) & ~(align - 1); + + if (bitmap) + { + BITMAP bm; + GetObjectW( hbitmap, sizeof(bm), &bm ); + width = min( width, bm.bmWidth - x ); + height = min( height, bm.bmHeight - y ); + wine_tsx11_lock(); + image = XGetImage( gdi_display, bitmap->pixmap, x, y, width, height, AllPlanes, ZPixmap ); + wine_tsx11_unlock(); + } + else if (GetObjectType( dev->hdc ) == OBJ_MEMDC) + { + X11DRV_LockDIBSection( physdev, DIB_Status_GdiMod ); + width = min( width, physdev->dc_rect.right - physdev->dc_rect.left - x ); + height = min( height, physdev->dc_rect.bottom - physdev->dc_rect.top - y ); + wine_tsx11_lock(); + image = XGetImage( gdi_display, physdev->drawable, + physdev->dc_rect.left + x, physdev->dc_rect.top + y, + width, height, AllPlanes, ZPixmap ); + wine_tsx11_unlock(); + X11DRV_UnlockDIBSection( physdev, FALSE ); + } + else + { + Pixmap pixmap; + + wine_tsx11_lock(); + /* use a temporary pixmap to avoid BadMatch errors */ + pixmap = XCreatePixmap( gdi_display, root_window, width, height, depth ); + XCopyArea( gdi_display, physdev->drawable, pixmap, get_bitmap_gc(depth), + physdev->dc_rect.left + x, physdev->dc_rect.top + y, width, height, 0, 0 ); + image = XGetImage( gdi_display, pixmap, 0, 0, width, height, AllPlanes, ZPixmap ); + XFreePixmap( gdi_display, pixmap ); + wine_tsx11_unlock(); + } + if (!image) return ERROR_OUTOFMEMORY; + + info->bmiHeader.biSize = sizeof(info->bmiHeader); + info->bmiHeader.biWidth = width; + info->bmiHeader.biHeight = -height; + info->bmiHeader.biPlanes = 1; + info->bmiHeader.biBitCount = image->bits_per_pixel; + info->bmiHeader.biSizeImage = height * image->bytes_per_line; + info->bmiHeader.biXPelsPerMeter = 0; + info->bmiHeader.biYPelsPerMeter = 0; + info->bmiHeader.biClrUsed = 0; + info->bmiHeader.biClrImportant = 0; + set_color_info( color_shifts, info ); + + /* check if we need to copy the bits */ + if (image->bytes_per_line & 3) + { + UINT width_bytes = (image->bytes_per_line + 3) & ~3; + info->bmiHeader.biSizeImage = height * width_bytes; + if ((bits->ptr = HeapAlloc( GetProcessHeap(), 0, info->bmiHeader.biSizeImage ))) + { + bits->is_copy = TRUE; + bits->free = free_heap_bits; + for (i = 0; i < height; i++) + memcpy( (char *)bits->ptr + i * width_bytes, + (char *)image->data + i * image->bytes_per_line, + image->bytes_per_line ); + /* FIXME: byte swapping */ + } + else ret = ERROR_OUTOFMEMORY; + } + else + { + bits->ptr = image->data; + bits->is_copy = TRUE; + bits->free = free_ximage_bits; + image->data = NULL; + } + + wine_tsx11_lock(); + XDestroyImage( image ); + wine_tsx11_unlock(); + return ret; +} diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index d1800d4..f78e20e 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -486,7 +486,7 @@ static const struct gdi_dc_funcs x11drv_funcs = X11DRV_GetDeviceCaps, /* pGetDeviceCaps */ X11DRV_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */ X11DRV_GetICMProfile, /* pGetICMProfile */ - NULL, /* pGetImage */ + X11DRV_GetImage, /* pGetImage */ X11DRV_GetNearestColor, /* pGetNearestColor */ X11DRV_GetPixel, /* pGetPixel */ X11DRV_GetPixelFormat, /* pGetPixelFormat */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 5575b89..ecf608e 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -204,6 +204,8 @@ extern BOOL X11DRV_GetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ) DECLSPEC_HIDDE extern INT X11DRV_GetDIBits( PHYSDEV dev, HBITMAP hbitmap, UINT startscan, UINT lines, LPVOID bits, BITMAPINFO *info, UINT coloruse ) DECLSPEC_HIDDEN; extern BOOL X11DRV_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename ) DECLSPEC_HIDDEN; +extern DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, + struct gdi_image_bits *bits, const RECT *rect ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_GetNearestColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF X11DRV_GetPixel( PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN; extern UINT X11DRV_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, LPPALETTEENTRY entries ) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : gdi32: Add a null driver StretchBlt fallback using GetImage/PutImage.
by Alexandre Julliard
14 Jul '11
14 Jul '11
Module: wine Branch: master Commit: 79d3f290611a6f9c8b15d6fdfa406d6cd51ac60e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=79d3f290611a6f9c8b15d6fdf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 14 12:19:13 2011 +0200 gdi32: Add a null driver StretchBlt fallback using GetImage/PutImage. --- dlls/gdi32/bitblt.c | 81 +++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 65 insertions(+), 16 deletions(-) diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index c9f1c26..a99efc7 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -164,48 +164,97 @@ static void get_vis_rectangles( DC *dc_dst, struct bitblt_coords *dst, } } +static DWORD convert_bits( const BITMAPINFO *src_info, struct gdi_image_bits *src_bits, + const RECT *src_rect, BITMAPINFO *dst_info, struct gdi_image_bits *dst_bits ) +{ + FIXME( "%u -> %u not implemented\n", src_info->bmiHeader.biBitCount, dst_info->bmiHeader.biBitCount ); + dst_bits->ptr = src_bits->ptr; + dst_bits->offset = src_bits->offset; + dst_bits->is_copy = src_bits->is_copy; + dst_bits->free = NULL; + return ERROR_SUCCESS; +} + /* nulldrv fallback implementation using StretchDIBits */ BOOL nulldrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, PHYSDEV src_dev, struct bitblt_coords *src, DWORD rop ) { - DC *dc = get_nulldrv_dc( dst_dev ); + DC *dc_src, *dc_dst = get_nulldrv_dc( dst_dev ); + char src_buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; + char dst_buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; + BITMAPINFO *src_info = (BITMAPINFO *)src_buffer; + BITMAPINFO *dst_info = (BITMAPINFO *)dst_buffer; + DWORD err; + struct gdi_image_bits src_bits, dst_bits; BITMAP bm; - BITMAPINFOHEADER info_hdr; HBITMAP hbm; LPVOID bits; INT lines; + if (dst->visrect.left >= dst->visrect.right || dst->visrect.top >= dst->visrect.bottom) return TRUE; + /* make sure we have a real implementation for StretchDIBits */ - if (GET_DC_PHYSDEV( dc, pStretchDIBits ) == dst_dev) return 0; + if (GET_DC_PHYSDEV( dc_dst, pStretchDIBits ) == dst_dev) goto try_get_image; if (GetObjectType( src_dev->hdc ) != OBJ_MEMDC) return FALSE; if (!GetObjectW( GetCurrentObject( src_dev->hdc, OBJ_BITMAP ), sizeof(bm), &bm )) return FALSE; - info_hdr.biSize = sizeof(info_hdr); - info_hdr.biWidth = bm.bmWidth; - info_hdr.biHeight = bm.bmHeight; - info_hdr.biPlanes = 1; - info_hdr.biBitCount = 32; - info_hdr.biCompression = BI_RGB; - info_hdr.biSizeImage = 0; - info_hdr.biXPelsPerMeter = 0; - info_hdr.biYPelsPerMeter = 0; - info_hdr.biClrUsed = 0; - info_hdr.biClrImportant = 0; + src_info->bmiHeader.biSize = sizeof(src_info->bmiHeader); + src_info->bmiHeader.biWidth = bm.bmWidth; + src_info->bmiHeader.biHeight = bm.bmHeight; + src_info->bmiHeader.biPlanes = 1; + src_info->bmiHeader.biBitCount = 32; + src_info->bmiHeader.biCompression = BI_RGB; + src_info->bmiHeader.biSizeImage = 0; + src_info->bmiHeader.biXPelsPerMeter = 0; + src_info->bmiHeader.biYPelsPerMeter = 0; + src_info->bmiHeader.biClrUsed = 0; + src_info->bmiHeader.biClrImportant = 0; if (!(bits = HeapAlloc(GetProcessHeap(), 0, bm.bmHeight * bm.bmWidth * 4))) return FALSE; /* Select out the src bitmap before calling GetDIBits */ hbm = SelectObject( src_dev->hdc, GetStockObject(DEFAULT_BITMAP) ); - lines = GetDIBits( src_dev->hdc, hbm, 0, bm.bmHeight, bits, (BITMAPINFO*)&info_hdr, DIB_RGB_COLORS ); + lines = GetDIBits( src_dev->hdc, hbm, 0, bm.bmHeight, bits, src_info, DIB_RGB_COLORS ); SelectObject( src_dev->hdc, hbm ); if (lines) lines = StretchDIBits( dst_dev->hdc, dst->log_x, dst->log_y, dst->log_width, dst->log_height, src->x, bm.bmHeight - src->height - src->y, src->width, src->height, - bits, (BITMAPINFO*)&info_hdr, DIB_RGB_COLORS, rop ); + bits, src_info, DIB_RGB_COLORS, rop ); HeapFree( GetProcessHeap(), 0, bits ); return (lines == src->height); + +try_get_image: + + if (!(dc_src = get_dc_ptr( src_dev->hdc ))) return FALSE; + src_dev = GET_DC_PHYSDEV( dc_src, pGetImage ); + err = src_dev->funcs->pGetImage( src_dev, 0, src_info, &src_bits, &src->visrect ); + release_dc_ptr( dc_src ); + if (err) return FALSE; + + dst_dev = GET_DC_PHYSDEV( dc_dst, pPutImage ); + + if ((src->width != dst->width) || (src->height != dst->height)) + FIXME( "should stretch %dx%d -> %dx%d\n", + src->width, src->height, dst->width, dst->height ); + + memcpy( dst_info, src_info, FIELD_OFFSET( BITMAPINFO, bmiColors[256] )); + err = dst_dev->funcs->pPutImage( dst_dev, 0, dst_info, &src_bits, &dst->visrect, rop ); + if (err == ERROR_BAD_FORMAT) + { + RECT src_rect = src->visrect; + offset_rect( &src_rect, src_bits.offset - src->visrect.left, -src->visrect.top ); + + err = convert_bits( src_info, &src_bits, &src_rect, dst_info, &dst_bits ); + if (!err) + { + err = dst_dev->funcs->pPutImage( dst_dev, 0, dst_info, &dst_bits, &dst->visrect, rop ); + if (dst_bits.free) dst_bits.free( &dst_bits ); + } + } + if (src_bits.free) src_bits.free( &src_bits ); + return !err; } /***********************************************************************
1
0
0
0
Alexandre Julliard : gdi32: Add driver entry points for GetImage and PutImage.
by Alexandre Julliard
14 Jul '11
14 Jul '11
Module: wine Branch: master Commit: cf05fca87837ac3223c2f332c4023c3f7086eb7c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cf05fca87837ac3223c2f332c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 14 11:30:58 2011 +0200 gdi32: Add driver entry points for GetImage and PutImage. --- dlls/gdi32/dibdrv/dc.c | 2 ++ dlls/gdi32/driver.c | 14 ++++++++++++++ dlls/gdi32/enhmfdrv/init.c | 2 ++ dlls/gdi32/mfdrv/init.c | 2 ++ dlls/wineps.drv/init.c | 2 ++ dlls/winex11.drv/init.c | 2 ++ include/wine/gdi_driver.h | 11 +++++++++++ 7 files changed, 35 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index 89246d8..3ec44d1 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -469,6 +469,7 @@ const DC_FUNCTIONS dib_driver = NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetICMProfile */ + NULL, /* pGetImage */ NULL, /* pGetNearestColor */ NULL, /* pGetPixel */ NULL, /* pGetPixelFormat */ @@ -494,6 +495,7 @@ const DC_FUNCTIONS dib_driver = NULL, /* pPolygon */ NULL, /* pPolyline */ NULL, /* pPolylineTo */ + NULL, /* pPutImage */ NULL, /* pRealizeDefaultPalette */ NULL, /* pRealizePalette */ dibdrv_Rectangle, /* pRectangle */ diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 04db5e0..6cdf35d 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -347,6 +347,12 @@ static BOOL nulldrv_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename ) return FALSE; } +static DWORD nulldrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, + struct gdi_image_bits *bits, const RECT *rect ) +{ + return ERROR_NOT_SUPPORTED; +} + static COLORREF nulldrv_GetPixel( PHYSDEV dev, INT x, INT y ) { return 0; @@ -421,6 +427,12 @@ static BOOL nulldrv_Polyline( PHYSDEV dev, const POINT *points, INT count ) return TRUE; } +static DWORD nulldrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, + const struct gdi_image_bits *bits, const RECT *rect, DWORD rop ) +{ + return ERROR_SUCCESS; +} + static UINT nulldrv_RealizeDefaultPalette( PHYSDEV dev ) { return 0; @@ -701,6 +713,7 @@ const DC_FUNCTIONS null_driver = nulldrv_GetDeviceCaps, /* pGetDeviceCaps */ nulldrv_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */ nulldrv_GetICMProfile, /* pGetICMProfile */ + nulldrv_GetImage, /* pGetImage */ nulldrv_GetNearestColor, /* pGetNearestColor */ nulldrv_GetPixel, /* pGetPixel */ nulldrv_GetPixelFormat, /* pGetPixelFormat */ @@ -726,6 +739,7 @@ const DC_FUNCTIONS null_driver = nulldrv_Polygon, /* pPolygon */ nulldrv_Polyline, /* pPolyline */ nulldrv_PolylineTo, /* pPolylineTo */ + nulldrv_PutImage, /* pPutImage */ nulldrv_RealizeDefaultPalette, /* pRealizeDefaultPalette */ nulldrv_RealizePalette, /* pRealizePalette */ nulldrv_Rectangle, /* pRectangle */ diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 4920266..e7cbf2e 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -77,6 +77,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs = EMFDRV_GetDeviceCaps, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetICMProfile */ + NULL, /* pGetImage */ NULL, /* pGetNearestColor */ NULL, /* pGetPixel */ NULL, /* pGetPixelFormat */ @@ -102,6 +103,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs = EMFDRV_Polygon, /* pPolygon */ EMFDRV_Polyline, /* pPolyline */ NULL, /* pPolylineTo */ + NULL, /* pPutImage */ NULL, /* pRealizeDefaultPalette */ NULL, /* pRealizePalette */ EMFDRV_Rectangle, /* pRectangle */ diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index ae791c2..4685470 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -121,6 +121,7 @@ static const DC_FUNCTIONS MFDRV_Funcs = MFDRV_GetDeviceCaps, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetICMProfile */ + NULL, /* pGetImage */ NULL, /* pGetNearestColor */ NULL, /* pGetPixel */ NULL, /* pGetPixelFormat */ @@ -146,6 +147,7 @@ static const DC_FUNCTIONS MFDRV_Funcs = MFDRV_Polygon, /* pPolygon */ MFDRV_Polyline, /* pPolyline */ NULL, /* pPolylineTo */ + NULL, /* pPutImage */ NULL, /* pRealizeDefaultPalette */ MFDRV_RealizePalette, /* pRealizePalette */ MFDRV_Rectangle, /* pRectangle */ diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index ca80f4e..84d4b45 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -843,6 +843,7 @@ static const struct gdi_dc_funcs psdrv_funcs = PSDRV_GetDeviceCaps, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetICMProfile */ + NULL, /* pGetImage */ NULL, /* pGetNearestColor */ NULL, /* pGetPixel */ NULL, /* pGetPixelFormat */ @@ -868,6 +869,7 @@ static const struct gdi_dc_funcs psdrv_funcs = PSDRV_Polygon, /* pPolygon */ PSDRV_Polyline, /* pPolyline */ NULL, /* pPolylineTo */ + NULL, /* pPutImage */ NULL, /* pRealizeDefaultPalette */ NULL, /* pRealizePalette */ PSDRV_Rectangle, /* pRectangle */ diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index f86c17c..d1800d4 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -486,6 +486,7 @@ static const struct gdi_dc_funcs x11drv_funcs = X11DRV_GetDeviceCaps, /* pGetDeviceCaps */ X11DRV_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */ X11DRV_GetICMProfile, /* pGetICMProfile */ + NULL, /* pGetImage */ X11DRV_GetNearestColor, /* pGetNearestColor */ X11DRV_GetPixel, /* pGetPixel */ X11DRV_GetPixelFormat, /* pGetPixelFormat */ @@ -511,6 +512,7 @@ static const struct gdi_dc_funcs x11drv_funcs = X11DRV_Polygon, /* pPolygon */ X11DRV_Polyline, /* pPolyline */ NULL, /* pPolylineTo */ + NULL, /* pPutImage */ X11DRV_RealizeDefaultPalette, /* pRealizeDefaultPalette */ X11DRV_RealizePalette, /* pRealizePalette */ X11DRV_Rectangle, /* pRectangle */ diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index d8040ac..811cf80 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -44,6 +44,15 @@ struct bitblt_coords DWORD layout; /* DC layout */ }; +struct gdi_image_bits +{ + void *ptr; /* pointer to the bits */ + unsigned int offset; /* x offset of first requested pixel */ + BOOL is_copy; /* whether this is a copy of the bits that can be modified */ + void (*free)(struct gdi_image_bits *); /* callback for freeing the bits */ + void *param; /* extra parameter for callback private use */ +}; + struct gdi_dc_funcs { INT (*pAbortDoc)(PHYSDEV); @@ -87,6 +96,7 @@ struct gdi_dc_funcs INT (*pGetDeviceCaps)(PHYSDEV,INT); BOOL (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID); BOOL (*pGetICMProfile)(PHYSDEV,LPDWORD,LPWSTR); + DWORD (*pGetImage)(PHYSDEV,HBITMAP,BITMAPINFO*,struct gdi_image_bits*,const RECT*); COLORREF (*pGetNearestColor)(PHYSDEV,COLORREF); COLORREF (*pGetPixel)(PHYSDEV,INT,INT); INT (*pGetPixelFormat)(PHYSDEV); @@ -112,6 +122,7 @@ struct gdi_dc_funcs BOOL (*pPolygon)(PHYSDEV,const POINT*,INT); BOOL (*pPolyline)(PHYSDEV,const POINT*,INT); BOOL (*pPolylineTo)(PHYSDEV,const POINT*,INT); + DWORD (*pPutImage)(PHYSDEV,HBITMAP,BITMAPINFO*,const struct gdi_image_bits*,const RECT*,DWORD); UINT (*pRealizeDefaultPalette)(PHYSDEV); UINT (*pRealizePalette)(PHYSDEV,HPALETTE,BOOL); BOOL (*pRectangle)(PHYSDEV,INT,INT,INT,INT);
1
0
0
0
Rico Schüller : d3dx9: Parse elements in d3dx9_parse_resource().
by Alexandre Julliard
13 Jul '11
13 Jul '11
Module: wine Branch: master Commit: 340643af30f1df399f6735588a885410b7085508 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=340643af30f1df399f6735588…
Author: Rico Schüller <kgbricola(a)web.de> Date: Wed Jul 13 10:45:40 2011 +0200 d3dx9: Parse elements in d3dx9_parse_resource(). --- dlls/d3dx9_36/effect.c | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index b4f1932..0b0c436 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -4737,7 +4737,7 @@ err_out: static HRESULT d3dx9_parse_resource(struct ID3DXBaseEffectImpl *base, const char *data, const char **ptr) { DWORD technique_index; - DWORD index, state_index, usage; + DWORD index, state_index, usage, element_index; struct d3dx_state *state; struct d3dx_parameter *param; HRESULT hr = E_FAIL; @@ -4748,10 +4748,11 @@ static HRESULT d3dx9_parse_resource(struct ID3DXBaseEffectImpl *base, const char read_dword(ptr, &index); TRACE("index: %u\n", index); - skip_dword_unknown(ptr, 1); + read_dword(ptr, &element_index); + TRACE("element_index: %u\n", element_index); read_dword(ptr, &state_index); - TRACE("state: %u\n", state_index); + TRACE("state_index: %u\n", state_index); read_dword(ptr, &usage); TRACE("usage: %u\n", usage); @@ -4768,6 +4769,17 @@ static HRESULT d3dx9_parse_resource(struct ID3DXBaseEffectImpl *base, const char } parameter = get_parameter_struct(base->parameter_handles[index]); + if (element_index != 0xffffffff) + { + if (element_index >= parameter->element_count && parameter->element_count != 0) + { + FIXME("Index out of bounds: element_index %u >= element_count %u\n", element_index, parameter->element_count); + return E_FAIL; + } + + if (parameter->element_count != 0) parameter = get_parameter_struct(parameter->member_handles[element_index]); + } + sampler = parameter->data; if (state_index >= sampler->state_count) {
1
0
0
0
Michael Stefaniuc : ole32: COM cleanup for the IEnumCATEGORYINFO iface.
by Alexandre Julliard
13 Jul '11
13 Jul '11
Module: wine Branch: master Commit: 9d94b1d402598e70fd3bf7d65eab3a9e17733af2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d94b1d402598e70fd3bf7d65…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Jul 13 14:22:05 2011 +0200 ole32: COM cleanup for the IEnumCATEGORYINFO iface. --- dlls/ole32/comcat.c | 47 ++++++++++++++++++++++++++--------------------- 1 files changed, 26 insertions(+), 21 deletions(-) diff --git a/dlls/ole32/comcat.c b/dlls/ole32/comcat.c index 20151ae..1874a8b 100644 --- a/dlls/ole32/comcat.c +++ b/dlls/ole32/comcat.c @@ -57,7 +57,7 @@ struct class_categories { LPCWSTR req_strings; }; -static LPENUMCATEGORYINFO COMCAT_IEnumCATEGORYINFO_Construct(LCID lcid); +static IEnumCATEGORYINFO *COMCAT_IEnumCATEGORYINFO_Construct(LCID lcid); static LPENUMGUID COMCAT_CLSID_IEnumGUID_Construct(struct class_categories *class_categories); static LPENUMGUID COMCAT_CATID_IEnumGUID_Construct(REFCLSID rclsid, LPCWSTR impl_req); @@ -490,7 +490,7 @@ static ULONG WINAPI COMCAT_ICatInformation_Release(LPCATINFORMATION iface) static HRESULT WINAPI COMCAT_ICatInformation_EnumCategories( LPCATINFORMATION iface, LCID lcid, - LPENUMCATEGORYINFO *ppenumCatInfo) + IEnumCATEGORYINFO **ppenumCatInfo) { TRACE("\n"); @@ -806,16 +806,21 @@ HRESULT ComCatCF_Create(REFIID riid, LPVOID *ppv) */ typedef struct { - const IEnumCATEGORYINFOVtbl *lpVtbl; + IEnumCATEGORYINFO IEnumCATEGORYINFO_iface; LONG ref; LCID lcid; HKEY key; DWORD next_index; } IEnumCATEGORYINFOImpl; -static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_AddRef(LPENUMCATEGORYINFO iface) +static inline IEnumCATEGORYINFOImpl *impl_from_IEnumCATEGORYINFO(IEnumCATEGORYINFO *iface) { - IEnumCATEGORYINFOImpl *This = (IEnumCATEGORYINFOImpl *)iface; + return CONTAINING_RECORD(iface, IEnumCATEGORYINFOImpl, IEnumCATEGORYINFO_iface); +} + +static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_AddRef(IEnumCATEGORYINFO *iface) +{ + IEnumCATEGORYINFOImpl *This = impl_from_IEnumCATEGORYINFO(iface); TRACE("\n"); @@ -823,7 +828,7 @@ static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_AddRef(LPENUMCATEGORYINFO iface) } static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_QueryInterface( - LPENUMCATEGORYINFO iface, + IEnumCATEGORYINFO *iface, REFIID riid, LPVOID *ppvObj) { @@ -842,9 +847,9 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_QueryInterface( return E_NOINTERFACE; } -static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_Release(LPENUMCATEGORYINFO iface) +static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_Release(IEnumCATEGORYINFO *iface) { - IEnumCATEGORYINFOImpl *This = (IEnumCATEGORYINFOImpl *)iface; + IEnumCATEGORYINFOImpl *This = impl_from_IEnumCATEGORYINFO(iface); ULONG ref; TRACE("\n"); @@ -859,12 +864,12 @@ static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_Release(LPENUMCATEGORYINFO iface) } static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Next( - LPENUMCATEGORYINFO iface, + IEnumCATEGORYINFO *iface, ULONG celt, CATEGORYINFO *rgelt, ULONG *pceltFetched) { - IEnumCATEGORYINFOImpl *This = (IEnumCATEGORYINFOImpl *)iface; + IEnumCATEGORYINFOImpl *This = impl_from_IEnumCATEGORYINFO(iface); ULONG fetched = 0; TRACE("\n"); @@ -904,10 +909,10 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Next( } static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Skip( - LPENUMCATEGORYINFO iface, + IEnumCATEGORYINFO *iface, ULONG celt) { - IEnumCATEGORYINFOImpl *This = (IEnumCATEGORYINFOImpl *)iface; + IEnumCATEGORYINFOImpl *This = impl_from_IEnumCATEGORYINFO(iface); TRACE("\n"); @@ -916,9 +921,9 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Skip( return S_OK; } -static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Reset(LPENUMCATEGORYINFO iface) +static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Reset(IEnumCATEGORYINFO *iface) { - IEnumCATEGORYINFOImpl *This = (IEnumCATEGORYINFOImpl *)iface; + IEnumCATEGORYINFOImpl *This = impl_from_IEnumCATEGORYINFO(iface); TRACE("\n"); @@ -927,10 +932,10 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Reset(LPENUMCATEGORYINFO iface) } static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Clone( - LPENUMCATEGORYINFO iface, + IEnumCATEGORYINFO *iface, IEnumCATEGORYINFO **ppenum) { - IEnumCATEGORYINFOImpl *This = (IEnumCATEGORYINFOImpl *)iface; + IEnumCATEGORYINFOImpl *This = impl_from_IEnumCATEGORYINFO(iface); static const WCHAR keyname[] = { 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', ' ', 'C', 'a', 't', 'e', 'g', 'o', 'r', 'i', 'e', 's', 0 }; @@ -943,14 +948,14 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Clone( new_this = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumCATEGORYINFOImpl)); if (new_this == NULL) return E_OUTOFMEMORY; - new_this->lpVtbl = This->lpVtbl; + new_this->IEnumCATEGORYINFO_iface = This->IEnumCATEGORYINFO_iface; new_this->ref = 1; new_this->lcid = This->lcid; /* FIXME: could we more efficiently use DuplicateHandle? */ RegOpenKeyExW(HKEY_CLASSES_ROOT, keyname, 0, KEY_READ, &new_this->key); new_this->next_index = This->next_index; - *ppenum = (LPENUMCATEGORYINFO)new_this; + *ppenum = &new_this->IEnumCATEGORYINFO_iface; return S_OK; } @@ -965,7 +970,7 @@ static const IEnumCATEGORYINFOVtbl COMCAT_IEnumCATEGORYINFO_Vtbl = COMCAT_IEnumCATEGORYINFO_Clone }; -static LPENUMCATEGORYINFO COMCAT_IEnumCATEGORYINFO_Construct(LCID lcid) +static IEnumCATEGORYINFO *COMCAT_IEnumCATEGORYINFO_Construct(LCID lcid) { IEnumCATEGORYINFOImpl *This; @@ -975,11 +980,11 @@ static LPENUMCATEGORYINFO COMCAT_IEnumCATEGORYINFO_Construct(LCID lcid) 't', ' ', 'C', 'a', 't', 'e', 'g', 'o', 'r', 'i', 'e', 's', 0 }; - This->lpVtbl = &COMCAT_IEnumCATEGORYINFO_Vtbl; + This->IEnumCATEGORYINFO_iface.lpVtbl = &COMCAT_IEnumCATEGORYINFO_Vtbl; This->lcid = lcid; RegOpenKeyExW(HKEY_CLASSES_ROOT, keyname, 0, KEY_READ, &This->key); } - return (LPENUMCATEGORYINFO)This; + return &This->IEnumCATEGORYINFO_iface; } /**********************************************************************
1
0
0
0
Huw Davies : gdi32: Add conversion routines for source dibs with an arbitrary order of red and blue 5-bit and green 5 or 6-bit channels .
by Alexandre Julliard
13 Jul '11
13 Jul '11
Module: wine Branch: master Commit: ba33f5e6670307445bf4d6cc57907725b8d47324 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ba33f5e6670307445bf4d6cc5…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Jul 13 13:05:00 2011 +0100 gdi32: Add conversion routines for source dibs with an arbitrary order of red and blue 5-bit and green 5 or 6-bit channels. --- dlls/gdi32/dibdrv/primitives.c | 363 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 354 insertions(+), 9 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ba33f5e6670307445bf4d…
1
0
0
0
← Newer
1
...
47
48
49
50
51
52
53
...
84
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
Results per page:
10
25
50
100
200