| Summary: | Use references instead of pointers as animation wrapper function arguments in CSSPropertyAnimation.cpp | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Antoine Quint <graouts> |
| Component: | Animations | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | darin, dino, graouts, sam, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=223148 | ||
|
Description
Antoine Quint
2021-03-15 00:42:53 PDT
Actually, looking at the code again:
double aspectRatioDst = WebCore::blend(log(a->logicalAspectRatio()), log(b->logicalAspectRatio()), progress);
dst->setAspectRatio(exp(aspectRatioDst), 1);
dst->setAspectRatioType(progress < 0.5 ? a->aspectRatioType() : b->aspectRatioType());
Since in the discrete case the progress is either 0 or 1, I think the blend function could be just those three lines. While it's a bit extra work to actually blend the values when we know it'll be one or the other, it simplifies the logic.
That assumes that canInterpolate() will correctly identify all cases where the animation should be discrete, which is its contract.
Don't mind this last comment, it was mistakenly typed in this bug rather than bug 220848. *** Bug 223172 has been marked as a duplicate of this bug. *** Will address this in a larger refactor in bug 224433. *** This bug has been marked as a duplicate of bug 224433 *** |