-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Add rects to accumulator rather than bounds #37435
Conversation
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: flutter/flutter#113251
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have submitted this review with "request changes", but it is too late as someone else already approved it.
@@ -672,7 +672,12 @@ void DisplayListBoundsCalculator::drawPicture(const sk_sp<SkPicture> picture, | |||
} | |||
void DisplayListBoundsCalculator::drawDisplayList( | |||
const sk_sp<DisplayList> display_list) { | |||
AccumulateOpBounds(display_list->bounds(), kDrawDisplayListFlags); | |||
const SkRect bounds = display_list->bounds(); | |||
std::list<SkRect> rects = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an expensive operation that must now be done on any bounds calculation whether or not it is attempting to accumulate an RTree. This option must be conditional.
std::list<SkRect> rects = | ||
display_list->rtree()->searchNonOverlappingDrawnRects(bounds); | ||
for (const SkRect& rect : rects) { | ||
AccumulateOpBounds(rect, kDrawDisplayListFlags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of kDrawDisplayListFlags here is problematic as it isn't clear if the attributes assigned to an entire display list apply to each individual rectangle.
For now, we don't apply any attributes, but in the future we might apply attributes and they can't necessarily be distributed like that. So, this works presently, but is a potential logic time bomb. Minimally a comment should be added to mention this discrepancy.
@iskakaushik sounds like this needs a revert to address @flar's concerns? |
yup, reverting now |
This reverts commit 306b0fe.
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: flutter/flutter#113251
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: flutter/flutter#113251
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: flutter/flutter#113251
* [Reland] Add rects to accumulator rather than bounds (#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: flutter/flutter#113251 * Add a test for nested display list rtree
…#37435) (flutter#37451)" This reverts commit f8048be. pre-emptively reverting flutter/flutter#114997 (comment) to unblock the roll.
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: flutter/flutter#113251
…lutter#37444) This reverts commit 306b0fe.
…lutter#37451) * [Reland] Add rects to accumulator rather than bounds (flutter#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: flutter/flutter#113251 * Add a test for nested display list rtree
…115008) * de0b58e82 clang-tidy: added the ability to shard jobs (flutter/engine#37265) * 8aefb8b61 Roll Dart SDK from d97d5ad98893 to b22b36c0f52e (1 revision) (flutter/engine#37400) * 2f043090f Roll Skia from aef6d301c0b5 to 0c8127b3dd7d (6 revisions) (flutter/engine#37402) * dc7cb20ad Fix boolean json property. (flutter/engine#37403) * 512fa40b6 Adding release_build:true property to windows builders. (flutter/engine#37397) * 0af87071f Add test for image readback (flutter/engine#37401) * c6f26e035 Update display_list_image_filter_unittests to be permit Skia roll (flutter/engine#37327) * 4e9e97b4b Roll Skia from 0c8127b3dd7d to 8b19fb0f57d4 (1 revision) (flutter/engine#37409) * 42c2940ff Pass the correct name for gclient variables in ci.yaml (flutter/engine#37429) * 2e2a2fd97 Revert "Roll Skia from 0c8127b3dd7d to 8b19fb0f57d4 (1 revision) (#37409)" (flutter/engine#37430) * 02cb78905 Roll Fuchsia Mac SDK from sa5bVGimNo3JwLV27... to d4l6A1aPw6Z0YjxmA... (flutter/engine#37432) * c24ae1872 [web] Use v8BreakIterator where possible (flutter/engine#37317) * 306b0fe9c Add rects to accumulator rather than bounds (flutter/engine#37435) * c76035429 Roll Dart SDK from b22b36c0f52e to c15cdb978761 (2 revisions) (flutter/engine#37437)
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: flutter/flutter#113251
…lutter#37444) This reverts commit 306b0fe.
…lutter#37451) * [Reland] Add rects to accumulator rather than bounds (flutter#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: flutter/flutter#113251 * Add a test for nested display list rtree
…lutter#115008) * de0b58e82 clang-tidy: added the ability to shard jobs (flutter/engine#37265) * 8aefb8b61 Roll Dart SDK from d97d5ad98893 to b22b36c0f52e (1 revision) (flutter/engine#37400) * 2f043090f Roll Skia from aef6d301c0b5 to 0c8127b3dd7d (6 revisions) (flutter/engine#37402) * dc7cb20ad Fix boolean json property. (flutter/engine#37403) * 512fa40b6 Adding release_build:true property to windows builders. (flutter/engine#37397) * 0af87071f Add test for image readback (flutter/engine#37401) * c6f26e035 Update display_list_image_filter_unittests to be permit Skia roll (flutter/engine#37327) * 4e9e97b4b Roll Skia from 0c8127b3dd7d to 8b19fb0f57d4 (1 revision) (flutter/engine#37409) * 42c2940ff Pass the correct name for gclient variables in ci.yaml (flutter/engine#37429) * 2e2a2fd97 Revert "Roll Skia from 0c8127b3dd7d to 8b19fb0f57d4 (1 revision) (flutter#37409)" (flutter/engine#37430) * 02cb78905 Roll Fuchsia Mac SDK from sa5bVGimNo3JwLV27... to d4l6A1aPw6Z0YjxmA... (flutter/engine#37432) * c24ae1872 [web] Use v8BreakIterator where possible (flutter/engine#37317) * 306b0fe9c Add rects to accumulator rather than bounds (flutter/engine#37435) * c76035429 Roll Dart SDK from b22b36c0f52e to c15cdb978761 (2 revisions) (flutter/engine#37437)
…lutter#115008) * de0b58e82 clang-tidy: added the ability to shard jobs (flutter/engine#37265) * 8aefb8b61 Roll Dart SDK from d97d5ad98893 to b22b36c0f52e (1 revision) (flutter/engine#37400) * 2f043090f Roll Skia from aef6d301c0b5 to 0c8127b3dd7d (6 revisions) (flutter/engine#37402) * dc7cb20ad Fix boolean json property. (flutter/engine#37403) * 512fa40b6 Adding release_build:true property to windows builders. (flutter/engine#37397) * 0af87071f Add test for image readback (flutter/engine#37401) * c6f26e035 Update display_list_image_filter_unittests to be permit Skia roll (flutter/engine#37327) * 4e9e97b4b Roll Skia from 0c8127b3dd7d to 8b19fb0f57d4 (1 revision) (flutter/engine#37409) * 42c2940ff Pass the correct name for gclient variables in ci.yaml (flutter/engine#37429) * 2e2a2fd97 Revert "Roll Skia from 0c8127b3dd7d to 8b19fb0f57d4 (1 revision) (flutter#37409)" (flutter/engine#37430) * 02cb78905 Roll Fuchsia Mac SDK from sa5bVGimNo3JwLV27... to d4l6A1aPw6Z0YjxmA... (flutter/engine#37432) * c24ae1872 [web] Use v8BreakIterator where possible (flutter/engine#37317) * 306b0fe9c Add rects to accumulator rather than bounds (flutter/engine#37435) * c76035429 Roll Dart SDK from b22b36c0f52e to c15cdb978761 (2 revisions) (flutter/engine#37437)
When the accumulator is an
RTreeBoundsAccumulator
rather than aRectBoundsAccumulator
just accumulating the bounds results in incorrect results as thertree
would need to be aware of the constituent non-overlapping rectangles. This would work fine forRectBoundsAccumulator
as it would just adjust its bounds based on the passed rects.Fixes: flutter/flutter#113251