blob: 4d25767ef4b79e20544f6f9903f23207ac771825 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
/* gskgltextureprivate.h
*
* Copyright 2020 Christian Hergert <chergert@redhat.com>
*
* This file is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef _GSK_GL_TEXTURE_PRIVATE_H__
#define _GSK_GL_TEXTURE_PRIVATE_H__
#include "gskgltypesprivate.h"
G_BEGIN_DECLS
struct _GskGLTextureSlice
{
cairo_rectangle_int_t rect;
struct {
float x;
float y;
float x2;
float y2;
} area;
guint texture_id;
};
struct _GskGLTextureNineSlice
{
cairo_rectangle_int_t rect;
struct {
float x;
float y;
float x2;
float y2;
} area;
};
struct _GskGLTexture
{
/* Used to insert into queue */
GList link;
/* Identifier of the frame that created it */
gint64 last_used_in_frame;
/* Backpointer to texture (can be cleared asynchronously) */
GdkTexture *user;
/* Only used by nine-slice textures */
GskGLTextureNineSlice *nine_slice;
/* Only used by sliced textures */
GskGLTextureSlice *slices;
guint n_slices;
/* The actual GL texture identifier in some shared context */
guint texture_id;
int width;
int height;
/* Set when used by an atlas so we don't drop the texture */
guint permanent : 1;
/* we called glGenerateMipmap() for this texture */
guint has_mipmap : 1;
};
GskGLTexture * gsk_gl_texture_new (guint texture_id,
int width,
int height,
gint64 frame_id);
const GskGLTextureNineSlice * gsk_gl_texture_get_nine_slice (GskGLTexture *texture,
const GskRoundedRect *outline,
float extra_pixels_x,
float extra_pixels_y);
void gsk_gl_texture_free (GskGLTexture *texture);
G_END_DECLS
#endif /* _GSK_GL_TEXTURE_PRIVATE_H__ */
|