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>
|
|
|
|
|
2016-11-16 04:37:20 +00:00
|
|
|
#include <gsk/gsktexture.h>
|
|
|
|
|
2016-07-08 15:21:13 +00:00
|
|
|
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;
|
|
|
|
|
|
|
|
GskGLDriver * gsk_gl_driver_new (GdkGLContext *context);
|
|
|
|
|
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);
|
|
|
|
|
2016-11-16 04:37:20 +00:00
|
|
|
int gsk_gl_driver_get_texture_for_texture (GskGLDriver *driver,
|
|
|
|
GskTexture *texture,
|
|
|
|
int min_filter,
|
|
|
|
int mag_filter);
|
2016-07-08 15:21:13 +00:00
|
|
|
int gsk_gl_driver_create_texture (GskGLDriver *driver,
|
|
|
|
int width,
|
2016-07-19 13:32:17 +00:00
|
|
|
int height);
|
2016-07-08 15:21:13 +00:00
|
|
|
int gsk_gl_driver_create_vao_for_quad (GskGLDriver *driver,
|
|
|
|
int position_id,
|
|
|
|
int uv_id,
|
|
|
|
int n_vertices,
|
|
|
|
GskQuadVertex *vertices);
|
2016-07-12 14:41:31 +00:00
|
|
|
int gsk_gl_driver_create_render_target (GskGLDriver *driver,
|
2016-07-20 16:55:35 +00:00
|
|
|
int texture_id,
|
|
|
|
gboolean add_depth_buffer,
|
|
|
|
gboolean add_stencil_buffer);
|
2016-07-08 15:21:13 +00:00
|
|
|
|
|
|
|
void gsk_gl_driver_bind_source_texture (GskGLDriver *driver,
|
|
|
|
int texture_id);
|
|
|
|
void gsk_gl_driver_bind_mask_texture (GskGLDriver *driver,
|
|
|
|
int texture_id);
|
|
|
|
void gsk_gl_driver_bind_vao (GskGLDriver *driver,
|
|
|
|
int vao_id);
|
2016-07-20 16:55:35 +00:00
|
|
|
gboolean gsk_gl_driver_bind_render_target (GskGLDriver *driver,
|
|
|
|
int texture_id);
|
2016-07-08 15:21:13 +00:00
|
|
|
|
2016-07-20 16:55:35 +00:00
|
|
|
void gsk_gl_driver_init_texture_empty (GskGLDriver *driver,
|
|
|
|
int texture_id);
|
2016-07-19 13:32:17 +00:00
|
|
|
void gsk_gl_driver_init_texture_with_surface (GskGLDriver *driver,
|
|
|
|
int texture_id,
|
2016-07-12 10:15:45 +00:00
|
|
|
cairo_surface_t *surface,
|
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);
|
|
|
|
void gsk_gl_driver_destroy_vao (GskGLDriver *driver,
|
|
|
|
int vao_id);
|
|
|
|
|
2016-08-09 10:24:05 +00:00
|
|
|
int gsk_gl_driver_collect_textures (GskGLDriver *driver);
|
|
|
|
int gsk_gl_driver_collect_vaos (GskGLDriver *driver);
|
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__ */
|