From 7da29fea6723084091367f6944256a587fb675a9 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Wed, 9 Nov 2022 12:06:09 -0500 Subject: [PATCH] Revert "[Reland] Add rects to accumulator rather than bounds (#37435) (#37451)" This reverts commit f8048be39a7c1a3821d3e648122a5c12278b7610. pre-emptively reverting https://github.com/flutter/flutter/pull/114997#issuecomment-1309042590 to unblock the roll. --- display_list/display_list_unittests.cc | 20 -------------------- display_list/display_list_utils.cc | 18 +----------------- display_list/display_list_utils.h | 15 --------------- testing/scenario_app/run_ios_tests.sh | 2 ++ 4 files changed, 3 insertions(+), 52 deletions(-) diff --git a/display_list/display_list_unittests.cc b/display_list/display_list_unittests.cc index 2a9e5d7cf7e27..9ca2877a046a6 100644 --- a/display_list/display_list_unittests.cc +++ b/display_list/display_list_unittests.cc @@ -1650,26 +1650,6 @@ TEST(DisplayList, RTreeOfSaveLayerFilterScene) { test_rtree(rtree, {19, 19, 51, 51}, rects, {0, 1}); } -TEST(DisplayList, NestedDisplayListRTreesAreSparse) { - DisplayListBuilder nested_dl_builder; - nested_dl_builder.drawRect({10, 10, 20, 20}); - nested_dl_builder.drawRect({50, 50, 60, 60}); - auto nested_display_list = nested_dl_builder.Build(); - - DisplayListBuilder builder; - builder.drawDisplayList(nested_display_list); - auto display_list = builder.Build(); - - auto rtree = display_list->rtree(); - std::vector rects = { - {10, 10, 20, 20}, - {50, 50, 60, 60}, - }; - - // Hitting both sub-dl drawRect calls - test_rtree(rtree, {19, 19, 51, 51}, rects, {0, 1}); -} - TEST(DisplayList, RemoveUnnecessarySaveRestorePairs) { { DisplayListBuilder builder; diff --git a/display_list/display_list_utils.cc b/display_list/display_list_utils.cc index ff8ddd534dca5..391723ccd1d13 100644 --- a/display_list/display_list_utils.cc +++ b/display_list/display_list_utils.cc @@ -672,23 +672,7 @@ void DisplayListBoundsCalculator::drawPicture(const sk_sp picture, } void DisplayListBoundsCalculator::drawDisplayList( const sk_sp display_list) { - const SkRect bounds = display_list->bounds(); - switch (accumulator_.type()) { - case BoundsAccumulatorType::kRect: - AccumulateOpBounds(bounds, kDrawDisplayListFlags); - return; - case BoundsAccumulatorType::kRTree: - std::list rects = - display_list->rtree()->searchNonOverlappingDrawnRects(bounds); - for (const SkRect& rect : rects) { - // TODO (https://github.com/flutter/flutter/issues/114919): Attributes - // are not necessarily `kDrawDisplayListFlags`. - AccumulateOpBounds(rect, kDrawDisplayListFlags); - } - return; - } - - FML_UNREACHABLE(); + AccumulateOpBounds(display_list->bounds(), kDrawDisplayListFlags); } void DisplayListBoundsCalculator::drawTextBlob(const sk_sp blob, SkScalar x, diff --git a/display_list/display_list_utils.h b/display_list/display_list_utils.h index 406e852fbcae9..ff2bad1544fd7 100644 --- a/display_list/display_list_utils.h +++ b/display_list/display_list_utils.h @@ -337,11 +337,6 @@ class ClipBoundsDispatchHelper : public virtual Dispatcher, void intersect(const SkRect& clipBounds, bool is_aa); }; -enum class BoundsAccumulatorType { - kRect, - kRTree, -}; - class BoundsAccumulator { public: /// function definition for modifying the bounds of a rectangle @@ -398,8 +393,6 @@ class BoundsAccumulator { virtual bool restore( std::function map, const SkRect* clip = nullptr) = 0; - - virtual BoundsAccumulatorType type() const = 0; }; class RectBoundsAccumulator final : public virtual BoundsAccumulator { @@ -421,10 +414,6 @@ class RectBoundsAccumulator final : public virtual BoundsAccumulator { return rect_.bounds(); } - BoundsAccumulatorType type() const override { - return BoundsAccumulatorType::kRect; - } - private: class AccumulationRect { public: @@ -466,10 +455,6 @@ class RTreeBoundsAccumulator final : public virtual BoundsAccumulator { sk_sp rtree() const; - BoundsAccumulatorType type() const override { - return BoundsAccumulatorType::kRTree; - } - private: std::vector rects_; std::vector saved_offsets_; diff --git a/testing/scenario_app/run_ios_tests.sh b/testing/scenario_app/run_ios_tests.sh index af3a207ff05cc..d917015d35d1d 100755 --- a/testing/scenario_app/run_ios_tests.sh +++ b/testing/scenario_app/run_ios_tests.sh @@ -52,10 +52,12 @@ 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