Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion impeller/display_list/dl_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,20 @@ void DlDispatcher::drawDRRect(const SkRRect& outer, const SkRRect& inner) {

// |flutter::DlOpReceiver|
void DlDispatcher::drawPath(const SkPath& path) {
canvas_.DrawPath(skia_conversions::ToPath(path), paint_);
SkRect rect;
SkRRect rrect;
SkRect oval;
if (path.isRect(&rect)) {
canvas_.DrawRect(skia_conversions::ToRect(rect), paint_);
} else if (path.isRRect(&rrect) && rrect.isSimple()) {
canvas_.DrawRRect(skia_conversions::ToRect(rrect.rect()),
rrect.getSimpleRadii().fX, paint_);
} else if (path.isOval(&oval) && oval.width() == oval.height()) {
canvas_.DrawCircle(skia_conversions::ToPoint(oval.center()),
oval.width() * 0.5, paint_);
} else {
Copy link
Member

@bdero bdero May 4, 2023

Choose a reason for hiding this comment

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

DrawCircle would also push us into the rrect fast path for blurs if the color source is solid and there's a mask blur.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

canvas_.DrawPath(skia_conversions::ToPath(path), paint_);
}
}

// |flutter::DlOpReceiver|
Expand Down