Alexandre Julliard : gdi32: Don' t implement the gamma ramp functions in the DIB driver.

Alexandre Julliard julliard at winehq.org
Thu May 31 13:30:41 CDT 2012


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu May 31 13:44:32 2012 +0200

gdi32: Don't implement the gamma ramp functions in the DIB driver.

---

 dlls/gdi32/dc.c        |   16 ++++++++++++----
 dlls/gdi32/dibdrv/dc.c |   22 ++--------------------
 2 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index 3caa120..e128e53 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -1245,8 +1245,12 @@ BOOL WINAPI GetDeviceGammaRamp(HDC hDC, LPVOID ptr)
     TRACE("%p, %p\n", hDC, ptr);
     if( dc )
     {
-        PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetDeviceGammaRamp );
-        ret = physdev->funcs->pGetDeviceGammaRamp( physdev, ptr );
+        if (GetObjectType( hDC ) != OBJ_MEMDC)
+        {
+            PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetDeviceGammaRamp );
+            ret = physdev->funcs->pGetDeviceGammaRamp( physdev, ptr );
+        }
+        else SetLastError( ERROR_INVALID_PARAMETER );
 	release_dc_ptr( dc );
     }
     return ret;
@@ -1263,8 +1267,12 @@ BOOL WINAPI SetDeviceGammaRamp(HDC hDC, LPVOID ptr)
     TRACE("%p, %p\n", hDC, ptr);
     if( dc )
     {
-        PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetDeviceGammaRamp );
-        ret = physdev->funcs->pSetDeviceGammaRamp( physdev, ptr );
+        if (GetObjectType( hDC ) != OBJ_MEMDC)
+        {
+            PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetDeviceGammaRamp );
+            ret = physdev->funcs->pSetDeviceGammaRamp( physdev, ptr );
+        }
+        else SetLastError( ERROR_INVALID_PARAMETER );
 	release_dc_ptr( dc );
     }
     return ret;
diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c
index 5c59041..798a9cd 100644
--- a/dlls/gdi32/dibdrv/dc.c
+++ b/dlls/gdi32/dibdrv/dc.c
@@ -392,24 +392,6 @@ static UINT dibdrv_SetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
     return DCB_RESET;  /* we don't have device-specific bounds */
 }
 
-/***********************************************************************
- *           dibdrv_GetDeviceGammaRamp
- */
-static BOOL dibdrv_GetDeviceGammaRamp( PHYSDEV dev, void *ramp )
-{
-    SetLastError( ERROR_INVALID_PARAMETER );
-    return FALSE;
-}
-
-/***********************************************************************
- *           dibdrv_SetDeviceGammaRamp
- */
-static BOOL dibdrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp )
-{
-    SetLastError( ERROR_INVALID_PARAMETER );
-    return FALSE;
-}
-
 const struct gdi_dc_funcs dib_driver =
 {
     NULL,                               /* pAbortDoc */
@@ -453,7 +435,7 @@ const struct gdi_dc_funcs dib_driver =
     NULL,                               /* pGetCharABCWidthsI */
     NULL,                               /* pGetCharWidth */
     NULL,                               /* pGetDeviceCaps */
-    dibdrv_GetDeviceGammaRamp,          /* pGetDeviceGammaRamp */
+    NULL,                               /* pGetDeviceGammaRamp */
     NULL,                               /* pGetFontData */
     NULL,                               /* pGetFontUnicodeRanges */
     NULL,                               /* pGetGlyphIndices */
@@ -515,7 +497,7 @@ const struct gdi_dc_funcs dib_driver =
     dibdrv_SetDCPenColor,               /* pSetDCPenColor */
     NULL,                               /* pSetDIBitsToDevice */
     dibdrv_SetDeviceClipping,           /* pSetDeviceClipping */
-    dibdrv_SetDeviceGammaRamp,          /* pSetDeviceGammaRamp */
+    NULL,                               /* pSetDeviceGammaRamp */
     NULL,                               /* pSetLayout */
     NULL,                               /* pSetMapMode */
     NULL,                               /* pSetMapperFlags */




More information about the wine-cvs mailing list