2017-11-18 13:30:57 +00:00
|
|
|
#ifndef __GSK_GL_GLYPH_CACHE_PRIVATE_H__
|
|
|
|
#define __GSK_GL_GLYPH_CACHE_PRIVATE_H__
|
|
|
|
|
|
|
|
#include "gskgldriverprivate.h"
|
|
|
|
#include "gskglimageprivate.h"
|
2019-05-22 05:33:45 +00:00
|
|
|
#include "gskgltextureatlasprivate.h"
|
2017-11-18 13:30:57 +00:00
|
|
|
#include <pango/pango.h>
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2019-06-04 21:27:09 +00:00
|
|
|
int ref_count;
|
|
|
|
|
|
|
|
GdkDisplay *display;
|
2017-11-18 13:30:57 +00:00
|
|
|
GHashTable *hash_table;
|
2019-06-04 21:27:09 +00:00
|
|
|
GskGLTextureAtlases *atlases;
|
2017-11-18 13:30:57 +00:00
|
|
|
|
|
|
|
guint64 timestamp;
|
|
|
|
} GskGLGlyphCache;
|
|
|
|
|
2019-01-06 14:35:54 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
PangoFont *font;
|
|
|
|
PangoGlyph glyph;
|
2019-07-28 14:06:47 +00:00
|
|
|
guint xshift;
|
|
|
|
guint yshift;
|
2019-01-06 14:35:54 +00:00
|
|
|
guint scale; /* times 1024 */
|
|
|
|
} GlyphCacheKey;
|
|
|
|
|
|
|
|
typedef struct _GskGLCachedGlyph GskGLCachedGlyph;
|
|
|
|
|
|
|
|
struct _GskGLCachedGlyph
|
2017-11-18 13:30:57 +00:00
|
|
|
{
|
2019-05-22 05:33:45 +00:00
|
|
|
GskGLTextureAtlas *atlas;
|
2019-06-04 21:27:09 +00:00
|
|
|
guint texture_id;
|
2017-11-18 13:30:57 +00:00
|
|
|
|
|
|
|
float tx;
|
|
|
|
float ty;
|
|
|
|
float tw;
|
|
|
|
float th;
|
|
|
|
|
|
|
|
int draw_x;
|
|
|
|
int draw_y;
|
|
|
|
int draw_width;
|
|
|
|
int draw_height;
|
|
|
|
|
2019-05-22 05:33:45 +00:00
|
|
|
guint used: 1;
|
2019-10-10 19:12:34 +00:00
|
|
|
guint64 timestamp;
|
2019-01-06 14:35:54 +00:00
|
|
|
};
|
|
|
|
|
2017-11-18 13:30:57 +00:00
|
|
|
|
2019-06-04 21:27:09 +00:00
|
|
|
GskGLGlyphCache * gsk_gl_glyph_cache_new (GdkDisplay *display,
|
|
|
|
GskGLTextureAtlases *atlases);
|
|
|
|
GskGLGlyphCache * gsk_gl_glyph_cache_ref (GskGLGlyphCache *self);
|
|
|
|
void gsk_gl_glyph_cache_unref (GskGLGlyphCache *self);
|
|
|
|
void gsk_gl_glyph_cache_begin_frame (GskGLGlyphCache *self);
|
|
|
|
gboolean gsk_gl_glyph_cache_lookup (GskGLGlyphCache *self,
|
2017-11-18 13:30:57 +00:00
|
|
|
PangoFont *font,
|
|
|
|
PangoGlyph glyph,
|
2019-07-31 02:21:52 +00:00
|
|
|
float x,
|
|
|
|
float y,
|
2019-06-04 21:27:09 +00:00
|
|
|
float scale,
|
2019-07-28 09:57:43 +00:00
|
|
|
GskGLDriver *driver,
|
2019-10-09 21:27:48 +00:00
|
|
|
const GskGLCachedGlyph **cached_glyph_out);
|
2017-11-18 13:30:57 +00:00
|
|
|
|
|
|
|
#endif
|