Alexandre Julliard : gdi32: Don' t make a copy of the DIB color table when selecting it into a DC.

Alexandre Julliard julliard at winehq.org
Thu Dec 8 13:43:40 CST 2011


Module: wine
Branch: master
Commit: 71199eab77848feddbf3fce04d67c0f8837c8359
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=71199eab77848feddbf3fce04d67c0f8837c8359

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec  8 17:04:14 2011 +0100

gdi32: Don't make a copy of the DIB color table when selecting it into a DC.

---

 dlls/gdi32/dibdrv/dc.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c
index 2c61d29..b9308bf 100644
--- a/dlls/gdi32/dibdrv/dc.c
+++ b/dlls/gdi32/dibdrv/dc.c
@@ -422,7 +422,7 @@ static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
 
     free_dib_info(&pdev->dib);
     pdev->defer = 0;
-    if(!init_dib_info_from_bitmapobj(&pdev->dib, bmp, private_color_table))
+    if(!init_dib_info_from_bitmapobj(&pdev->dib, bmp, 0))
         pdev->defer |= DEFER_FORMAT;
 
     GDI_ReleaseObj( bitmap );
@@ -495,11 +495,8 @@ static UINT dibdrv_SetDIBColorTable( PHYSDEV dev, UINT pos, UINT count, const RG
     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
     TRACE("(%p, %d, %d, %p)\n", dev, pos, count, colors);
 
-    if( pdev->dib.color_table && pos < pdev->dib.color_table_size )
+    if (pdev->dib.color_table)
     {
-        if( pos + count > pdev->dib.color_table_size ) count = pdev->dib.color_table_size - pos;
-        memcpy( pdev->dib.color_table + pos, colors, count * sizeof(RGBQUAD) );
-
         pdev->bkgnd_color = get_pixel_color( pdev, GetBkColor( dev->hdc ), FALSE );
         update_fg_colors( pdev );
 




More information about the wine-cvs mailing list