-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Reland DlAiksCanvas, again. #45386
Conversation
This reverts commit 7a2eaf4.
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.
LGTM, but also building locally to test on wonderous
This needs to pull in latest main |
This comment was marked as resolved.
This comment was marked as resolved.
It looks like opacity isn't working in a number of cases. This might be a paint pass delegate issue? or some case where the subpass expects the parent to apply the opacity but it doesn't? Also see the gallery app, the shrine transitions and page transitions don't show any opacity. |
Something funky with the page transitions too: foo.mp4 |
The Perf overlay was unrelated, I'll help look at the opacity issues next week. |
One possibility is that the picture is supposed to be drawn iwth opacity and right now we're always treating it as one in the DrawImpellerPicture call.. |
There were some other regressions on the tessellation benchmarks on this change too. I think this is generally related to us computing the bounds of paths many times, so I opened #45456 to address that. |
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.
Please don't land this until we verify all of the correctness issues
Ah, misunderstood what correctness issues remained. Are there any issues filed? |
Still trying to figure it out, but I think entitypass clone is still buggy |
I verified this locally and found it might have been due to an interaction with the DL split, but trying again on ToT I don't see any issues. |
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.
LGTM
Actually we just found one issue. Investigating. |
Looking at wonderous, the icon in the top left is fading out the text too soon/too late on the main page - the advanced blends also look off. This could be an issue with |
Conversion of SkTextBlobs to impeller::TextFrame objects is one of the most expensive operations in display list dispatching. While the rest of the engine and framework makes a reasonable attempt to cache the SkTextBlobs generated during paragraph construction, the design of the dl dispatcher means that these the Impeller backend will always reconstruct all text frames on each frame - even if the display list/picture that contained those text frames was unchanged. Removing this overhead is one of the goals of #45386 , however this patch is also fairly risky and will be difficult to land. As a more incremental solution, we can instead construct the impeller::TextFrame objects when performing paragraph painting and record them in the display list. This both moves the text frame construction to the UI thread and allows the framework/engine to cache unchanged text frames. This also does not conflict with the dl_aiks_canvas patch directly, and is fine to land before or after it does. (though I'd argue we should land this first). To compare the current performance levels, I ran the complex_layout_scroll perf test, since this is fairly text filled. On a Pixel 6 pro. Across several runs this is a fairly consistent ~1ms raster time improvement. ### Skia ``` "average_frame_build_time_millis": 1.497333333333333, "90th_percentile_frame_build_time_millis": 2.038, "99th_percentile_frame_build_time_millis": 17.686, "worst_frame_build_time_millis": 23.095, "missed_frame_build_budget_count": 3, "average_frame_rasterizer_time_millis": 5.5078589743589745, "stddev_frame_rasterizer_time_millis": 2.226343414420338, "90th_percentile_frame_rasterizer_time_millis": 7.481, "99th_percentile_frame_rasterizer_time_millis": 19.11, "worst_frame_rasterizer_time_millis": 79.799, "missed_frame_rasterizer_budget_count": 7, "frame_count": 234, "frame_rasterizer_count": 234, "new_gen_gc_count": 10, "old_gen_gc_count": 2, ``` ### Impeller (ToT) ``` "average_frame_build_time_millis": 1.431575000000001, "90th_percentile_frame_build_time_millis": 2.196, "99th_percentile_frame_build_time_millis": 14.486, "worst_frame_build_time_millis": 23.728, "missed_frame_build_budget_count": 2, "average_frame_rasterizer_time_millis": 6.536087499999999, "stddev_frame_rasterizer_time_millis": 1.9902712500000004, "90th_percentile_frame_rasterizer_time_millis": 9.705, "99th_percentile_frame_rasterizer_time_millis": 14.727, "worst_frame_rasterizer_time_millis": 17.838, "missed_frame_rasterizer_budget_count": 1, "frame_count": 240, "frame_rasterizer_count": 240, "new_gen_gc_count": 10, "old_gen_gc_count": 2, ``` ### Impeller (Patched) ``` "average_frame_build_time_millis": 1.4500167364016743, "90th_percentile_frame_build_time_millis": 2.478, "99th_percentile_frame_build_time_millis": 14.883, "worst_frame_build_time_millis": 18.782, "missed_frame_build_budget_count": 1, "average_frame_rasterizer_time_millis": 5.023033333333336, "stddev_frame_rasterizer_time_millis": 1.6445388888888894, "90th_percentile_frame_rasterizer_time_millis": 7.814, "99th_percentile_frame_rasterizer_time_millis": 13.497, "worst_frame_rasterizer_time_millis": 15.008, "missed_frame_rasterizer_budget_count": 0, "frame_count": 239, "frame_rasterizer_count": 240, "new_gen_gc_count": 8, "old_gen_gc_count": 0, ```
Due to flutter/flutter#127500 , we can get in a state where enable-impeller is true but we're using Skia. We need to either fall back completely to Skia, make this configuration fatal, or remote the check ---------------- Conversion of SkTextBlobs to impeller::TextFrame objects is one of the most expensive operations in display list dispatching. While the rest of the engine and framework makes a reasonable attempt to cache the SkTextBlobs generated during paragraph construction, the design of the dl dispatcher means that these the Impeller backend will always reconstruct all text frames on each frame - even if the display list/picture that contained those text frames was unchanged. Removing this overhead is one of the goals of #45386 , however this patch is also fairly risky and will be difficult to land. As a more incremental solution, we can instead construct the impeller::TextFrame objects when performing paragraph painting and record them in the display list. This both moves the text frame construction to the UI thread and allows the framework/engine to cache unchanged text frames. This also does not conflict with the dl_aiks_canvas patch directly, and is fine to land before or after it does. (though I'd argue we should land this first). To compare the current performance levels, I ran the complex_layout_scroll perf test, since this is fairly text filled. On a Pixel 6 pro. Across several runs this is a fairly consistent ~1ms raster time improvement. Fixes flutter/flutter#133204
Due to flutter/flutter#127500 , we can get in a state where enable-impeller is true but we're using Skia. We need to either fall back completely to Skia, make this configuration fatal, or remote the check ---------------- Conversion of SkTextBlobs to impeller::TextFrame objects is one of the most expensive operations in display list dispatching. While the rest of the engine and framework makes a reasonable attempt to cache the SkTextBlobs generated during paragraph construction, the design of the dl dispatcher means that these the Impeller backend will always reconstruct all text frames on each frame - even if the display list/picture that contained those text frames was unchanged. Removing this overhead is one of the goals of #45386 , however this patch is also fairly risky and will be difficult to land. As a more incremental solution, we can instead construct the impeller::TextFrame objects when performing paragraph painting and record them in the display list. This both moves the text frame construction to the UI thread and allows the framework/engine to cache unchanged text frames. This also does not conflict with the dl_aiks_canvas patch directly, and is fine to land before or after it does. (though I'd argue we should land this first). To compare the current performance levels, I ran the complex_layout_scroll perf test, since this is fairly text filled. On a Pixel 6 pro. Across several runs this is a fairly consistent ~1ms raster time improvement. Fixes flutter/flutter#133204
This pretty stale, going to close for now. |
This is a partial revert of #45326.
The DlAiksCanvas implementation was reverted there because it caused merge conflicts. I've fixed those up.
This did introduce some regressions that are fixed by #45313
This also depends on #45355 to avoid dangling pointer issues with
DrawVertices
.