-
Notifications
You must be signed in to change notification settings - Fork 6k
Fixed constness of display list storage. #52705
Conversation
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 "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use 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. |
…148137) flutter/engine@c0917b1...1ccd0c3 2024-05-10 [email protected] Fixed constness of display list storage. (flutter/engine#52705) 2024-05-10 [email protected] Revert "Various documentation improvements (#52600)" (flutter/engine#52709) 2024-05-10 [email protected] Manual roll Dart SDK from b7cad2edae4b to 01121c008f4d (3 revisions) (flutter/engine#52706) 2024-05-10 [email protected] [iOS] Fix App crash when use WebView with iOS VoiceOver (flutter/engine#52484) 2024-05-09 [email protected] Various documentation improvements (#52600) (flutter/engine#52623) 2024-05-09 [email protected] [web] scale semantic text elements to match the desired focus ring size (flutter/engine#52586) 2024-05-09 [email protected] [Impeller] Adds impeller display list golden tests (flutter/engine#52690) 2024-05-09 [email protected] Roll buildroot to 70a42312a688 (flutter/engine#52675) 2024-05-09 [email protected] When `et` is not attached to a terminal, still split lines for status updates. (flutter/engine#52681) 2024-05-09 [email protected] updated analysis exclusion (flutter/engine#52699) 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
@@ -309,6 +311,8 @@ class DisplayList : public SkRefCnt { | |||
return modifies_transparent_black_; | |||
} | |||
|
|||
const DisplayListStorage& GetStorage() const { return 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.
Is this a public method on DisplayList? What is it used for? The storage is supposed to be internal only.
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.
Now that storage is immutable there is no harm making it public. This PR was pulled out from #52715 which stores the display list. It allows people to author tools that inspect the display list.
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 storage has always been immutable in practice (except for the one mutable field in it which will survive these changes because a mutable field is not disabled by a const cast) due to not being exposed. Exposing the buffer as a const pointer would not require such extensive changes and would have had the same external effect. But, I don't want to see this exposed in any case, because...
The harm by making it public is to invite the concept that the data within it is meaningful in any way outside of the DL implementation itself. The implementation can and does change frequently, so the stream of data is not meaningful in any lasting (or even temporary) manner. By exposing it, it's as if we're promising reusability or meaningfulness for the data that is exposed and both of those are (while not stated in the doc comments) deliberately not supported.
This is not a substitute for a serialization/readback mechanism and isn't really useful as a manual inspection tool especially in light of the fact that there exists a supported pretty printing tool for DisplayLists in
engine/testing/display_list_testing.h
Line 33 in 900ca9a
extern std::ostream& operator<<(std::ostream& os, |
Previously you could have a const DisplayListStorage and still have access to editing it. This fixes that.
testing: refactor only
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.