Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 30a3e3cfaedc4b922d05aedee20a4761efcf7d2d
      
https://github.com/WebKit/WebKit/commit/30a3e3cfaedc4b922d05aedee20a4761efcf7d2d
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-03-28 (Sat, 28 Mar 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/UnitBezier.h
    M Source/WebCore/platform/graphics/opentype/OpenTypeTypes.h
    M Source/WebCore/platform/graphics/skia/SkiaImageAtlasLayoutBuilder.cpp
    M Source/WebCore/rendering/TextBoxPainter.cpp
    M Source/WebCore/rendering/svg/SVGMarkerData.h

  Log Message:
  -----------
  Use std::midpoint() in more WebCore code
https://bugs.webkit.org/show_bug.cgi?id=310949
rdar://173562239

Reviewed by Chris Dumez.

Use C++20's std::midpoint() [1] in more places across WebCore to compute
midpoints. std::midpoint() is more expressive and avoids potential
overflow issues compared to manual calculations like (a + b) / 2,
(a + b) >> 1, or (a + b) * .5.

[1] https://en.cppreference.com/w/cpp/numeric/midpoint

* Source/WebCore/platform/graphics/UnitBezier.h:
(WebCore::UnitBezier::solveCurveX):
* Source/WebCore/platform/graphics/opentype/OpenTypeTypes.h:
(WebCore::OpenType::TableWithCoverage::getCoverageIndex const):
* Source/WebCore/platform/graphics/skia/SkiaImageAtlasLayoutBuilder.cpp:
(WebCore::SkiaImageAtlasLayoutBuilder::findMaxPackableBatch):
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::drawWritingToolsUnderline):
* Source/WebCore/rendering/svg/SVGMarkerData.h:
(WebCore::SVGMarkerData::currentAngle const):

Canonical link: https://commits.webkit.org/310153@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to