From 9078eeec8b586d72a569a0440f78332c909a033d Mon Sep 17 00:00:00 2001 From: Jim Graham Date: Wed, 24 Jul 2024 12:48:04 -0700 Subject: [PATCH] [Impeller] Use new DisplayList SaveLayer unbounded flag (flutter/engine#54085) Impeller had been disabling a save layer bounds optimization under certain conditions that were meant to imply that the layer was unbounded. The DisplayList now includes a flag indicating exactly when the layer is unbounded so we will now use that flag instead of an assumed implication to check for this condition. --- engine/src/flutter/impeller/display_list/dl_dispatcher.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/engine/src/flutter/impeller/display_list/dl_dispatcher.cc b/engine/src/flutter/impeller/display_list/dl_dispatcher.cc index fcd1f7aef9..3ecd5ef2dc 100644 --- a/engine/src/flutter/impeller/display_list/dl_dispatcher.cc +++ b/engine/src/flutter/impeller/display_list/dl_dispatcher.cc @@ -612,9 +612,6 @@ void DlDispatcherBase::save(uint32_t total_content_depth) { GetCanvas().Save(total_content_depth); } -static constexpr SkRect kMaxCullRect = - SkRect::MakeLTRB(-1E9F, -1E9F, 1E9F, 1E9F); - // |flutter::DlOpReceiver| void DlDispatcherBase::saveLayer(const SkRect& bounds, const flutter::SaveLayerOptions& options, @@ -626,9 +623,7 @@ void DlDispatcherBase::saveLayer(const SkRect& bounds, ? ContentBoundsPromise::kMayClipContents : ContentBoundsPromise::kContainsContents; std::optional impeller_bounds; - if (bounds == kMaxCullRect) { - impeller_bounds = std::nullopt; - } else { + if (!options.content_is_unbounded()) { impeller_bounds = skia_conversions::ToRect(bounds); }