@geastack/engine 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/canvas.cpp +34 -0
- package/css/animation.h +64 -0
- package/css/engine.h +6 -1
- package/package.json +2 -2
- package/ui/absolute_leaf_refresh.cpp +32 -31
- package/ui/core.cpp +9 -1
- package/ui/display_invalidation.cpp +29 -0
- package/ui/flex_balance.h +73 -0
- package/ui/image_node.cpp +24 -20
- package/ui/input.cpp +66 -36
- package/ui/input_render.cpp +13 -13
- package/ui/internal.h +51 -5
- package/ui/layout.cpp +2472 -400
- package/ui/layout_snapshot.cpp +21 -5
- package/ui/node_lifecycle.cpp +28 -3
- package/ui/node_model.h +323 -23
- package/ui/render.cpp +638 -265
- package/ui/root_scroll_refresh.cpp +15 -10
- package/ui/style.cpp +3254 -935
- package/ui/style.h +143 -6
- package/ui/style_values.h +16 -0
- package/ui/text.cpp +378 -103
- package/ui/tree_events.cpp +6 -3
- package/ui/tree_events.h +1 -0
- package/ui/tree_internal.h +19 -0
- package/ui/tree_nodes.cpp +6 -0
- package/ui/tree_render.cpp +71 -21
- package/ui/tree_state.h +54 -0
- package/ui/tree_style.cpp +287 -27
- package/ui/view.cpp +612 -251
|
@@ -33,26 +33,29 @@ namespace {
|
|
|
33
33
|
|
|
34
34
|
bool hasTransformState(const Node &node)
|
|
35
35
|
{
|
|
36
|
-
return rstyle(node.style)
|
|
36
|
+
return hasIndividualLinearTransform(rstyle(node.style)) || hadIndividualLinearTransform(node.render) ||
|
|
37
|
+
rstyle(node.style).transform_rotate != 0 ||
|
|
37
38
|
node.render.previous_transform_rotate != 0 ||
|
|
38
39
|
rstyle(node.style).transform_rotate_x != 0 ||
|
|
39
40
|
node.render.previous_transform_rotate_x != 0 ||
|
|
40
41
|
rstyle(node.style).transform_rotate_y != 0 ||
|
|
41
42
|
node.render.previous_transform_rotate_y != 0 ||
|
|
42
|
-
rstyle(node.style)
|
|
43
|
+
composedTranslateX(rstyle(node.style)) != 0 ||
|
|
43
44
|
node.render.previous_transform_translate_x != 0 ||
|
|
44
|
-
rstyle(node.style)
|
|
45
|
+
composedTranslateY(rstyle(node.style)) != 0 ||
|
|
45
46
|
node.render.previous_transform_translate_y != 0 ||
|
|
46
|
-
rstyle(node.style)
|
|
47
|
+
composedTranslateZ(rstyle(node.style)) != 0 ||
|
|
47
48
|
node.render.previous_transform_translate_z != 0 ||
|
|
48
|
-
rstyle(node.style)
|
|
49
|
+
composedTranslateXPercent(rstyle(node.style)) != 0 ||
|
|
49
50
|
node.render.previous_transform_translate_x_percent != 0 ||
|
|
50
|
-
rstyle(node.style)
|
|
51
|
+
composedTranslateYPercent(rstyle(node.style)) != 0 ||
|
|
51
52
|
node.render.previous_transform_translate_y_percent != 0 ||
|
|
52
53
|
rstyle(node.style).transform_scale_x != 1000 ||
|
|
53
54
|
node.render.previous_transform_scale_x != 1000 ||
|
|
54
55
|
rstyle(node.style).transform_scale_y != 1000 ||
|
|
56
|
+
rstyle(node.style).transform_scale_z != 1000 ||
|
|
55
57
|
node.render.previous_transform_scale_y != 1000 ||
|
|
58
|
+
node.render.previous_transform_scale_z != 1000 ||
|
|
56
59
|
rstyle(node.style).perspective > 0 ||
|
|
57
60
|
node.render.previous_perspective > 0;
|
|
58
61
|
}
|
|
@@ -168,7 +171,7 @@ bool flowsChildrenAsRow(const TreeState &state, const Node &p)
|
|
|
168
171
|
bool anyInFlow = false;
|
|
169
172
|
for (int c = p.first_child; c >= 0; c = state.nodes[c].next_sibling) {
|
|
170
173
|
const Node &child = state.nodes[c];
|
|
171
|
-
if (child.style.display == kDisplayNone || child.style.position
|
|
174
|
+
if (child.style.display == kDisplayNone || isOutOfFlowPosition(child.style.position)) continue;
|
|
172
175
|
if (!LayoutEngine::isInlineLevelNode(child)) return false;
|
|
173
176
|
anyInFlow = true;
|
|
174
177
|
}
|
|
@@ -198,13 +201,13 @@ void shiftSiblingsForRemeasuredText(TreeState &state, int id, int oldWidth, int
|
|
|
198
201
|
int totalFlex = 0;
|
|
199
202
|
for (int c = p.first_child; c >= 0; c = state.nodes[c].next_sibling) {
|
|
200
203
|
const Node &child = state.nodes[c];
|
|
201
|
-
if (child.style.display == kDisplayNone || child.style.position
|
|
204
|
+
if (child.style.display == kDisplayNone || isOutOfFlowPosition(child.style.position)) continue;
|
|
202
205
|
totalFlex += child.style.flex;
|
|
203
206
|
}
|
|
204
207
|
if (totalFlex > 0) return;
|
|
205
208
|
for (int c = n.next_sibling; c >= 0; c = state.nodes[c].next_sibling) {
|
|
206
209
|
Node &sib = state.nodes[c];
|
|
207
|
-
if (sib.style.display == kDisplayNone || sib.style.position
|
|
210
|
+
if (sib.style.display == kDisplayNone || isOutOfFlowPosition(sib.style.position)) continue;
|
|
208
211
|
if (row) sib.layout.x += delta;
|
|
209
212
|
else sib.layout.y += delta;
|
|
210
213
|
translateSlotDescendants(state, c, row ? delta : 0, row ? 0 : delta);
|
|
@@ -299,11 +302,13 @@ int RootScrollOnlyRefresh::refreshNode(int root,
|
|
|
299
302
|
int width,
|
|
300
303
|
int height)
|
|
301
304
|
{
|
|
302
|
-
(void)root;
|
|
303
305
|
auto &state = treeState();
|
|
304
306
|
int foundNode = -1;
|
|
305
307
|
*extraDirtyCount = 0;
|
|
306
308
|
*slotCount = 0;
|
|
309
|
+
// A scroll blit would move fixed pixels along with the scrolling content.
|
|
310
|
+
// Fall back to layout and repaint until the blit path can exclude them.
|
|
311
|
+
if (LayoutEngine::containsViewportFixed(root)) return -1;
|
|
307
312
|
|
|
308
313
|
// Pass 1: exactly one pure-scroll node.
|
|
309
314
|
for (int i = 0; i < state.nodeCount; i++) {
|