forked from intel/fastuidraw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO.txt
109 lines (88 loc) · 5.51 KB
/
TODO.txt
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
TODO.
1. The shader code for computing dash pattern inclusiveness can be improved.
The shader does a simple linear search. It would be better to do a
hierarchical search, the issue is to make it nice packing for 4 x 32-bit
wide elements of the data store. Alternatively, we could instead use
the PainterAttributeWriter interface to generate the attribute/index
data from the dash pattern.
2. It is potentially dubious to use texture lookup always for colorstops.
The issue is that hard color stops are not representable exactly with
texture lookup. The natural way out if to have a hierarchical search
instead.
3. Add arc methods that are same as that of W3C canvas:
- Add ctor for PathContour::arc(vec2 center, float radius,
float startAngle, float endAngle,
bool counterclockwise)
where the center of the arc is specified as are the
starting and ending angles and if it goes clockwise
or counter-clockwise.
- Add new function/thing: arcTo(vec2 pt1, vec2 pt2, R)
That makes an arc and 2 line segments as follows.
Let L be the ray from the previous point to
pt1 and M be the ray from pt1 to pt2. Let C
be the circle tangent to both L and M with
radius R. Let A be the arc of a circle that
starts at where the C intersects L and ends
where C intersects M. Then arcTo(pt1, pt2, R)
is first connect by line segment from previous
point to the start of A, then A, and then from
end point of A to pt2.
4. Add ellipse methods to Path. The ellipse interpolator would
derived from interpolator_generic.
5. Add method to stroke RoundedRect that would not reconstruct
a new path each time. Them main issue in joining is that the
cap-ends of each of the sub-paths (the four rounded corners
for example) need to be pixel-tight and NOT anti-aliased.
6. Add methods to fill-and-stroke to Painter where the fill
obscures the stroke.
7. An interface to perform text layout. Currently an application needs to do
this by itself, the example code being in demos/common/text_helper.[ch]pp.
Likely the best solution is a separate library that integrates Harfbuzz.
8. Consider implementing multi-channel distance field as seen in
https://github.com/Chlumsky/msdfgen. The thesis on it is at
https://dspace.cvut.cz/bitstream/handle/10467/62770/F8-DP-2015-Chlumsky-Viktor-thesis.pdf;
an article is also available at https://onlinelibrary.wiley.com/doi/abs/10.1111/cgf.13265.
Changes we will need to introduce is to change the distance computation
to the L1-metric (which makes distance computation fast) and that
may have additional ramifications in general.
9. Vulkan backend. Reuse the GLSL code building of fastuidraw::glsl
together with a 3rd party library to create SPIR-V from GLSL.
Options for third part library so far are:
a) libshaderc at https://github.com/google/shaderc.
b) glslang from Khronos at https://github.com/KhronosGroup/glslang
10. Fix filename and type name values. The naming scheme of files vs
objects is bad. Files are all named underscore_style, where as classes
are named PascalCaseStyle. Should make this consistent. Also, a number
of base classes are defined in files without the _base suffix, for example
FontBase is defined in font.hpp.
11. FontDatabase is a -very- poor man's method of selecting glyphs and
performing font merging. It can be argued that it has no real place
in FastUIDraw since FastUIDraw is just for drawing.
12. Proper GL classes dtor'ing is needed. A number of dtor's in the
gl_backend need a GL context to operate. However, these objects
are reference counted and thus their dtors can happen outside of
the GL context that created them being current. The way out is to
have a concept of "GL context worker" where functors are added to
the worker and the worker runs these functors "whenever it gets a
chance" to do so within a GL context.
13. Painter effects interface where similar to begin_layer() for transparency,
we allow for the rect passed to go through a sequence of effects.
sequence will be a unique painter-brush shader.
14. Possibly: clip_in, clip_out by convex polygon.
15. Anti-alias clipping. The basic idea is to have an additional buffer that holds
the anti-aliasing coverage to apply along edges. Path renderers will draw to this
buffer to give anti-alias clip-out (and this clip-in) and clip_in_rect will draw
the rect edges as well.
16. Possibly: replace if/else linear chain in uber-shader to log2 nested if-else chain.
Not 100% clear if the nested would actually be faster or not.
17. Implement clip_out/clip_in by image alpha. One way to achieve this is to start a
transparency layer and at the end of the layer, use the Porter-Duff mode DST_OVER,
that would then mask out the image buffer (this is for clip-out). For clip-in,
SRC_OVER would work.
18. Add to Path interface ability to mark an edge of the path as do not anti-alias edge.
19. Add to Path interface ability to mark a contours caps as to NOT be anti-aliased. The
purpose is for merging multiple paths into a single path for stroking (the big use
case being stroking a rounded rect).
20. Consider changing each utilitization of std:: containers to pass an allocator
that uses fastuidraw::memory::malloc_implement() and friends so that changing
the memory allocator globally in a build of FastUIDraw is possible.