/* * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ xgcv.fill_style = FillStippled; xgcv.stipple = thePixmap; xgcv.ts_x_origin = bounds->x1; xgcv.ts_y_origin = bounds->y1; XChangeGC(awt_display, xgc, GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin, &xgcv); cy1 = bounds->y1; while (cy1 < bounds->y2) { cy2 = cy1 + TEXT_BM_HEIGHT; if (cy2 > bounds->y2) cy2 = bounds->y2; cx1 = bounds->x1; while (cx1 < bounds->x2) { cx2 = cx1 + TEXT_BM_WIDTH; if (cx2 > bounds->x2) cx2 = bounds->x2; FillBitmap(theImage, glyphs, totalGlyphs, cx1, cy1, cx2, cy2); // NOTE: Since we are tiling around by BM_W, BM_H offsets // and thePixmap is BM_W x BM_H, we do not have to move // the TSOrigin at each step since the stipple repeats // every BM_W, BM_H units XPutImage(awt_display, thePixmap, theGC, theImage, 0, 0, 0, 0, cx2 - cx1, cy2 - cy1); /* MGA on Linux doesn't pick up the new stipple image data, * probably because it caches the image as a hardware pixmap * and doesn't update it when the pixmap image data is changed. * So if the loop is executed more than once, update the GC * which triggers the required behaviour. This extra XChangeGC * call only happens on large or rotated text so isn't a * significant new overhead.. * This code needs to execute on a Solaris client too, in case * we are remote displaying to a MGA. */ if (cy1 != bounds->y1 || cx1 != bounds->x1) { XChangeGC(awt_display, xgc, GCStipple, &xgcv); } XFillRectangle(awt_display, xsdo->drawable, xgc, cx1, cy1, cx2 - cx1, cy2 - cy1); cx1 = cx2; } cy1 = cy2; } XSetFillStyle(awt_display, xgc, FillSolid);