From 00c12428374289e33f501f8e930283508a0cf9fe Mon Sep 17 00:00:00 2001 From: Jim Graham Date: Fri, 1 Sep 2023 17:53:19 -0700 Subject: [PATCH] Cull the RTree bounds when they are forwarded in DrawDisplayList (flutter/engine#45358) Fixes https://github.com/flutter/flutter/issues/133437 With this fix, the [benchmarks](https://github.com/flutter/flutter/pull/133434) for pictures with huge bounds become runnable under more conditions. Currently those benchmarks only run on platforms where we don't run into this issue. The performance on those platforms/conditions will not change much, but with this fix we can run them on Impeller and add a variant that has a platform view on the display. --- engine/src/flutter/display_list/dl_builder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/display_list/dl_builder.cc b/engine/src/flutter/display_list/dl_builder.cc index b78145c124..2906f9a85f 100644 --- a/engine/src/flutter/display_list/dl_builder.cc +++ b/engine/src/flutter/display_list/dl_builder.cc @@ -1225,7 +1225,7 @@ void DisplayListBuilder::DrawDisplayList(const sk_sp display_list, auto rtree = display_list->rtree(); if (rtree) { std::list rects = - rtree->searchAndConsolidateRects(bounds, false); + rtree->searchAndConsolidateRects(GetLocalClipBounds(), false); accumulated = false; for (const SkRect& rect : rects) { // TODO (https://github.com/flutter/flutter/issues/114919): Attributes