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

Add image generator registry #25987

Merged
merged 10 commits into from
May 17, 2021
Merged

Add image generator registry #25987

merged 10 commits into from
May 17, 2021

Conversation

bdero
Copy link
Member

@bdero bdero commented May 6, 2021

This CL has the first part of a refactor for #17356 , which adds an engine registry for installing new ImageGenerators. In order to allow for optional support for subpixel image decoding, a Flutter-specific abstraction is needed (as SkImageGenerator does not offer an interface that can support this (whereas SkCodecImageGenerator does -- but platform-specific codecs and embedder-installed codecs won't require wrapping SkCodecs).

See also this relevant design doc.

Follow-up work will be to refactor ImageDescriptor to lookup generators from this registry, and to allow embedder writers to install codecs through the embedder API.

I'm still learning the ropes, so let me know if any of this is feels somewhat bananas and I'll be happy to address @chinmaygarde.

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 Hixie said 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.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

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

@bdero bdero requested a review from chinmaygarde May 6, 2021 20:30
@google-cla google-cla bot added the cla: yes label May 6, 2021
@bdero bdero force-pushed the bdero/codec-registry branch 2 times, most recently from 2aeb496 to b466828 Compare May 6, 2021 21:12
@MrBirb
Copy link

MrBirb commented May 6, 2021

I suppose you meant this #17356

@bdero
Copy link
Member Author

bdero commented May 6, 2021

@MrBirb Yes indeed, thanks!

@bdero bdero force-pushed the bdero/codec-registry branch from b466828 to 6e88015 Compare May 7, 2021 21:21
@bdero
Copy link
Member Author

bdero commented May 10, 2021

@chinmaygarde The build is passing other than tree, so I think this is ready for a first pass.

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

This is great. I could find no major issues. Just minor nits.


/// Keeps a priority-ordered registry of image generator builders to be used
/// when decoding images. This object must be created, accessed, and collected
/// on the UI thread (typically the engine or its runtime controller).
Copy link
Member

Choose a reason for hiding this comment

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

This bit of clarification on threading is great. Thanks.

@bdero bdero force-pushed the bdero/codec-registry branch from 6e88015 to e56ad99 Compare May 11, 2021 22:23
@@ -176,6 +176,12 @@ class DartIsolate : public UIDartState {
/// @param[in] io_manager The i/o manager.
/// @param[in] unref_queue The Skia unref queue.
/// @param[in] image_decoder The image decoder.
/// @param[in] image_generator_registry Cascading registry of image
Copy link
Contributor

Choose a reason for hiding this comment

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

Every time we add a new parameter to this my soul dies a little bit.

If you have any interest, it would be nice to resolve flutter/flutter#71620 so we don't have to keep updating the 10 or however many files this ends up touching every time we do this :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah, I agree this would be nice to make passing around all this shared state simpler. I'd prefer to do it in a simpler follow-up PR if you don't mind.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, definitely a separate PR

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

Overall seems to make sense, thanks for getting this moving!

@bdero bdero force-pushed the bdero/codec-registry branch from 469453e to 8667f36 Compare May 17, 2021 17:43
@bdero bdero force-pushed the bdero/codec-registry branch from 8667f36 to 3063a98 Compare May 17, 2021 17:55
@bdero
Copy link
Member Author

bdero commented May 17, 2021

This is ready for another review pass. (cc @chinmaygarde & @dnfield)

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 18, 2021
zanderso pushed a commit to flutter/flutter that referenced this pull request May 19, 2021
* 98068f1 fuchsia: Only send different ViewProperties (flutter/engine#26170)

* 5e487ba Roll Skia from c1f641104531 to 469531234936 (4 revisions) (flutter/engine#26197)

* 4cab492 Add image generator registry (flutter/engine#25987)

* c753c24 Roll Fuchsia Linux SDK from l6XmTSLnt... to AUWVgDkx6... (flutter/engine#26201)

* 75a7812 Reland outputs a json version of the package manifest. (flutter/engine#26163)

* b5dc598 Roll Skia from 469531234936 to 5b38536d76ae (7 revisions) (flutter/engine#26202)

* fb91366 [icu] Upgrade ICU to 69.1, the same commit used by Chromimum latest (flutter/engine#26200)

* 62e0951 Prepare to move --delete-tostring-package-uri option to Dart SDK (flutter/engine#26196)

* 156c2be Web ImageFilter.matrix support (flutter/engine#25982)

* c30de25 Roll Skia from 5b38536d76ae to 2fed9f62d29a (7 revisions) (flutter/engine#26206)

* 7ef42f1 Roll Fuchsia Mac SDK from KmSY84b_E... to 7WNQRHsHN... (flutter/engine#26207)

* 8bba964 Add more diagrams for deferred components docs, fix alignment of existing one (flutter/engine#26209)

* 391e22d Roll Dart SDK from 67be110b5ba8 to 510f26486328 (3 revisions) (flutter/engine#26212)

* fa62ce0 Roll Skia from 2fed9f62d29a to e8cd0a54041e (2 revisions) (flutter/engine#26213)

* 2029cba Roll Skia from e8cd0a54041e to 3d854bade6de (4 revisions) (flutter/engine#26216)

* 9cd3c64 Roll Fuchsia Linux SDK from AUWVgDkx6... to boele8geO... (flutter/engine#26217)

* 6ceab15 Roll Dart SDK from 510f26486328 to 13e329e614f2 (1 revision) (flutter/engine#26218)

* f90698a Roll Fuchsia Mac SDK from 7WNQRHsHN... to F5TX4MaEg... (flutter/engine#26220)

* b9d03fe Roll Skia from 3d854bade6de to 66125eac158d (1 revision) (flutter/engine#26221)

* 849ce7e Roll Dart SDK from 13e329e614f2 to 2eea032403e2 (1 revision) (flutter/engine#26222)

* ca89d69 Roll Skia from 66125eac158d to 5696bcd0f7f8 (1 revision) (flutter/engine#26223)

* db7a3dc fuchsia: Fix occlusion_hint handling (flutter/engine#26208)

* b875d99 Roll Skia from 5696bcd0f7f8 to bdfd77616177 (5 revisions) (flutter/engine#26224)

* b67caca Roll Skia from bdfd77616177 to fb8d20befa8f (1 revision) (flutter/engine#26225)

* 2398dea Revert Dart SDK to 67be110b5ba8fc84af5e7136389e52a13ccbc9d5 (flutter/engine#26232)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants