2016-07-08 15:21:13 +00:00
|
|
|
#ifndef __GSK_GL_DRIVER_PRIVATE_H__
|
|
|
|
#define __GSK_GL_DRIVER_PRIVATE_H__
|
|
|
|
|
|
|
|
#include <cairo.h>
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
#include <graphene.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GSK_TYPE_GL_DRIVER (gsk_gl_driver_get_type ())
|
|
|
|
|
|
|
|
G_DECLARE_FINAL_TYPE (GskGLDriver, gsk_gl_driver, GSK, GL_DRIVER, GObject)
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
float position[2];
|
|
|
|
float uv[2];
|
|
|
|
} GskQuadVertex;
|
|
|
|
|
2018-03-20 08:17:26 +00:00
|
|
|
typedef struct {
|
|
|
|
cairo_rectangle_int_t rect;
|
|
|
|
guint texture_id;
|
|
|
|
} TextureSlice;
|
|
|
|
|
2020-09-09 17:55:09 +00:00
|
|
|
typedef struct {
|
|
|
|
gpointer pointer;
|
|
|
|
float scale;
|
|
|
|
int filter;
|
2020-09-30 12:53:13 +00:00
|
|
|
int pointer_is_child;
|
|
|
|
graphene_rect_t parent_rect; /* Only set if pointer_is_child */
|
2020-09-09 17:55:09 +00:00
|
|
|
} GskTextureKey;
|
2018-03-20 08:17:26 +00:00
|
|
|
|
2016-07-08 15:21:13 +00:00
|
|
|
GskGLDriver * gsk_gl_driver_new (GdkGLContext *context);
|
2019-04-24 11:27:43 +00:00
|
|
|
GdkGLContext *gsk_gl_driver_get_gl_context (GskGLDriver *driver);
|
2016-07-08 15:21:13 +00:00
|
|
|
|
2016-10-26 14:47:29 +00:00
|
|
|
int gsk_gl_driver_get_max_texture_size (GskGLDriver *driver);
|
|
|
|
|
2016-07-08 15:21:13 +00:00
|
|
|
void gsk_gl_driver_begin_frame (GskGLDriver *driver);
|
|
|
|
void gsk_gl_driver_end_frame (GskGLDriver *driver);
|
2019-04-22 12:20:02 +00:00
|
|
|
gboolean gsk_gl_driver_in_frame (GskGLDriver *driver);
|
2016-11-16 04:37:20 +00:00
|
|
|
int gsk_gl_driver_get_texture_for_texture (GskGLDriver *driver,
|
2017-11-02 20:39:00 +00:00
|
|
|
GdkTexture *texture,
|
2016-11-16 04:37:20 +00:00
|
|
|
int min_filter,
|
|
|
|
int mag_filter);
|
2020-09-09 17:55:09 +00:00
|
|
|
int gsk_gl_driver_get_texture_for_key (GskGLDriver *driver,
|
|
|
|
GskTextureKey *key);
|
|
|
|
void gsk_gl_driver_set_texture_for_key (GskGLDriver *driver,
|
|
|
|
GskTextureKey *key,
|
2018-11-28 17:40:48 +00:00
|
|
|
int texture_id);
|
2016-07-08 15:21:13 +00:00
|
|
|
int gsk_gl_driver_create_texture (GskGLDriver *driver,
|
2017-11-15 17:40:57 +00:00
|
|
|
float width,
|
|
|
|
float height);
|
2019-05-22 05:10:57 +00:00
|
|
|
void gsk_gl_driver_create_render_target (GskGLDriver *driver,
|
|
|
|
int width,
|
|
|
|
int height,
|
2020-09-02 22:01:06 +00:00
|
|
|
int min_filter,
|
|
|
|
int mag_filter,
|
2019-05-22 05:10:57 +00:00
|
|
|
int *out_texture_id,
|
|
|
|
int *out_render_target_id);
|
|
|
|
void gsk_gl_driver_mark_texture_permanent (GskGLDriver *self,
|
|
|
|
int texture_id);
|
2016-07-08 15:21:13 +00:00
|
|
|
void gsk_gl_driver_bind_source_texture (GskGLDriver *driver,
|
|
|
|
int texture_id);
|
|
|
|
|
2016-07-20 16:55:35 +00:00
|
|
|
void gsk_gl_driver_init_texture_empty (GskGLDriver *driver,
|
2019-06-02 16:47:57 +00:00
|
|
|
int texture_id,
|
|
|
|
int min_filter,
|
|
|
|
int max_filter);
|
2020-09-24 14:58:46 +00:00
|
|
|
void gsk_gl_driver_init_texture (GskGLDriver *driver,
|
2016-07-19 13:32:17 +00:00
|
|
|
int texture_id,
|
2020-09-24 14:58:46 +00:00
|
|
|
GdkTexture *texture,
|
2016-07-19 13:32:17 +00:00
|
|
|
int min_filter,
|
|
|
|
int mag_filter);
|
2016-07-12 10:15:45 +00:00
|
|
|
|
2016-07-20 16:55:35 +00:00
|
|
|
void gsk_gl_driver_destroy_texture (GskGLDriver *driver,
|
|
|
|
int texture_id);
|
|
|
|
|
2016-08-09 10:24:05 +00:00
|
|
|
int gsk_gl_driver_collect_textures (GskGLDriver *driver);
|
2018-03-20 08:17:26 +00:00
|
|
|
void gsk_gl_driver_slice_texture (GskGLDriver *self,
|
|
|
|
GdkTexture *texture,
|
|
|
|
TextureSlice **out_slices,
|
|
|
|
guint *out_n_slices);
|
2016-08-04 11:37:54 +00:00
|
|
|
|
2016-07-08 15:21:13 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GSK_GL_DRIVER_PRIVATE_H__ */
|