&gcv, fe_drawable->clip_region);
&gcv, (Region)fe_drawable->clip_region);
displayImage(MWContext * context, IL_Pixmap * image,                         IL_Pixmap * mask, long int x, long int y,                        jint x_offset, jint y_offset, jint width, jint height){    int32 img_x_offset, img_y_offset;   /* Offset of image in drawable. */    int32 rect_x_offset, rect_y_offset; /* Offset of update rect in                                           drawable. */    NI_PixmapHeader *img_header = &image->header;    uint32 img_width = img_header->width;     /* Image width. */    uint32 img_height = img_header->height;   /* Image height. */    Widget widget = CONTEXT_WIDGET(context);    fe_Drawable *fe_drawable = CONTEXT_DATA(context)->drawable;    Drawable drawable = fe_drawable->xdrawable;    Display *dpy = XtDisplay(widget);    Pixmap img_x_pixmap, mask_x_pixmap;    fe_PixmapClientData *img_client_data, *mask_client_data;    GC gc;    XGCValues gcv;    unsigned long flags;    XP_Bool tiling_required = FALSE;        /* Check for zero display area. */    if (width == 0 || height == 0)        return;    /* Retrieve the server pixmaps. */    img_client_data = (fe_PixmapClientData *)image->client_data;    if (!img_client_data)        return;    img_x_pixmap = img_client_data->pixmap;    if (!img_x_pixmap)        return;    if (mask) {        mask_client_data = (fe_PixmapClientData *)mask->client_data;        mask_x_pixmap = mask_client_data->pixmap;    }    /* Determine whether tiling is required. */    if ((x_offset + width > img_width) || (y_offset + height > img_height))        tiling_required = TRUE;    /* Compute the offset into the drawable of the image origin. */    img_x_offset = x - CONTEXT_DATA(context)->document_x +        fe_drawable->x_origin;    img_y_offset = y - CONTEXT_DATA(context)->document_y +        fe_drawable->y_origin;    /* Compute the offset into the drawable for the area to be drawn. */    rect_x_offset = img_x_offset + x_offset;    rect_y_offset = img_y_offset + y_offset;    /* Do the actual drawing.  There are several cases to be dealt with:       transparent vs non-transparent, tiled vs non-tiled and clipped by       compositor's clip region vs not clipped. */    memset(&gcv, ~0, sizeof (XGCValues));    if (mask) {                 /* Image is transparent. */        if (tiling_required) {            /* Offsets are measured wrt the origin of the tiled mask to               be generated. */            int x_tile_offset = img_x_offset - rect_x_offset;            int y_tile_offset = img_y_offset - rect_y_offset;            Pixmap tmp_pixmap = 0;            /* Create the mask by tiling the mask_x_pixmap and computing               the intersection with the compositor's clip region. */            tmp_pixmap =                fe_TiledMaskWithClipRegion(dpy, drawable, mask_x_pixmap,                                           width, height, x_tile_offset,                                           y_tile_offset, -rect_x_offset,                                           -rect_y_offset,                                           fe_drawable->clip_region);                        /* Create the GC.  Don't attempt to get a GC from the GC cache               because we are using a temporary mask pixmap. */            gcv.fill_style = FillTiled;            gcv.tile = img_x_pixmap;            gcv.ts_x_origin = img_x_offset;            gcv.ts_y_origin = img_y_offset;            gcv.clip_mask = tmp_pixmap;            gcv.clip_x_origin = rect_x_offset;            gcv.clip_y_origin = rect_y_offset;            flags = GCFillStyle | GCTile | GCTileStipXOrigin |                GCTileStipYOrigin | GCClipMask | GCClipXOrigin | GCClipYOrigin;            gc = XCreateGC(dpy, drawable, flags, &gcv);            /* Draw the image (transparent and tiled.) */            XFillRectangle (dpy, drawable, gc, rect_x_offset, rect_y_offset,                            width, height);            /* Clean up. */            XFreeGC(dpy, gc);            XFreePixmap(dpy, tmp_pixmap);        }        else {                  /* Tiling not required. */            if (fe_drawable->clip_region) {                                /* Draw the image (transparent, non-tiled and with                   clip_region.)  x_offset and y_offset are wrt the image                   origin, while rect_x_offset and rect_y_offset are wrt the                   drawable origin. */                fe_DrawMaskedImageWithClipRegion(dpy, drawable, img_x_pixmap,                                                 mask_x_pixmap, width, height,                                                 img_x_offset, img_y_offset,                                                 x_offset, y_offset,                                                 fe_drawable->clip_region);            }            else {              /* No clip region. */                /* XXX transparent, non-tiled and no clip_region. */            }        }    }    else {                      /* Image is not transparent. */        if (tiling_required) {            /* Get the GC from the GC cache.  If the compositor has given us               a clip region, then the GC must have a matching clip mask. */            gcv.fill_style = FillTiled;            gcv.tile = img_x_pixmap;            gcv.ts_x_origin = img_x_offset;            gcv.ts_y_origin = img_y_offset;            flags = GCFillStyle | GCTile | GCTileStipXOrigin |                GCTileStipYOrigin;            if (fe_drawable->clip_region)                gc = fe_GetGCfromDW(dpy, drawable, flags, &gcv,                                    fe_drawable->clip_region);            else                gc = fe_GetGCfromDW(dpy, drawable, flags, &gcv, NULL);            /* Draw the image (opaque and tiled.) */            XFillRectangle (dpy, drawable, gc, rect_x_offset, rect_y_offset,                            width, height);          }        else {                  /* Tiling not required. */            /* Get the GC from the GC cache.  If the compositor has given us               a clip region, then the GC must have a matching clip mask. */            gcv.function = GXcopy;            if (fe_drawable->clip_region)                gc = fe_GetGCfromDW(dpy, drawable, GCFunction,                                    &gcv, fe_drawable->clip_region);            else                gc = fe_GetGCfromDW(dpy, drawable, GCFunction, &gcv, NULL);             /* Draw the image (opaque and non-tiled.) */            XCopyArea (dpy, img_x_pixmap, drawable, gc, x_offset,                       y_offset, width, height, rect_x_offset, rect_y_offset);        }    }}  /* displayImage */