Commit Graph

13 Commits

Author SHA1 Message Date
stasoid
27696b8d8e test_container: correctly draw multicolor borders 2024-05-20 00:40:31 +03:00
stasoid
28bbe74ec9 test_container: support TTF fonts 2024-05-20 00:40:31 +03:00
stasoid
d5426075fa canvas_ity: add get_font_metrics() 2024-05-20 00:40:31 +03:00
stasoid
138f712eb8 canvas_ity: fix font baseline position computation 2024-05-20 00:40:31 +03:00
stasoid
7b7d292b58 fix gcc warning 2024-05-16 22:54:49 +03:00
stasoid
38180d37da fix VS and gcc warnings 2024-05-16 22:54:49 +03:00
stasoid
60bd9f18f1 implement gradient color transition hints 2024-05-16 22:54:49 +03:00
stasoid
423bb82412 canvas_ity: handle zero radius of radial gradient 2024-05-16 22:54:49 +03:00
stasoid
62de3475f3 test_container: add ability to use background repeat styles with gradient images 2024-05-16 22:54:49 +03:00
stasoid
869a3cd8ea test_container, canvas_ity: implement conic-gradient 2024-05-16 22:54:49 +03:00
stasoid
70fafc0b86 test_container, canvas_ity: implement radial-gradient
Radial gradient supported by canvas_ity is different (two circles vs one ellipse in CSS), so I implemented new brush type, css_radial. It is created with canvas::set_css_radial_gradient().
2024-05-16 22:54:49 +03:00
stasoid
eadeeefbd9 test_container, canvas_ity: do not linearize colors to match Chrome/Firefox gradient rendering
Old behavior is still available with #define CANVAS_ITY_IMPLEMENTATION LINEARIZE_RGB

Comparison of rendering linear-gradient-1.htm with and without LINEARIZE_RGB:
![image](https://github.com/stasoid/test/assets/2577509/074f2593-1beb-49f6-a387-370a8dfedaad)

Browsers don't render gradients identically, so I use max_color_diff() to compare them.
It measures max difference in each RGBA component in each pixel.
                                                 max_color_diff
chrome vs firefox                                1
chrome vs canvas_ity without linearized colors   1
chrome vs canvas_ity with linearized colors      74
2024-05-16 22:54:49 +03:00
stasoid
44ac33f825 test_container: convert to using canvas_ity 2024-05-16 22:54:49 +03:00