Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c00e5b6fc5b38d5c215fd00a555b51c486010439
      
https://github.com/WebKit/WebKit/commit/c00e5b6fc5b38d5c215fd00a555b51c486010439
  Author: Simon Fraser <[email protected]>
  Date:   2024-10-29 (Tue, 29 Oct 2024)

  Changed paths:
    M Source/WebCore/rendering/style/BasicShapes.cpp
    M Source/WebCore/rendering/style/BasicShapes.h

  Log Message:
  -----------
  Add a common base class for the rect-based BasicShapes
https://bugs.webkit.org/show_bug.cgi?id=282289
rdar://138872209

Reviewed by Tim Nguyen.

There's data and code duplication between BasicShapeRect, BasicShapeXywh, and 
BasicShapeInset,
so add BasicRoundedRectShape and have those classes derive from it. This class 
can now handle
generation of rounded rects and shapes.

* Source/WebCore/rendering/style/BasicShapes.cpp:
(WebCore::BasicRoundedRectShape::BasicRoundedRectShape):
(WebCore::BasicRoundedRectShape::operator== const):
(WebCore::BasicRoundedRectShape::roundedRectForBoundingBox const):
(WebCore::BasicRoundedRectShape::path const):
(WebCore::BasicShapeInset::create):
(WebCore::BasicShapeInset::BasicShapeInset):
(WebCore::BasicShapeInset::clone const):
(WebCore::BasicShapeInset::operator== const):
(WebCore::BasicShapeInset::rectForBoundingBox const):
(WebCore::BasicShapeInset::canBlend const):
(WebCore::BasicShapeInset::blend const):
(WebCore::BasicShapeInset::dump const):
(WebCore::operator<<):
(WebCore::BasicShapeRect::BasicShapeRect):
(WebCore::BasicShapeRect::operator== const):
(WebCore::BasicShapeRect::rectForBoundingBox const):
(WebCore::BasicShapeXywh::BasicShapeXywh):
(WebCore::BasicShapeXywh::operator== const):
(WebCore::BasicShapeXywh::rectForBoundingBox const):
(WebCore::m_bottomLeftRadius): Deleted.
(WebCore::BasicShapeRect::path const): Deleted.
(WebCore::BasicShapeXywh::path const): Deleted.
(WebCore::BasicShapeInset::path const): Deleted.
* Source/WebCore/rendering/style/BasicShapes.h:
(WebCore::BasicShape::isCircleTypeShape const):
(WebCore::BasicShape::isRectTypeShape const):
(WebCore::BasicRoundedRectShape::topLeftRadius const):
(WebCore::BasicRoundedRectShape::topRightRadius const):
(WebCore::BasicRoundedRectShape::bottomRightRadius const):
(WebCore::BasicRoundedRectShape::bottomLeftRadius const):
(WebCore::BasicRoundedRectShape::setTopLeftRadius):
(WebCore::BasicRoundedRectShape::setTopRightRadius):
(WebCore::BasicRoundedRectShape::setBottomRightRadius):
(WebCore::BasicRoundedRectShape::setBottomLeftRadius):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to