Skip to content

Simplify SVGPathBlender::blendArcToSegment #46896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ahmad-S792
Copy link
Contributor

@Ahmad-S792 Ahmad-S792 commented Jun 18, 2025

61f5d56

Simplify SVGPathBlender::blendArcToSegment
https://bugs.webkit.org/show_bug.cgi?id=265914

Reviewed by NOBODY (OOPS!).

Merge: https://chromium.googlesource.com/chromium/blink/+/d5b67fa7c1c3767bd4f384adb8c43875e632bef5

By factoring the "simple" (same coordinate type) case out of
SVGPathBlender::blendAnimatedFloatPoint, we can simplify the blending
of rx/ry/angle of two arc segments.

Additionally, since the m_fromMode == m_toMode if m_addTypesCount != 0,
the same expression can be used to determine the mode of the blended
segment.

* Source/WebCore/svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::blendAnimatedFloatPointSameCoordinates):
(WebCore::SVGPathBlender::blendAnimatedFloatPoint):
(WebCore::SVGPathBlender::blendArcToSegment):
* Source/WebCore/svg/SVGPathBlender.h:

61f5d56

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

https://bugs.webkit.org/show_bug.cgi?id=265914

Reviewed by NOBODY (OOPS!).

Merge: https://chromium.googlesource.com/chromium/blink/+/d5b67fa7c1c3767bd4f384adb8c43875e632bef5

By factoring the "simple" (same coordinate type) case out of
SVGPathBlender::blendAnimatedFloatPoint, we can simplify the blending
of rx/ry/angle of two arc segments.

Additionally, since the m_fromMode == m_toMode if m_addTypesCount != 0,
the same expression can be used to determine the mode of the blended
segment.

* Source/WebCore/svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::blendAnimatedFloatPointSameCoordinates):
(WebCore::SVGPathBlender::blendAnimatedFloatPoint):
(WebCore::SVGPathBlender::blendArcToSegment):
* Source/WebCore/svg/SVGPathBlender.h:
@Ahmad-S792 Ahmad-S792 self-assigned this Jun 18, 2025
@Ahmad-S792 Ahmad-S792 added the SVG For bugs in the SVG implementation. label Jun 18, 2025
if (m_fromMode == m_toMode)
return blendFloatPoint(fromPoint, toPoint, progress);
return blendAnimatedFloatPointSameCoordinates(fromPoint, toPoint, progress);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now handles the case of m_addTypeCount is > 0. This was not the case before, just wanted to point it out, did not check the implications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SVG For bugs in the SVG implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants