diff src/w32fns.c @ 27407:7df920562cbe

(w32_defined_color): Apply gamma correction before trying to map to the palette. (w32_wnd_proc) [WM_ERASE_BACKGROUND]: Pass device context of frame to w32_clear_rect.
author Jason Rumney <jasonr@gnu.org>
date Sun, 23 Jan 2000 22:18:38 +0000
parents d98e84b468a2
children 8001542eaee2
line wrap: on
line diff
--- a/src/w32fns.c	Sun Jan 23 22:15:12 2000 +0000
+++ b/src/w32fns.c	Sun Jan 23 22:18:38 2000 +0000
@@ -1781,6 +1781,12 @@
 
   if (!NILP (tem)) 
     {
+      /* Apply gamma correction.  */
+      w32_color_ref = XUINT (tem);
+      gamma_correct (f, &w32_color_ref);
+      XSETINT (tem, w32_color_ref);
+
+      /* Map this color to the palette if it is enabled. */
       if (!NILP (Vw32_enable_palette))
 	{
 	  struct w32_palette_entry * entry =
@@ -1816,12 +1822,6 @@
 	 or not the display device has a palette. */
       w32_color_ref = XUINT (tem) | 0x2000000;
 
-      /* NTEMACS_TODO: Palette mapping should come after gamma
-         correction. */
-      /* Apply gamma correction.  */
-      if (f)
-        gamma_correct (f, &w32_color_ref);
-
       color_def->pixel = w32_color_ref;
       color_def->red = GetRValue (w32_color_ref);
       color_def->green = GetGValue (w32_color_ref);
@@ -3881,8 +3881,10 @@
       f = x_window_to_frame (dpyinfo, hwnd);
       if (f)
 	{
+          HDC hdc = get_frame_dc (f);
 	  GetUpdateRect (hwnd, &wmsg.rect, FALSE);
-	  w32_clear_rect (f, NULL, &wmsg.rect);
+	  w32_clear_rect (f, hdc, &wmsg.rect);
+          release_frame_dc (f, hdc);
 
 #if defined (W32_DEBUG_DISPLAY)
           DebPrint (("WM_ERASEBKGND: erasing %d,%d-%d,%d\n",