FastUIDraw
inc
fastuidraw
painter
backend
painter_header.hpp
Go to the documentation of this file.
1
/*!
2
* \file painter_header.hpp
3
* \brief file painter_header.hpp
4
*
5
* Copyright 2016 by Intel.
6
*
7
* Contact: kevin.rogovin@gmail.com
8
*
9
* This Source Code Form is subject to the
10
* terms of the Mozilla Public License, v. 2.0.
11
* If a copy of the MPL was not distributed with
12
* this file, You can obtain one at
13
* http://mozilla.org/MPL/2.0/.
14
*
15
* \author Kevin Rogovin <kevin.rogovin@gmail.com>
16
*
17
*/
18
#ifndef FASTUIDRAW_PAINTER_HEADER_HPP
19
#define FASTUIDRAW_PAINTER_HEADER_HPP
20
21
#include <
fastuidraw/util/util.hpp
>
22
#include <
fastuidraw/util/vecN.hpp
>
23
#include <
fastuidraw/util/c_array.hpp
>
24
25
namespace
fastuidraw
26
{
27
/*!\addtogroup PainterBackend
28
* @{
29
*/
30
31
/*!
32
* \brief
33
* A PainterHeader represents the values of the header for
34
* the shaders to read to draw data. The header holds data
35
* that is common for all vertices and fragments for an
36
* item to draw, including with what shader and the data
37
* for the shader.
38
*/
39
class
PainterHeader
40
{
41
public
:
42
enum
43
{
44
/*!
45
* When \ref m_blend_shader_data_location is set to
46
* \ref drawing_occluder, it indicates that the item
47
* being drawing is an occluder thus the color
48
* computation from the brush and item can be skipped.
49
*/
50
drawing_occluder
= ~0u,
51
};
52
53
/*!
54
* \brief
55
* Enumerations specifying how the contents of a PainterHeader
56
* are packed into a data store buffer (PainterDraw::m_store),
57
* offsets are in units of uint32_t (not \ref uvec4).
58
*/
59
enum
offset_t
60
{
61
clip_equations_location_offset
,
/*!< offset to \ref m_clip_equations_location */
62
item_matrix_location_offset
,
/*!< offset to \ref m_item_matrix_location */
63
brush_shader_data_location_offset
,
/*!< offset to \ref m_brush_shader_data_location */
64
item_shader_data_location_offset
,
/*!< offset to \ref m_item_shader_data_location */
65
blend_shader_data_location_offset
,
/*!< offset to \ref m_blend_shader_data_location */
66
item_shader_offset
,
/*!< offset to \ref m_item_shader */
67
brush_shader_offset
,
/*!< offset to \ref m_brush_shader */
68
blend_shader_offset
,
/*!< offset to \ref m_blend_shader */
69
z_offset
,
/*!< offset to \ref m_z */
70
offset_to_deferred_coverage_x_offset
,
/*!< offset to \ref m_offset_to_deferred_coverage .x() */
71
offset_to_deferred_coverage_y_offset
,
/*!< offset to \ref m_offset_to_deferred_coverage .y() */
72
deferred_coverage_min_x_offset
,
/*!< offset to \ref m_deferred_coverage_min .x() */
73
deferred_coverage_min_y_offset
,
/*!< offset to \ref m_deferred_coverage_min .y() */
74
deferred_coverage_max_x_offset
,
/*!< offset to \ref m_deferred_coverage_max .x() */
75
deferred_coverage_max_y_offset
,
/*!< offset to \ref m_deferred_coverage_max .y() */
76
77
/*!
78
* Offset to \ref m_brush_adjust_location
79
*/
80
brush_adjust_location_offset
,
81
82
header_size
/*!< size of header */
83
};
84
85
/*!
86
* The offset, in units of uvec4 tuples, to the
87
* location in the data store buffer (PainterDraw::m_store) for the
88
* clip equations. I.e. the PainterClipEquations value is stored
89
* (packed) at the location \code
90
* PainterDraw::m_store[m_clip_equations_location]
91
* \endcode
92
*/
93
uint32_t
m_clip_equations_location
;
94
95
/*!
96
* The location, in units of uvec4 tuples, to the
97
* location in the data store buffer (PainterDraw::m_store) for the
98
* item matrix. I.e. the PainterItemMatrix value is stored (packed)
99
* at the location
100
* \code
101
* PainterDraw::m_store[m_item_matrix_location]
102
* \endcode
103
*/
104
uint32_t
m_item_matrix_location
;
105
106
/*!
107
* The location, in units of uvec4 tuples, to the
108
* location in the data store buffer (PainterDraw::m_store) for the
109
* brush shader data. I.e. the data for a brush is stored (packed)
110
* at the location
111
* \code
112
* PainterDraw::m_store[m_brush_shader_data_location]
113
* \endcode
114
*/
115
uint32_t
m_brush_shader_data_location
;
116
117
/*!
118
* The location, in units of uvec4 tuples, to the
119
* location in the data store buffer (PainterDraw::m_store) for the
120
* item shader data. I.e. the PainterItemShaderData value is stored
121
* (packed) at the location
122
* \code
123
* PainterDraw::m_store[m_item_shader_data_location]
124
* \endcode
125
*/
126
uint32_t
m_item_shader_data_location
;
127
128
/*!
129
* The location, in units of uvec4 tuples, to the
130
* location in the data store buffer (PainterDraw::m_store) for the
131
* blend shader data. I.e. the PainterBlendShaderData value
132
* is stored (packed) at the location
133
* \code
134
* PainterDraw::m_store[m_blend_shader_data_location]
135
* \endcode
136
* NOTE: if \ref m_blend_shader_data_location is \ref
137
* drawing_occluder this means that the item being drawing
138
* is an occluder thus the color computation from the brush
139
* and item can be skipped.
140
*/
141
uint32_t
m_blend_shader_data_location
;
142
143
/*!
144
* The ID of the item shader (i.e. PainterItemShader::ID()).
145
*/
146
uint32_t
m_item_shader
;
147
148
/*!
149
* The ID of the brush shader (i.e. PainterBrushShader::ID()).
150
*/
151
uint32_t
m_brush_shader
;
152
153
/*!
154
* The ID of the blend shader (i.e. PainterBlendShader::ID()).
155
*/
156
uint32_t
m_blend_shader
;
157
158
/*!
159
* The z-value to use for the item. The z-value is used
160
* by Painter to implement clipping and to prevent overdraw.
161
* This is the value by which to increment the z-value of
162
* the output of an item's vertex shader
163
*/
164
int32_t
m_z
;
165
166
/*!
167
* Offset in pixels from where to read the deferred coverage
168
* values.
169
*/
170
ivec2
m_offset_to_deferred_coverage
;
171
172
/*!
173
* Minimum value (in coverage buffer pixel coordinates)
174
* from which allowed to read the coverage buffer.
175
*/
176
ivec2
m_deferred_coverage_min
;
177
178
/*!
179
* Maximum value (in coverage buffer pixel coordinates) from
180
* which allowed to read the coverage buffer.
181
*/
182
ivec2
m_deferred_coverage_max
;
183
184
/*!
185
* If non-zero, indicates that the brush position is to be
186
* adjusted in vertex shading before being fed the the brush
187
* shading. When non-zero, is an offset, in units of
188
* uvec4 tuples, to the location in the data
189
* store buffer (PainterDraw::m_store) for the value encoded
190
* by a \ref PainterBrushAdjust packed at the location
191
* \code
192
* PainterDraw::m_store[m_clip_equations_location]
193
* \endcode
194
*/
195
uint32_t
m_brush_adjust_location
;
196
197
/*!
198
* Pack the values of this PainterHeader
199
* \param dst place to which to pack data
200
*/
201
void
202
pack_data
(
c_array<uvec4>
dst)
const
;
203
204
/*!
205
* Returns the length of the data needed to encode the data.
206
*/
207
static
208
unsigned
int
209
data_size
(
void
)
210
{
211
return
FASTUIDRAW_NUMBER_BLOCK4_NEEDED
(
header_size
);
212
}
213
};
214
215
/*! @} */
216
}
217
218
#endif
fastuidraw::PainterHeader::brush_adjust_location_offset
Definition:
painter_header.hpp:80
FASTUIDRAW_NUMBER_BLOCK4_NEEDED
#define FASTUIDRAW_NUMBER_BLOCK4_NEEDED(X)
Definition:
util.hpp:42
fastuidraw::PainterHeader::m_brush_shader_data_location
uint32_t m_brush_shader_data_location
Definition:
painter_header.hpp:115
fastuidraw::PainterHeader::item_shader_data_location_offset
Definition:
painter_header.hpp:64
fastuidraw
all classes and functions of FastUIDraw are in the namespace fastuidraw.
Definition:
colorstop.hpp:28
fastuidraw::PainterHeader::m_z
int32_t m_z
Definition:
painter_header.hpp:164
fastuidraw::PainterHeader::drawing_occluder
Definition:
painter_header.hpp:50
fastuidraw::vecN< int32_t, 2 >
fastuidraw::PainterHeader::data_size
static unsigned int data_size(void)
Definition:
painter_header.hpp:209
fastuidraw::PainterHeader::deferred_coverage_min_y_offset
Definition:
painter_header.hpp:73
fastuidraw::PainterHeader::deferred_coverage_max_x_offset
Definition:
painter_header.hpp:74
fastuidraw::PainterHeader::m_blend_shader
uint32_t m_blend_shader
Definition:
painter_header.hpp:156
c_array.hpp
file c_array.hpp
fastuidraw::PainterHeader::m_item_matrix_location
uint32_t m_item_matrix_location
Definition:
painter_header.hpp:104
fastuidraw::PainterHeader::item_matrix_location_offset
Definition:
painter_header.hpp:62
fastuidraw::PainterHeader::deferred_coverage_min_x_offset
Definition:
painter_header.hpp:72
fastuidraw::PainterHeader
A PainterHeader represents the values of the header for the shaders to read to draw data...
Definition:
painter_header.hpp:39
fastuidraw::PainterHeader::m_deferred_coverage_max
ivec2 m_deferred_coverage_max
Definition:
painter_header.hpp:182
fastuidraw::PainterHeader::offset_t
offset_t
Enumerations specifying how the contents of a PainterHeader are packed into a data store buffer (Pain...
Definition:
painter_header.hpp:59
fastuidraw::PainterHeader::m_offset_to_deferred_coverage
ivec2 m_offset_to_deferred_coverage
Definition:
painter_header.hpp:170
fastuidraw::PainterHeader::m_deferred_coverage_min
ivec2 m_deferred_coverage_min
Definition:
painter_header.hpp:176
util.hpp
file util.hpp
fastuidraw::PainterHeader::item_shader_offset
Definition:
painter_header.hpp:66
fastuidraw::PainterHeader::offset_to_deferred_coverage_x_offset
Definition:
painter_header.hpp:70
fastuidraw::c_array
A c_array is a wrapper over a C pointer with a size parameter to facilitate bounds checking and provi...
Definition:
c_array.hpp:43
fastuidraw::PainterHeader::m_blend_shader_data_location
uint32_t m_blend_shader_data_location
Definition:
painter_header.hpp:141
vecN.hpp
file vecN.hpp
fastuidraw::PainterHeader::clip_equations_location_offset
Definition:
painter_header.hpp:61
fastuidraw::PainterHeader::header_size
Definition:
painter_header.hpp:82
fastuidraw::PainterHeader::brush_shader_offset
Definition:
painter_header.hpp:67
fastuidraw::PainterHeader::pack_data
void pack_data(c_array< uvec4 > dst) const
fastuidraw::PainterHeader::m_brush_adjust_location
uint32_t m_brush_adjust_location
Definition:
painter_header.hpp:195
fastuidraw::PainterHeader::m_brush_shader
uint32_t m_brush_shader
Definition:
painter_header.hpp:151
fastuidraw::PainterHeader::blend_shader_data_location_offset
Definition:
painter_header.hpp:65
fastuidraw::PainterHeader::m_item_shader
uint32_t m_item_shader
Definition:
painter_header.hpp:146
fastuidraw::PainterHeader::offset_to_deferred_coverage_y_offset
Definition:
painter_header.hpp:71
fastuidraw::PainterHeader::m_item_shader_data_location
uint32_t m_item_shader_data_location
Definition:
painter_header.hpp:126
fastuidraw::PainterHeader::blend_shader_offset
Definition:
painter_header.hpp:68
fastuidraw::PainterHeader::z_offset
Definition:
painter_header.hpp:69
fastuidraw::PainterHeader::m_clip_equations_location
uint32_t m_clip_equations_location
Definition:
painter_header.hpp:93
fastuidraw::PainterHeader::deferred_coverage_max_y_offset
Definition:
painter_header.hpp:75
fastuidraw::PainterHeader::brush_shader_data_location_offset
Definition:
painter_header.hpp:63
Generated by
1.8.13