-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[engine] changes to DlVertices::Builder and Stopwatch visualizer. #57031
[engine] changes to DlVertices::Builder and Stopwatch visualizer. #57031
Conversation
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.
Mostly looks good, but is there really caching going on?
flow/stopwatch_dl.cc
Outdated
auto const right = rect.GetRight(); | ||
auto const bottom = rect.GetBottom(); | ||
|
||
auto const vertices = std::array<DlPoint, 6>{ |
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.
Why make an array only to immediately turn around and copy the values into the vectors one by one? This could just be 6 lines of "vector_[index_++] = next point".
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.
Yeah good point, let me swap that out.
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.
Done
@@ -134,16 +137,22 @@ void PerformanceOverlayLayer::Paint(PaintContext& context) const { | |||
SkScalar width = paint_bounds().width() - (padding * 2); | |||
SkScalar height = paint_bounds().height() / 2; | |||
auto mutator = context.state_stack.save(); | |||
// Cached storage for vertex output. | |||
std::vector<DlPoint> vertices_storage; | |||
std::vector<DlColor> color_storage; |
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.
Weren't these supposed to be cached somewhere? It looks like they are recreated on every frame?
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.
Or is this just re-use between the 2 graphs?
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.
Just between the two graphs. originally I was much more ambitious but it turns out that we rebuild the layer each frame so there isn't a good place to put the storage.
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
…160126) flutter/engine@ba7ad87...b8034f1 2024-12-11 [email protected] Roll Dart SDK from be9c98daf9df to aa03dca5beb2 (1 revision) (flutter/engine#57136) 2024-12-11 [email protected] Make Felt unzip Chrome into a temporary directory next to the final location of the files (flutter/engine#57109) 2024-12-11 [email protected] [engine] changes to DlVertices::Builder and Stopwatch visualizer. (flutter/engine#57031) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Collection of changes to DlVertices::Builder and the stopwatch visualizer.
At a high level:
improve performance of the stopwatch visualizer by pre-allocating storage (and sharing it across both visualizers), lookup up font once, and cache the debug frame rate used. Updates to use Dl types instead of SkTypes.
Change DlVerticesBuilder to allow storing the bounds and use that in the visualizer, since we already know them. Make FML_CHECKS into dchecks, as the dart:ui vertices will already bounds check correctly - so these should only be necessary for debugging engine changes.