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

Fixed constness of display list storage. #52705

Merged
merged 1 commit into from
May 10, 2024

Conversation

gaaclarke
Copy link
Member

Previously you could have a const DisplayListStorage and still have access to editing it. This fixes that.

testing: refactor only

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

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.

@gaaclarke gaaclarke requested review from chinmaygarde and flar May 9, 2024 22:56
@gaaclarke gaaclarke merged commit 1ccd0c3 into flutter:main May 10, 2024
26 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 10, 2024
zanderso pushed a commit to flutter/flutter that referenced this pull request May 10, 2024
…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_; }
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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

extern std::ostream& operator<<(std::ostream& os,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants