mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
script: Do not iterate through all image frames when advancing animated images (#38857)
Instead of iterating through all frames every time we are looking for a particular frame, just index into the `Vec` of frames directly. This should do less work on every frame transition. Testing: This is just a small optimization, so shouldn't change observable behavior. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
fd3ea8854f
commit
2f44ba5168
2 changed files with 9 additions and 7 deletions
|
@ -72,8 +72,7 @@ impl ImageAnimationManager {
|
|||
|
||||
let image = &state.image;
|
||||
let frame = image
|
||||
.frames()
|
||||
.nth(state.active_frame)
|
||||
.frame(state.active_frame)
|
||||
.expect("active_frame should within range of frames");
|
||||
|
||||
if let Some(node) = rooted_nodes.get(&NoTrace(*node)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue