X11TextRenderer.c revision 0
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb/*
5e01956f3000408c2a2c5a08c8d0acf2c2a9d8eeGlenn Barry * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved.
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb *
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * This code is free software; you can redistribute it and/or modify it
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * under the terms of the GNU General Public License version 2 only, as
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * published by the Free Software Foundation. Sun designates this
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * particular file as subject to the "Classpath" exception as provided
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * by Sun in the LICENSE file that accompanied this code.
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb *
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * This code is distributed in the hope that it will be useful, but WITHOUT
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * version 2 for more details (a copy is included in the LICENSE file that
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * accompanied this code).
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb *
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * You should have received a copy of the GNU General Public License version
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * 2 along with this work; if not, write to the Free Software Foundation,
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb *
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * CA 95054 USA or visit www.sun.com if you need additional information or
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * have any questions.
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb */
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb/*
159d09a20817016f09b3ea28d1bdada4a336bb91Mark Phalan * Important note : All AWTxxx functions are defined in font.h.
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * These were added to remove the dependency of this file on X11.
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * These functions are used to perform X11 operations and should
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * be "stubbed out" in environments that do not support X11.
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * The implementation of these functions has been moved from this file
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * into X11TextRenderer_md.c, which is compiled into another library.
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb */
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb#include "sun_font_X11TextRenderer.h"
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb#include "Region.h"
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb#include "SurfaceData.h"
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb#include "GraphicsPrimitiveMgr.h"
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb#include "glyphblitting.h"
159d09a20817016f09b3ea28d1bdada4a336bb91Mark Phalan#include "sunfontids.h"
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb#include <malloc.h>
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtbJNIEXPORT void JNICALL AWTDrawGlyphList
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb(JNIEnv *env, jobject xtr,
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb jlong dstData, jlong gc,
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb SurfaceDataBounds *bounds, ImageRef *glyphs, jint totalGlyphs);
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb/*
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * Class: sun_font_X11TextRenderer
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * Method: doDrawGlyphList
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb * Signature: (Lsun/java2d/SurfaceData;Ljava/awt/Rectangle;ILsun/font/GlyphList;J)V
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb */
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtbJNIEXPORT void JNICALL Java_sun_font_X11TextRenderer_doDrawGlyphList
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb (JNIEnv *env, jobject xtr,
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb jlong dstData, jlong xgc, jobject clip,
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb jobject glyphlist)
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb{
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb GlyphBlitVector* gbv;
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb SurfaceDataBounds bounds;
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb Region_GetBounds(env, clip, &bounds);
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb if ((gbv = setupBlitVector(env, glyphlist)) == NULL) {
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb return;
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb }
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb if (!RefineBounds(gbv, &bounds)) {
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb free(gbv);
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb return;
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb }
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb AWTDrawGlyphList(env, xtr, dstData, xgc,
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb &bounds, gbv->glyphs, gbv->numGlyphs);
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb free(gbv);
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb}
ab9b2e153c3a9a2b1141fefa87925b1a9beb1236gtb