1 /*
2 * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
205
206 JNIEXPORT void JNICALL
207 AWTDrawGlyphList(JNIEnv *env, jobject xtr,
208 jlong dstData, jlong gc,
209 SurfaceDataBounds *bounds, ImageRef *glyphs, jint totalGlyphs)
210 {
211 #ifndef HEADLESS
212 GC xgc, theGC;
213 XImage *theImage;
214 Pixmap thePixmap;
215 XGCValues xgcv;
216 int scan, screen;
217 AwtGraphicsConfigDataPtr cData;
218 X11SDOps *xsdo = (X11SDOps *)jlong_to_ptr(dstData);
219 jint cx1, cy1, cx2, cy2;
220
221 if (xsdo == NULL) {
222 return;
223 }
224
225 xgc = (GC)gc;
226 if (xgc == NULL) {
227 return;
228 }
229
230 screen = xsdo->configData->awt_visInfo.screen;
231 cData = getDefaultConfig(screen);
232 if (!checkPixmap(env, cData)) {
233 return;
234 }
235 theImage = cData->monoImage;
236 thePixmap = cData->monoPixmap;
237 theGC = cData->monoPixmapGC;
238
239 scan = theImage->bytes_per_line;
240
241 xgcv.fill_style = FillStippled;
242 xgcv.stipple = thePixmap;
243 xgcv.ts_x_origin = bounds->x1;
244 xgcv.ts_y_origin = bounds->y1;
245 XChangeGC(awt_display, xgc,
|
1 /*
2 * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
205
206 JNIEXPORT void JNICALL
207 AWTDrawGlyphList(JNIEnv *env, jobject xtr,
208 jlong dstData, jlong gc,
209 SurfaceDataBounds *bounds, ImageRef *glyphs, jint totalGlyphs)
210 {
211 #ifndef HEADLESS
212 GC xgc, theGC;
213 XImage *theImage;
214 Pixmap thePixmap;
215 XGCValues xgcv;
216 int scan, screen;
217 AwtGraphicsConfigDataPtr cData;
218 X11SDOps *xsdo = (X11SDOps *)jlong_to_ptr(dstData);
219 jint cx1, cy1, cx2, cy2;
220
221 if (xsdo == NULL) {
222 return;
223 }
224
225 xgc = (GC) jlong_to_ptr(gc);
226 if (xgc == NULL) {
227 return;
228 }
229
230 screen = xsdo->configData->awt_visInfo.screen;
231 cData = getDefaultConfig(screen);
232 if (!checkPixmap(env, cData)) {
233 return;
234 }
235 theImage = cData->monoImage;
236 thePixmap = cData->monoPixmap;
237 theGC = cData->monoPixmapGC;
238
239 scan = theImage->bytes_per_line;
240
241 xgcv.fill_style = FillStippled;
242 xgcv.stipple = thePixmap;
243 xgcv.ts_x_origin = bounds->x1;
244 xgcv.ts_y_origin = bounds->y1;
245 XChangeGC(awt_display, xgc,
|