Path: blob/master/src/java.desktop/share/native/common/font/AccelGlyphCache.h
41153 views
/*1* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef AccelGlyphCache_h_Included26#define AccelGlyphCache_h_Included2728#ifdef __cplusplus29extern "C" {30#endif3132#include "jni.h"33#include "fontscalerdefs.h"3435typedef void (FlushFunc)();3637typedef struct _CacheCellInfo CacheCellInfo;3839typedef struct {40CacheCellInfo *head;41CacheCellInfo *tail;42unsigned int cacheID;43jint width;44jint height;45jint cellWidth;46jint cellHeight;47jboolean isFull;48FlushFunc *Flush;49} GlyphCacheInfo;5051struct _CacheCellInfo {52GlyphCacheInfo *cacheInfo;53struct GlyphInfo *glyphInfo;54// next cell info in the cache's list55CacheCellInfo *next;56// REMIND: find better name?57// next cell info in the glyph's cell list (next Glyph Cache Info)58CacheCellInfo *nextGCI;59jint timesRendered;60jint x;61jint y;62// number of pixels from the left or right edge not considered touched63// by the glyph64jint leftOff;65jint rightOff;66jfloat tx1;67jfloat ty1;68jfloat tx2;69jfloat ty2;70};7172GlyphCacheInfo *73AccelGlyphCache_Init(jint width, jint height,74jint cellWidth, jint cellHeight,75FlushFunc *func);76CacheCellInfo *77AccelGlyphCache_AddGlyph(GlyphCacheInfo *cache, struct GlyphInfo *glyph);78void79AccelGlyphCache_Invalidate(GlyphCacheInfo *cache);80void81AccelGlyphCache_AddCellInfo(struct GlyphInfo *glyph, CacheCellInfo *cellInfo);82void83AccelGlyphCache_RemoveCellInfo(struct GlyphInfo *glyph, CacheCellInfo *cellInfo);84CacheCellInfo *85AccelGlyphCache_GetCellInfoForCache(struct GlyphInfo *glyph,86GlyphCacheInfo *cache);87JNIEXPORT void88AccelGlyphCache_RemoveAllCellInfos(struct GlyphInfo *glyph);89void90AccelGlyphCache_Free(GlyphCacheInfo *cache);9192#ifdef __cplusplus93};94#endif9596#endif /* AccelGlyphCache_h_Included */979899