Commit graph

1093 commits

Author SHA1 Message Date
Olivier Goffart
0d09f69fb9 Upgrade lyon_path version since the PR in lyon_path was merged.
This should help for #253
2021-06-06 09:37:32 +02:00
Simon Hausmann
96aeffa092 Accept .otf files
ttf_parser (used by rustybuzz and femtovg) supports them, and Qt supports them, too.
2021-06-03 10:55:58 +02:00
Olivier Goffart
045f6cbc70 Fix C++ tests
The local variable name need to be unique
2021-06-01 14:38:30 +02:00
Olivier Goffart
0598b3f095 The debug() function can now take several args, and debug more types 2021-06-01 14:10:25 +02:00
Olivier Goffart
77b8bb615f Move some code in a new module 2021-06-01 12:50:29 +02:00
Olivier Goffart
142a8dc185 Rename ImageReference to ImageInner and make Immage.0 private 2021-05-28 17:05:16 +02:00
Olivier Goffart
0b3fecf300 WIP: API to expose image loading from C++ and Rust 2021-05-28 17:05:16 +02:00
Olivier Goffart
4584c40544 Rename items::Image to ImageItem
Because there will be soon a sixtyfps::Image and the names
can't clash
2021-05-28 17:05:16 +02:00
Olivier Goffart
1537a60712 LSP: auto-complete for the reserved property
Which includes the layout properties
2021-05-28 15:03:45 +02:00
Simon Hausmann
cc9d5e09f0 Add support for clip on Path elements
This allows clipping the viewbox conveniently.
2021-05-21 19:51:00 +02:00
Simon Hausmann
e7bc91c804 Add support for specifying the viewbox of path elements 2021-05-21 19:51:00 +02:00
Olivier Goffart
1aed36d122 Be sure to propagate the fact that properties are changed for aliases 2021-05-21 10:06:26 +02:00
Olivier Goffart
a1880bd943 Report an error when trying to convert from logical to physical coordinate in a global 2021-05-20 18:11:58 +02:00
Olivier Goffart
8f94099a7e Fix reporting of uncalled "max" in imports 2021-05-20 18:11:58 +02:00
Olivier Goffart
59b12d20e8 Update sixtyfps_compiler/generator.rs
Co-authored-by: Simon Hausmann <simon.hausmann@sixtyfps.io>
2021-05-20 13:40:51 +02:00
Olivier Goffart
6d48468823 Don't recurse when we can use cached value
Also avoid stack overflow in case of infinite loop
2021-05-20 13:40:51 +02:00
Olivier Goffart
2a1c7a9154 Mark aliased property of public api as set
So we don't optimize away binding that points to them

Fix the two_way_simple.60 test
2021-05-20 13:40:51 +02:00
Olivier Goffart
6fae458c2d Properly merge analysis of base component 2021-05-20 13:40:51 +02:00
Olivier Goffart
83edd6534b Fix move declaration not moving the analysis 2021-05-20 13:40:51 +02:00
Olivier Goffart
a79a4351b5 Be smarter at detecting the constant property and at not generating bindings
this implies that we need to make sure the property are initialized in
order so that constant properties that depends on other constant properties
are correctly computed
2021-05-20 13:40:51 +02:00
Olivier Goffart
a92d1af03c Move the public api check in its own passes
The pass must be done at the begining so that synthetised property don't
become public, and also so that analyses pass can use the public api information
2021-05-20 13:40:51 +02:00
Olivier Goffart
54be5f3a84 Some ground work to make more binding analysis
- Mark builtin properties that are modified by the native code as output
 - Record wether the property is set by code in the .60
 - Add a field that will tell us if a property binding is constant
2021-05-20 13:40:51 +02:00
Simon Hausmann
a7ce64657c Restore source compatibility for drop-shadow-blur
Let's keep source compatibility and define `drop-shadow-blur` to be a radius.
The CSS spec says that the standard deviation is half of the radius.

We just need to scale again and increase the shadow rect to make sure that no borders are visible.
2021-05-20 12:14:05 +02:00
Simon Hausmann
bb7b301b10 GL backend: new box drop shadow implementation
This replaces the box gradient with a new implementation that
behaves like the HTML Canvas element, by applying a gaussian
blur to the alpha of the rectangle to shadow.

The drop-shadow-blur property is changed to be now just a "level", like
the HTML Canvas shadowBlur property, which is defined to be half of the
standard deviation of the gaussian blur to be applied.
2021-05-20 08:50:02 +02:00
Olivier Goffart
73c396ed7a Report binding loops for layouts 2021-05-18 12:25:19 +02:00
Olivier Goffart
4824d43c50 Fix binding loop detection involving states 2021-05-18 10:52:05 +02:00
Olivier Goffart
fbdbe69fe7 Window: make hight and width fixed size, preferred-* property set the initial size
Issue #227
2021-05-18 10:23:06 +02:00
Olivier Goffart
3548c48bff Detect binding loop at compile-time
FIXME: i've currently disabled layout from the detection because it reports
error in our current examples
2021-05-15 15:49:27 +02:00
Olivier Goffart
76a42cd757 Added support for static constant z ordering
Just re-order the children at compile time
2021-05-14 16:17:34 +02:00
Olivier Goffart
c39cb48125 Move builtin types builtin function lookup in the lookup module
This way these function can also be auto-completed
2021-05-12 22:21:08 +02:00
Olivier Goffart
0968880ea9 Fix panic when parsing invalid states 2021-05-12 08:50:39 +02:00
Olivier Goffart
7293129fe1 Simplify a loop
Following the suggestion from Simon's review
2021-05-11 14:59:57 +02:00
Olivier Goffart
6530518dd6 Some fixups after review 2021-05-11 14:59:57 +02:00
Olivier Goffart
203c27c5e3 Properly visit the repeater_index expression in a Expression::LayoutCacheAccess 2021-05-11 14:59:57 +02:00
Olivier Goffart
ba1aff84d0 Layout refactoring: C++ part 2021-05-11 14:59:57 +02:00
Olivier Goffart
539a78e807 Rust: implement enough of PathLayout so that the tests passes
(does not implement the repeater case)
2021-05-11 14:59:57 +02:00
Olivier Goffart
f99d7de5ad Fixup layout in rust 2021-05-11 14:59:57 +02:00
Olivier Goffart
b01884f3b9 Layout refactor: do the rust part 2021-05-11 14:59:57 +02:00
Olivier Goffart
f6b71b36a7 Interpreter: fix layout_info for repeated component
We need to look at the layout_info_prop of the root element
2021-05-11 14:59:57 +02:00
Olivier Goffart
8da6c8cdb3 Lower PathLayout
As part of the layout refactoring, most of the path layout lowering
was gone. Add it back
2021-05-11 14:59:57 +02:00
Olivier Goffart
e7d7589538 Decent default binding for the materialized constraints 2021-05-11 14:59:57 +02:00
Olivier Goffart
a990e01cd8 Apply the layout restrictions to the parent element 2021-05-11 14:59:57 +02:00
Olivier Goffart
81473c2541 Remove implicit_size from the Item vtable
Use the preferred size in the layouting_info instead.
2021-05-11 14:59:57 +02:00
Olivier Goffart
c6103aa9ce Fix image geometry in layout
since the layout now sets an explicit width and height, we check the priority
to see the difference between something explicitly set, and something set by the layout
2021-05-11 14:59:57 +02:00
Olivier Goffart
f06bf8d5a7 Fix repeater in box layout 2021-05-11 14:59:57 +02:00
Olivier Goffart
a43c2bb50a Component pretty print with indentation 2021-05-11 14:59:57 +02:00
Olivier Goffart
b463e3cca4 WIP refactor layout
This commit add support for the box layout
2021-05-11 14:59:57 +02:00
Olivier Goffart
21a80f4562 WIP: Layout refactoring
Instead of using a solve_layout function in the component, use property to hold
a layout cache.

This commit only implement the GridLayout and only the interpreter part
2021-05-11 14:59:57 +02:00
Simon Hausmann
5d6c8e7ee1 Make the export of the vtable getter functions conditional
We only need the create these getter functions and export them on Windows
for ffi enabled builds.
2021-05-11 08:03:50 +02:00
Simon Hausmann
c6a4841cd4 Simplify item vtable retrieval in C++
Use a macro instead of a template function to make the getter vs. global
symbol choice.
2021-05-11 07:55:51 +02:00