jdk/src/share/native/sun/font/AccelGlyphCache.h
author tdv
Tue, 22 Jul 2008 11:24:32 -0700
changeset 888 c7009cf0001f
parent 887 0aab8d3fa11a
child 5506 202f599c92aa
permissions -rw-r--r--
6728492: typo in copyrights in some files touched by the d3d pipeline port Reviewed-by: prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
888
c7009cf0001f 6728492: typo in copyrights in some files touched by the d3d pipeline port
tdv
parents: 887
diff changeset
     2
 * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#ifndef AccelGlyphCache_h_Included
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define AccelGlyphCache_h_Included
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    29
#ifdef __cplusplus
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    30
extern "C" {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    31
#endif
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    32
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#include "jni.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#include "fontscalerdefs.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
typedef void (FlushFunc)();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
typedef struct _CacheCellInfo CacheCellInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    CacheCellInfo *head;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    CacheCellInfo *tail;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    unsigned int  cacheID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    jint          width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    jint          height;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    jint          cellWidth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    jint          cellHeight;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    jboolean      isFull;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    FlushFunc     *Flush;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
} GlyphCacheInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
struct _CacheCellInfo {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    GlyphCacheInfo   *cacheInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    struct GlyphInfo *glyphInfo;
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    55
    // next cell info in the cache's list
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    CacheCellInfo    *next;
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    57
    // REMIND: find better name?
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    58
    // next cell info in the glyph's cell list (next Glyph Cache Info)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    59
    CacheCellInfo    *nextGCI;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    jint             timesRendered;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    jint             x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    jint             y;
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    63
    // number of pixels from the left or right edge not considered touched
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    64
    // by the glyph
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    65
    jint             leftOff;
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    66
    jint             rightOff;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    jfloat           tx1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    jfloat           ty1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    jfloat           tx2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    jfloat           ty2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
GlyphCacheInfo *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
AccelGlyphCache_Init(jint width, jint height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                     jint cellWidth, jint cellHeight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                     FlushFunc *func);
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    77
CacheCellInfo *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
AccelGlyphCache_AddGlyph(GlyphCacheInfo *cache, struct GlyphInfo *glyph);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
void
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
AccelGlyphCache_Invalidate(GlyphCacheInfo *cache);
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    81
void
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    82
AccelGlyphCache_AddCellInfo(struct GlyphInfo *glyph, CacheCellInfo *cellInfo);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    83
void
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    84
AccelGlyphCache_RemoveCellInfo(struct GlyphInfo *glyph, CacheCellInfo *cellInfo);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    85
CacheCellInfo *
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    86
AccelGlyphCache_GetCellInfoForCache(struct GlyphInfo *glyph,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    87
                                    GlyphCacheInfo *cache);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    88
JNIEXPORT void
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    89
AccelGlyphCache_RemoveAllCellInfos(struct GlyphInfo *glyph);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    90
void
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    91
AccelGlyphCache_Free(GlyphCacheInfo *cache);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    92
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    93
#ifdef __cplusplus
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    94
};
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    95
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
#endif /* AccelGlyphCache_h_Included */