Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b39363a17b0e45272c72444cabd9bb08599766e5
https://github.com/WebKit/WebKit/commit/b39363a17b0e45272c72444cabd9bb08599766e5
Author: lilly <[email protected]>
Date: 2026-07-01 (Wed, 01 Jul 2026)
Changed paths:
M Source/WebCore/platform/graphics/FloatQuad.cpp
M Source/WebCore/platform/graphics/FloatQuad.h
M Tools/TestWebKitAPI/CMakeLists.txt
M Tools/TestWebKitAPI/Tests/WebCore/FloatQuadTests.cpp
Log Message:
-----------
Add FloatQuad::intersectsQuad to test intersection between two quads
https://bugs.webkit.org/show_bug.cgi?id=318137
rdar://180956416
Reviewed by Simon Fraser.
Adds intersectsQuad to FloatQuad for testing whether two convex quads overlap.
The method checks all 16 pairs of edges (4 from each quad) for segment
intersection using a cross-product sign test, two edges cross if each edge's
endpoints fall on opposite sides of the other edge. If no edges intersect, it
falls back to containsPoint to handle the case where one quad is entirely
inside the other.
5 new tests written in FloatQuadTests.cpp
* Source/WebCore/platform/graphics/FloatQuad.cpp:
(WebCore::sideOf):
(WebCore::FloatQuad::intersectsQuad const):
* Source/WebCore/platform/graphics/FloatQuad.h:
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/Tests/WebCore/FloatQuadTests.cpp:
(TestWebKitAPI::TEST(FloatQuad, BoundingBoxSaturateLarge)):
(TestWebKitAPI::TEST(FloatQuad, IntersectsQuad)):
Canonical link: https://commits.webkit.org/316291@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications