Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@eyebrowsoffire
Copy link
Contributor

This is an attempt to reland #55468

We now defer actually drawing the pictures until the build of the layer slices, so that we can calculate an accurate cullRect for the picture recorder

This also contains a further optimization for the "simple" rendering case (no platform views) where we don't actually do any unnecessary occlusion calculations.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Oct 23, 2024
Copy link
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits. Also I suggest adding a regression test for the case that caused the original PR to be reverted


LayerSlice buildWithOperation(LayerOperation operation) {
final ui.Rect recorderRect = operation.mapRect(cullRect ?? ui.Rect.zero);
final (recorder, canvas) = debugRecorderFactory != null ? debugRecorderFactory!(recorderRect) : defaultRecorderFactory(recorderRect);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe worth pulling the logic to create a recorder (using either the debug factory or the default factory) into its own method

internalBootstrapBrowserTest(() => testMain);
}

void testMain() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a regression test for the bug which caused you to have to revert the original PR?

sliceIndex = 0;
final SceneSlice slice = sceneSlices[sliceIndex];
slice.platformViewOcclusionMap.addRect(globalPlatformViewRect);
print('placed platform view. localRect: $rect globalRect: $globalPlatformViewRect sliceIndex: $sliceIndex');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

Copy link
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 25, 2024
@auto-submit auto-submit bot merged commit 33f9064 into flutter:main Oct 25, 2024
28 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 26, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 26, 2024
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
This is an attempt to reland flutter/engine#55468

We now defer actually drawing the pictures until the build of the layer slices, so that we can calculate an accurate `cullRect` for the picture recorder

This also contains a further optimization for the "simple" rendering case (no platform views) where we don't actually do any unnecessary occlusion calculations.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants