[webkit-changes] [WebKit/WebKit] eb42c4: Use constexpr in some geometry classes

Simon Fraser noreply at github.com
Thu May 9 15:00:09 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: eb42c47c896489c50aea83ab8be3ca19ac393ecd
      https://github.com/WebKit/WebKit/commit/eb42c47c896489c50aea83ab8be3ca19ac393ecd
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-05-09 (Thu, 09 May 2024)

  Changed paths:
    M Source/WebCore/platform/LayoutUnit.h
    M Source/WebCore/platform/graphics/IntPoint.h
    M Source/WebCore/platform/graphics/LayoutPoint.h

  Log Message:
  -----------
  Use constexpr in some geometry classes
https://bugs.webkit.org/show_bug.cgi?id=273954
rdar://127819143

Reviewed by Wenson Hsieh and Matthieu Dubet.

Add constexpr to more constructors and functions on IntPoint/LayoutPoint/LayoutUnit to
allow for these types to be used in compile-time constants.

* Source/WebCore/platform/LayoutUnit.h:
(WebCore::LayoutUnit::LayoutUnit):
(WebCore::LayoutUnit::toInt const):
(WebCore::LayoutUnit::toFloat const):
(WebCore::LayoutUnit::toDouble const):
(WebCore::LayoutUnit::toUnsigned const):
(WebCore::LayoutUnit::operator int const):
(WebCore::LayoutUnit::operator float const):
(WebCore::LayoutUnit::operator double const):
(WebCore::LayoutUnit::operator bool const):
(WebCore::LayoutUnit::rawValue const):
* Source/WebCore/platform/graphics/IntPoint.h:
(WebCore::IntPoint::IntPoint):
(WebCore::IntPoint::zero):
(WebCore::IntPoint::isZero const):
(WebCore::IntPoint::x const):
(WebCore::IntPoint::y const):
(WebCore::IntPoint::expandedTo const):
(WebCore::IntPoint::shrunkTo const):
* Source/WebCore/platform/graphics/LayoutPoint.h:
(WebCore::LayoutPoint::LayoutPoint):
(WebCore::LayoutPoint::zero):
(WebCore::LayoutPoint::isZero const):

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



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


More information about the webkit-changes mailing list