mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-13 12:20:10 +00:00
b74bb90c7d
We want to reuse the code later.
73 lines
2.0 KiB
C
73 lines
2.0 KiB
C
#ifndef __GSK_GL_GLYPH_CACHE_PRIVATE_H__
|
|
#define __GSK_GL_GLYPH_CACHE_PRIVATE_H__
|
|
|
|
#include "gskgldriverprivate.h"
|
|
#include "gskglimageprivate.h"
|
|
#include "gskrendererprivate.h"
|
|
#include "gskgltextureatlasprivate.h"
|
|
#include <pango/pango.h>
|
|
#include <gdk/gdk.h>
|
|
|
|
typedef struct
|
|
{
|
|
GskGLDriver *gl_driver;
|
|
GskRenderer *renderer;
|
|
|
|
GHashTable *hash_table;
|
|
GPtrArray *atlases;
|
|
|
|
guint64 timestamp;
|
|
} GskGLGlyphCache;
|
|
|
|
typedef struct
|
|
{
|
|
PangoFont *font;
|
|
PangoGlyph glyph;
|
|
guint scale; /* times 1024 */
|
|
} GlyphCacheKey;
|
|
|
|
typedef struct _DirtyGlyph DirtyGlyph;
|
|
typedef struct _GskGLCachedGlyph GskGLCachedGlyph;
|
|
|
|
struct _DirtyGlyph
|
|
{
|
|
GlyphCacheKey *key;
|
|
GskGLCachedGlyph *value;
|
|
};
|
|
|
|
struct _GskGLCachedGlyph
|
|
{
|
|
GskGLTextureAtlas *atlas;
|
|
|
|
float tx;
|
|
float ty;
|
|
float tw;
|
|
float th;
|
|
|
|
int draw_x;
|
|
int draw_y;
|
|
int draw_width;
|
|
int draw_height;
|
|
|
|
float scale;
|
|
|
|
guint64 timestamp;
|
|
guint used: 1;
|
|
};
|
|
|
|
|
|
void gsk_gl_glyph_cache_init (GskGLGlyphCache *self,
|
|
GskRenderer *renderer,
|
|
GskGLDriver *gl_driver);
|
|
void gsk_gl_glyph_cache_free (GskGLGlyphCache *self);
|
|
void gsk_gl_glyph_cache_begin_frame (GskGLGlyphCache *self);
|
|
GskGLImage * gsk_gl_glyph_cache_get_glyph_image (GskGLGlyphCache *self,
|
|
const GskGLCachedGlyph *glyph);
|
|
const GskGLCachedGlyph * gsk_gl_glyph_cache_lookup (GskGLGlyphCache *self,
|
|
gboolean create,
|
|
PangoFont *font,
|
|
PangoGlyph glyph,
|
|
float scale);
|
|
|
|
#endif
|