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
use flo_canvas as canvas;
use flo_render as render;
use lyon::tessellation::{VertexBuffers};
///
/// How a vertex buffer is intended to be used
///
pub enum VertexBufferIntent {
/// Will be drawn using DrawIndexed
Draw,
/// Will be rendered to the clipping area using EnableClipping
Clip
}
///
/// Single rendering operation for a layer
///
pub enum RenderEntity {
/// Render operation is missing
Missing,
/// Render operation is waiting to be tessellated (with a unique entity ID)
Tessellating(usize),
/// Tessellation waiting to be sent to the renderer
VertexBuffer(VertexBuffers<render::Vertex2D, u16>, VertexBufferIntent),
/// Render a vertex buffer
DrawIndexed(render::VertexBufferId, render::IndexBufferId, usize),
/// Render the sprite layer with the specified ID
RenderSprite(canvas::SpriteId, canvas::Transform2D),
/// Updates the transformation matrix for the layer
SetTransform(canvas::Transform2D),
/// Sets the blend mode to use for the following rendering
SetBlendMode(render::BlendMode),
/// Use flat colour shading for the following rendering
SetFlatColor,
/// Sets the dash pattern to use for the following rendering
SetDashPattern(Vec<f32>),
/// Sets the fill texture to use for the following rendering
SetFillTexture(render::TextureId, render::Matrix, bool, f32),
/// Sets the gradient texture to use for the following rendering
SetFillGradient(render::TextureId, render::Matrix, bool, f32),
/// Use the specified vertex buffer to define a clipping mask
EnableClipping(render::VertexBufferId, render::IndexBufferId, usize),
/// Stop clipping
DisableClipping
}