From 10da0743a513f0ae3ae5afb5a6bd99350b881989 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Tue, 8 Nov 2022 14:09:49 -0500 Subject: [PATCH] Add rects to accumulator rather than bounds (flutter/engine#37435) When the accumulator is an `RTreeBoundsAccumulator` rather than a `RectBoundsAccumulator` just accumulating the bounds results in incorrect results as the `rtree` would need to be aware of the constituent non-overlapping rectangles. This would work fine for `RectBoundsAccumulator` as it would just adjust its bounds based on the passed rects. Fixes: https://github.com/flutter/flutter/issues/113251 --- engine/src/flutter/display_list/display_list_utils.cc | 7 ++++++- engine/src/flutter/testing/scenario_app/run_ios_tests.sh | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/display_list/display_list_utils.cc b/engine/src/flutter/display_list/display_list_utils.cc index 391723ccd1..75b7ac632d 100644 --- a/engine/src/flutter/display_list/display_list_utils.cc +++ b/engine/src/flutter/display_list/display_list_utils.cc @@ -672,7 +672,12 @@ void DisplayListBoundsCalculator::drawPicture(const sk_sp picture, } void DisplayListBoundsCalculator::drawDisplayList( const sk_sp display_list) { - AccumulateOpBounds(display_list->bounds(), kDrawDisplayListFlags); + const SkRect bounds = display_list->bounds(); + std::list rects = + display_list->rtree()->searchNonOverlappingDrawnRects(bounds); + for (const SkRect& rect : rects) { + AccumulateOpBounds(rect, kDrawDisplayListFlags); + } } void DisplayListBoundsCalculator::drawTextBlob(const sk_sp blob, SkScalar x, diff --git a/engine/src/flutter/testing/scenario_app/run_ios_tests.sh b/engine/src/flutter/testing/scenario_app/run_ios_tests.sh index d917015d35..af3a207ff0 100755 --- a/engine/src/flutter/testing/scenario_app/run_ios_tests.sh +++ b/engine/src/flutter/testing/scenario_app/run_ios_tests.sh @@ -52,12 +52,10 @@ echo "Running simulator tests with Impeller" echo "" # Skip testFontRenderingWhenSuppliedWithBogusFont: https://github.com/flutter/flutter/issues/113250 -# Skip testOneOverlayAndTwoIntersectingOverlays: https://github.com/flutter/flutter/issues/113251 set -o pipefail && xcodebuild -sdk iphonesimulator \ -scheme Scenarios \ -destination 'platform=iOS Simulator,OS=13.0,name=iPhone 8' \ clean test \ FLUTTER_ENGINE="$FLUTTER_ENGINE" \ -skip-testing "ScenariosUITests/BogusFontTextTest/testFontRenderingWhenSuppliedWithBogusFont" \ - -skip-testing "ScenariosUITests/UnobstructedPlatformViewTests/testOneOverlayAndTwoIntersectingOverlays" \ INFOPLIST_FILE="Scenarios/Info_Impeller.plist" # Plist with FLTEnableImpeller=YES