Add patch that contain Mali fixes.
[deb_xorg-server.git] / render / glyphstr.h
1 /*
2 *
3 * Copyright © 2000 SuSE, Inc.
4 *
5 * Permission to use, copy, modify, distribute, and sell this software and its
6 * documentation for any purpose is hereby granted without fee, provided that
7 * the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of SuSE not be used in advertising or
10 * publicity pertaining to distribution of the software without specific,
11 * written prior permission. SuSE makes no representations about the
12 * suitability of this software for any purpose. It is provided "as is"
13 * without express or implied warranty.
14 *
15 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
17 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 *
22 * Author: Keith Packard, SuSE, Inc.
23 */
24
25 #ifndef _GLYPHSTR_H_
26 #define _GLYPHSTR_H_
27
28 #include <X11/extensions/renderproto.h>
29 #include "picture.h"
30 #include "screenint.h"
31 #include "regionstr.h"
32 #include "miscstruct.h"
33 #include "privates.h"
34
35 #define GlyphFormat1 0
36 #define GlyphFormat4 1
37 #define GlyphFormat8 2
38 #define GlyphFormat16 3
39 #define GlyphFormat32 4
40 #define GlyphFormatNum 5
41
42 typedef struct _Glyph {
43 CARD32 refcnt;
44 PrivateRec *devPrivates;
45 unsigned char sha1[20];
46 CARD32 size; /* info + bitmap */
47 xGlyphInfo info;
48 /* per-screen pixmaps follow */
49 } GlyphRec, *GlyphPtr;
50
51 #define GlyphPicture(glyph) ((PicturePtr *) ((glyph) + 1))
52
53 typedef struct _GlyphRef {
54 CARD32 signature;
55 GlyphPtr glyph;
56 } GlyphRefRec, *GlyphRefPtr;
57
58 #define DeletedGlyph ((GlyphPtr) 1)
59
60 typedef struct _GlyphHashSet {
61 CARD32 entries;
62 CARD32 size;
63 CARD32 rehash;
64 } GlyphHashSetRec, *GlyphHashSetPtr;
65
66 typedef struct _GlyphHash {
67 GlyphRefPtr table;
68 GlyphHashSetPtr hashSet;
69 CARD32 tableEntries;
70 } GlyphHashRec, *GlyphHashPtr;
71
72 typedef struct _GlyphSet {
73 CARD32 refcnt;
74 int fdepth;
75 PictFormatPtr format;
76 GlyphHashRec hash;
77 PrivateRec *devPrivates;
78 } GlyphSetRec, *GlyphSetPtr;
79
80 #define GlyphSetGetPrivate(pGlyphSet,k) \
81 dixLookupPrivate(&(pGlyphSet)->devPrivates, k)
82
83 #define GlyphSetSetPrivate(pGlyphSet,k,ptr) \
84 dixSetPrivate(&(pGlyphSet)->devPrivates, k, ptr)
85
86 typedef struct _GlyphList {
87 INT16 xOff;
88 INT16 yOff;
89 CARD8 len;
90 PictFormatPtr format;
91 } GlyphListRec, *GlyphListPtr;
92
93 extern _X_EXPORT void
94 GlyphUninit(ScreenPtr pScreen);
95
96 extern _X_EXPORT GlyphHashSetPtr FindGlyphHashSet(CARD32 filled);
97
98 extern _X_EXPORT GlyphRefPtr
99 FindGlyphRef(GlyphHashPtr hash,
100 CARD32 signature, Bool match, unsigned char sha1[20]);
101
102 extern _X_EXPORT GlyphPtr FindGlyphByHash(unsigned char sha1[20], int format);
103
104 extern _X_EXPORT int
105
106 HashGlyph(xGlyphInfo * gi,
107 CARD8 *bits, unsigned long size, unsigned char sha1[20]);
108
109 extern _X_EXPORT void
110 FreeGlyph(GlyphPtr glyph, int format);
111
112 extern _X_EXPORT void
113 AddGlyph(GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id);
114
115 extern _X_EXPORT Bool
116 DeleteGlyph(GlyphSetPtr glyphSet, Glyph id);
117
118 extern _X_EXPORT GlyphPtr FindGlyph(GlyphSetPtr glyphSet, Glyph id);
119
120 extern _X_EXPORT GlyphPtr AllocateGlyph(xGlyphInfo * gi, int format);
121
122 extern _X_EXPORT Bool
123 AllocateGlyphHash(GlyphHashPtr hash, GlyphHashSetPtr hashSet);
124
125 extern _X_EXPORT Bool
126 ResizeGlyphHash(GlyphHashPtr hash, CARD32 change, Bool global);
127
128 extern _X_EXPORT Bool
129 ResizeGlyphSet(GlyphSetPtr glyphSet, CARD32 change);
130
131 extern _X_EXPORT GlyphSetPtr AllocateGlyphSet(int fdepth, PictFormatPtr format);
132
133 extern _X_EXPORT int
134 FreeGlyphSet(pointer value, XID gid);
135
136 #define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 1 /* used for api compat */
137 extern _X_EXPORT PicturePtr
138 GetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen);
139 extern _X_EXPORT void
140 SetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen, PicturePtr picture);
141
142 #endif /* _GLYPHSTR_H_ */