emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More enhancements to fringe bitmaps.


From: YAMAMOTO Mitsuharu
Subject: Re: More enhancements to fringe bitmaps.
Date: Wed, 11 Feb 2004 20:28:17 +0900
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On 11 Feb 2004 12:17:24 +0100, address@hidden (Kim F. Storm) said:

> Which probably makes it hard for me to reproduce -- but I'll look into it.
> Is TARGET_API_MAC_CARBON defined in the setup that fails?

Yes.  This variable is defined in Carbon/Carbon.h.  Maybe I will look
some redisplay-related variables/structures with a debugger to see
what's happening.

> So the following #ifdef (in fringe.c) shouldn't mention MAC_OS then?

Exactly.  But then the image support patches have to be modified so
as to disable bit-swapping in them.

> I do see an explicit 8->16 bit conversion for W32, but not on the
> mac port.  Do you mean this call?

>     mac_create_bitmap_from_bitmap_data (&bitmap, bits, p->wd, p->h);

Yes.  And this is the very function that does bit-swapping in the
image support patches.  It is also used for converting from xbm data
(LSB first, each row is byte aligned) to mac-native bitmap data (MSB
first, each row is word aligned).

> Supposing that fb->bits was word aligned and 16 bits per row, what
> would the code for drawing the bitmap look like then?

Just like the following: Functions mac_create_bitmap_from_bitmap_data
and mac_free_bitmap are no longer used for drawing fringe bitmaps.
The function mac_draw_bitmap additionally takes width and height 
as arguments.

static void
mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p)
     Display *display;
     WindowPtr w;
     GC gc;
     int x, y, width, height;
     unsigned char *bits;
     int overlay_p;
{
  BitMap bitmap;
  Rect r;

  bitmap.rowBytes = (width + 15) / 16 * 2;  /* must be on word boundary */
  bitmap.baseAddr = bits;
  SetRect (&(bitmap.bounds), 0, 0, width, height);

  ... /* same as the original one, but change "bitmap" to "&bitmap"
         (and "bitmap-><fieldname>" to "bitmap.<fieldname>") */
}


static void
x_draw_fringe_bitmap (w, row, p)
...
{
...
  if (p->which)
    {
      unsigned char *bits = p->bits + p->dh;

      gcv.foreground = (p->cursor_p
                        ? (p->overlay_p ? face->background
                           : f->output_data.mac->cursor_pixel)
                        : face->foreground);
      gcv.background = face->background;

      mac_draw_bitmap (display, window, &gcv, p->x, p->y, p->wd, p->h, bits,
                       p->overlay_p);
    }
...
}

                                     YAMAMOTO Mitsuharu
                                address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]