You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/animations.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -854,7 +854,7 @@ class Browser:
854
854
All that's left is wiring these methods up; let's rename
855
855
`raster_and_draw`to `composite_raster_and_draw` (to remind us that
856
856
there's now an additional composite step) and add our two new methods.
857
-
(And don't forget to rename the corresponding dirty bit and call
857
+
(And don't forget to rename the corresponding dirty flag and call
858
858
sites.)
859
859
860
860
``` {.python}
@@ -1167,7 +1167,7 @@ class Tab:
1167
1167
Inside this loop we need to do two things. First, call the
1168
1168
animation's `animate` method and save the new value to the node's
1169
1169
`style`. Second, since that changes rendering inputs, set a
1170
-
dirty bit requiring rendering later.^[We also need to
1170
+
dirty flag requiring rendering later.^[We also need to
1171
1171
schedule an animation frame for the next frame of the animation, but
1172
1172
`set_needs_render`already does that for us.] The whole rendering cycle between the browser and main threads is summarized
1173
1173
in Figure 2.
@@ -1203,7 +1203,7 @@ class Tab:
1203
1203
1204
1204
To implement `set_needs_layout`, we've got to replace the single
1205
1205
`needs_render` flag with three flags: `needs_style`, `needs_layout`,
1206
-
and `needs_paint`. In our implementation, setting a dirty bit earlier
1206
+
and `needs_paint`. In our implementation, setting a dirty flag earlier
1207
1207
in the pipeline will end up causing everything after it to also run,^[This
1208
1208
is yet another difference from real browsers, which optimize some
1209
1209
cases that just require style and paint, or other combinations.]
@@ -1233,8 +1233,8 @@ class Tab:
1233
1233
self.browser.set_needs_animation_frame(self)
1234
1234
```
1235
1235
1236
-
To support these new dirty bits, `render` must check each phase's bit
1237
-
instead of checking `needs_render` at the start:[^timer-obsolete]
1236
+
To support these new dirty flags, `render` must check each phase's
1237
+
flag instead of checking `needs_render` at the start:[^timer-obsolete]
1238
1238
1239
1239
``` {.python}
1240
1240
class Tab:
@@ -1414,9 +1414,9 @@ class Tab:
1414
1414
```
1415
1415
1416
1416
Now for the browser thread. First, add `needs_composite`, `needs_raster` and
1417
-
`needs_draw`dirty bits and corresponding `set_needs_composite`,
1417
+
`needs_draw`dirty flags and corresponding `set_needs_composite`,
1418
1418
`set_needs_raster`, and `set_needs_draw` methods (and remove the old dirty
1419
-
bit):
1419
+
flag):
1420
1420
1421
1421
``` {.python}
1422
1422
class Browser:
@@ -2316,7 +2316,7 @@ function, and one or two others.
2316
2316
transfoms and scrolling, but they are not fully composited and threaded,
2317
2317
and transform transition animations are not supported. Implement these.
2318
2318
(Hint: for transforms, it just requires following the same pattern as for
2319
-
`opacity`; for scrolling, it requires setting fewer dirty bits in
2319
+
`opacity`; for scrolling, it requires setting fewer dirty flags in
2320
2320
`handle_down`.) [A simultaneous transform and opacity animation][tr-example] should now work, without any raster, and scrolling on that page should not
0 commit comments