Alexandre Julliard : gdi32: GetDIBColorTable doesn' t need to be part of the DC driver interface.

Alexandre Julliard julliard at winehq.org
Tue Mar 8 11:03:52 CST 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Mar  8 16:47:22 2011 +0100

gdi32: GetDIBColorTable doesn't need to be part of the DC driver interface.

---

 dlls/gdi32/dib.c           |   23 +++++++++--------------
 dlls/gdi32/driver.c        |    1 -
 dlls/gdi32/enhmfdrv/init.c |    1 -
 dlls/gdi32/gdi_private.h   |    1 -
 dlls/gdi32/mfdrv/init.c    |    1 -
 5 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c
index 0abd833..0fc2197 100644
--- a/dlls/gdi32/dib.c
+++ b/dlls/gdi32/dib.c
@@ -453,29 +453,24 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA
 UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *colors )
 {
     DC * dc;
+    BITMAPOBJ *bitmap;
     UINT result = 0;
 
     if (!(dc = get_dc_ptr( hdc ))) return 0;
 
-    if (dc->funcs->pGetDIBColorTable)
-        result = dc->funcs->pGetDIBColorTable(dc->physDev, startpos, entries, colors);
-    else
+    if ((bitmap = GDI_GetObjPtr( dc->hBitmap, OBJ_BITMAP )))
     {
-        BITMAPOBJ *bitmap = GDI_GetObjPtr( dc->hBitmap, OBJ_BITMAP );
-        if (bitmap)
+        /* Check if currently selected bitmap is a DIB */
+        if (bitmap->color_table)
         {
-            /* Check if currently selected bitmap is a DIB */
-            if (bitmap->color_table)
+            if (startpos < bitmap->nb_colors)
             {
-                if (startpos < bitmap->nb_colors)
-                {
-                    if (startpos + entries > bitmap->nb_colors) entries = bitmap->nb_colors - startpos;
-                    memcpy(colors, bitmap->color_table + startpos, entries * sizeof(RGBQUAD));
-                    result = entries;
-                }
+                if (startpos + entries > bitmap->nb_colors) entries = bitmap->nb_colors - startpos;
+                memcpy(colors, bitmap->color_table + startpos, entries * sizeof(RGBQUAD));
+                result = entries;
             }
-            GDI_ReleaseObj( dc->hBitmap );
         }
+        GDI_ReleaseObj( dc->hBitmap );
     }
     release_dc_ptr( dc );
     return result;
diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c
index 38c4942..7966c64 100644
--- a/dlls/gdi32/driver.c
+++ b/dlls/gdi32/driver.c
@@ -110,7 +110,6 @@ static struct graphics_driver *create_driver( HMODULE module )
         GET_FUNC(GdiComment);
         GET_FUNC(GetBitmapBits);
         GET_FUNC(GetCharWidth);
-        GET_FUNC(GetDIBColorTable);
         GET_FUNC(GetDIBits);
         GET_FUNC(GetDeviceCaps);
         GET_FUNC(GetDeviceGammaRamp);
diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c
index 8f0b932..db04f50 100644
--- a/dlls/gdi32/enhmfdrv/init.c
+++ b/dlls/gdi32/enhmfdrv/init.c
@@ -72,7 +72,6 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
     EMFDRV_GdiComment,               /* pGdiComment */
     NULL,                            /* pGetBitmapBits */
     NULL,                            /* pGetCharWidth */
-    NULL,                            /* pGetDIBColorTable */
     NULL,                            /* pGetDIBits */
     EMFDRV_GetDeviceCaps,            /* pGetDeviceCaps */
     NULL,                            /* pGetDeviceGammaRamp */
diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h
index 504b120..015660f 100644
--- a/dlls/gdi32/gdi_private.h
+++ b/dlls/gdi32/gdi_private.h
@@ -114,7 +114,6 @@ typedef struct tagDC_FUNCS
     BOOL     (CDECL *pGdiComment)(PHYSDEV,UINT,CONST BYTE*);
     LONG     (CDECL *pGetBitmapBits)(HBITMAP,void*,LONG);
     BOOL     (CDECL *pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT);
-    UINT     (CDECL *pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*);
     INT      (CDECL *pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPVOID,BITMAPINFO*,UINT);
     INT      (CDECL *pGetDeviceCaps)(PHYSDEV,INT);
     BOOL     (CDECL *pGetDeviceGammaRamp)(PHYSDEV,LPVOID);
diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c
index 553c363..436d8ec 100644
--- a/dlls/gdi32/mfdrv/init.c
+++ b/dlls/gdi32/mfdrv/init.c
@@ -70,7 +70,6 @@ static const DC_FUNCTIONS MFDRV_Funcs =
     NULL,                            /* pGdiComment */
     NULL,                            /* pGetBitmapBits */
     NULL,                            /* pGetCharWidth */
-    NULL,                            /* pGetDIBColorTable */
     NULL,                            /* pGetDIBits */
     MFDRV_GetDeviceCaps,             /* pGetDeviceCaps */
     NULL,                            /* pGetDeviceGammaRamp */




More information about the wine-cvs mailing list