]> git.eshelyaron.com Git - emacs.git/commitdiff
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Thu, 16 Mar 2006 08:06:16 +0000 (08:06 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Thu, 16 Mar 2006 08:06:16 +0000 (08:06 +0000)
Create GWorld in ARGB pixel format.
(mac_copy_area, mac_copy_area_with_mask) [USE_CG_DRAWING]: Remove
functions.
(x_draw_image_foreground) [USE_CG_DRAWING]: Use mac_draw_cg_image
instead of mac_copy_area/mac_copy_area_with_mask.

src/ChangeLog
src/macterm.c

index b53b7937d86226fc86f11760092268a4e28f1046..9950dc20e5059fbde43bcfc955f778454e4270a8 100644 (file)
@@ -1,3 +1,20 @@
+2006-03-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * image.c [MAC_OS] (XPutPixel, XGetPixel)
+       [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]: Don't use specialized
+       version when depth is 32.
+       (mac_create_cg_image_from_image) [MAC_OS && USE_CG_DRAWING]: New
+       function.
+       (prepare_image_for_display) [MAC_OS && USE_CG_DRAWING]: Use it.
+       (x_clear_image_1) [MAC_OS && USE_CG_DRAWING]: Release CGImage.
+
+       * macterm.c (XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
+       Create GWorld in ARGB pixel format.
+       (mac_copy_area, mac_copy_area_with_mask) [USE_CG_DRAWING]: Remove
+       functions.
+       (x_draw_image_foreground) [USE_CG_DRAWING]: Use mac_draw_cg_image
+       instead of mac_copy_area/mac_copy_area_with_mask.
+
 2006-03-15  Kim F. Storm  <storm@cua.dk>
 
        * xdisp.c (extend_face_to_end_of_line): Always add space glyph to
index 6bb50bef6ca75318a1b288bce7fcb10e9a853454..b78c01e129e1efa01409a9d5b9f233de3b031fcb 100644 (file)
@@ -653,7 +653,15 @@ XCreatePixmap (display, w, width, height, depth)
   SetPortWindowPort (w);
 
   SetRect (&r, 0, 0, width, height);
-  err = NewGWorld (&pixmap, depth, &r, NULL, NULL, 0);
+#if !defined (WORDS_BIG_ENDIAN) && USE_CG_DRAWING
+  if (depth == 1)
+#endif
+    err = NewGWorld (&pixmap, depth, &r, NULL, NULL, 0);
+#if !defined (WORDS_BIG_ENDIAN) && USE_CG_DRAWING
+  else
+    /* CreateCGImageFromPixMaps requires ARGB format.  */
+    err = QTNewGWorld (&pixmap, k32ARGBPixelFormat, &r, NULL, NULL, 0);
+#endif
   if (err != noErr)
     return NULL;
   return pixmap;
@@ -1336,6 +1344,7 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width)
 #endif
 
 
+#if !USE_CG_DRAWING
 /* Mac replacement for XCopyArea: dest must be window.  */
 
 static void
@@ -1349,9 +1358,6 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y)
 {
   Rect src_r, dest_r;
 
-#if USE_CG_DRAWING
-  mac_prepare_for_quickdraw (f);
-#endif
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
@@ -1396,9 +1402,6 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y,
 {
   Rect src_r, dest_r;
 
-#if USE_CG_DRAWING
-  mac_prepare_for_quickdraw (f);
-#endif
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
@@ -1431,6 +1434,7 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y,
 
   RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
 }
+#endif /* !USE_CG_DRAWING */
 
 
 /* Mac replacement for XCopyArea: used only for scrolling.  */
@@ -3285,15 +3289,26 @@ x_draw_image_foreground (s)
     {
       x_set_glyph_string_clipping (s);
 
+#if USE_CG_DRAWING
+      mac_draw_cg_image (s->img->data.ptr_val,
+                        s->f, s->gc, s->slice.x, s->slice.y,
+                        s->slice.width, s->slice.height, x, y, 1);
+#endif
       if (s->img->mask)
+#if !USE_CG_DRAWING
        mac_copy_area_with_mask (s->img->pixmap, s->img->mask,
                                 s->f, s->gc, s->slice.x, s->slice.y,
                                 s->slice.width, s->slice.height, x, y);
+#else
+       ;
+#endif
       else
        {
+#if !USE_CG_DRAWING
          mac_copy_area (s->img->pixmap,
                         s->f, s->gc, s->slice.x, s->slice.y,
                         s->slice.width, s->slice.height, x, y);
+#endif
 
          /* When the image has a mask, we can expect that at
             least part of a mouse highlight or a block cursor will