Lines Matching refs:stream
37 /* implementation of the opaque stream */
44 /* dynamically allocated stream */
47 uint32_t *stream;
51 #define CURRENT_LEN(s) (((char *)s->current - (char *)s->stream))
59 xcb_render_util_composite_text_stream_t *stream;
68 stream = malloc(sizeof(xcb_render_util_composite_text_stream_t));
70 stream->glyph_size = 0;
71 stream->initial_glyphset = initial_glyphset;
72 stream->current_glyphset = initial_glyphset;
74 stream->stream_len = size;
75 stream->stream = malloc(size);
76 stream->current = stream->stream;
78 return stream;
82 _grow_stream( xcb_render_util_composite_text_stream_t *stream, size_t increase )
84 size_t current_len = CURRENT_LEN(stream);
85 if (current_len + increase > stream->stream_len) {
86 uint32_t *s = realloc(stream->stream, 2 * stream->stream_len);
88 stream->stream_len *= 2;
89 stream->stream = s;
90 stream->current = stream->stream + (current_len>>2);
97 xcb_render_util_composite_text_stream_t *stream,
107 if (stream->glyph_size != sizeof(*glyphs)) {
108 if (stream->glyph_size != 0)
110 stream->glyph_size = sizeof(*glyphs);
112 _grow_stream(stream, sizeof(header) + count+3);
114 memcpy(stream->current, &header, sizeof(header));
115 stream->current += 2;
117 memcpy(stream->current, glyphs, header.count);
118 stream->current += ((int)header.count+3)>>2;
123 xcb_render_util_composite_text_stream_t *stream,
133 if (stream->glyph_size != sizeof(*glyphs)) {
134 if (stream->glyph_size != 0)
136 stream->glyph_size = sizeof(*glyphs);
138 _grow_stream(stream, sizeof(header) + count*sizeof(*glyphs)+1);
140 memcpy(stream->current, &header, sizeof(header));
141 stream->current += 2;
143 memcpy(stream->current, glyphs, header.count*sizeof(*glyphs));
144 stream->current += ((int)header.count*sizeof(*glyphs)+3)>>2;
149 xcb_render_util_composite_text_stream_t *stream,
159 if (stream->glyph_size != sizeof(*glyphs)) {
160 if (stream->glyph_size != 0)
162 stream->glyph_size = sizeof(*glyphs);
164 _grow_stream(stream, sizeof(header) + count*sizeof(*glyphs)+1);
166 memcpy(stream->current, &header, sizeof(header));
167 stream->current += 2;
169 memcpy(stream->current, glyphs, header.count*sizeof(*glyphs));
170 stream->current += header.count;
177 xcb_render_util_composite_text_stream_t *stream,
182 if (glyphset == stream->current_glyphset)
185 _grow_stream(stream, 3*sizeof(uint32_t));
187 memcpy(stream->current, &header, sizeof(header));
188 stream->current += 2;
190 *stream->current = glyphset;
191 stream->current++;
193 stream->current_glyphset = glyphset;
218 xcb_render_util_composite_text_stream_t *stream )
222 switch (stream->glyph_size)
238 stream->initial_glyphset,
240 CURRENT_LEN(stream),
241 (uint8_t *)stream->stream
254 xcb_render_util_composite_text_stream_t *stream )
258 switch (stream->glyph_size)
274 stream->initial_glyphset,
276 CURRENT_LEN(stream),
277 (uint8_t *)stream->stream
283 xcb_render_util_composite_text_stream_t *stream )
285 free(stream->stream);
286 free(stream);