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

Conversation

@eyebrowsoffire
Copy link
Contributor

This API will help with situations in which the user has a browser resource that they want to transform into a ui.Image and render directly into the layer tree. Most browser resources can be converted to an ImageBitmap via the createImageBitmap API.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Aug 29, 2023
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #45256 at sha 4e60023

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.

LGTM

This should help make flutter_svg much better on web.

@dnfield
Copy link
Contributor

dnfield commented Aug 30, 2023

svg_image_bitmap_fragment_shader_sampler looks like it has artifacts to me, but I'm not sure if that's just how that test is supposed to work.

@eyebrowsoffire
Copy link
Contributor Author

svg_image_bitmap_fragment_shader_sampler looks like it has artifacts to me, but I'm not sure if that's just how that test is supposed to work.

That's actually the expected output of the shader. It's the "glitch" shader lifted from the next_gen_ui demo here https://github.com/flutter/samples/tree/main/next_gen_ui_demo


@JS('MakeLazyImageFromTextureSource')
external SkImage? _MakeLazyImageFromTextureSource(
external SkImage? _MakeLazyImageFromTextureSource1(
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if there's value in reusing the Dart SDK convention, but there the convention is for the number to refer to the argument count, so in this case it would be "2" and "3", instead of "1" and "2".

);
}

/// Creates a [ui.Image] from an ImageBitmap object.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: dartdoc likes it when there's one empty line between the first and the second paragraph (or between paragraphs in general).

/// See https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap
FutureOr<ui.Image> createImageFromImageBitmap(JSAny imageSource) {
if (!domInstanceOfString(imageSource, 'ImageBitmap')) {
throw Exception('Image source $imageSource is not an ImageBitmap!');
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be a ArgumentError.

nit: s/!/./

@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 30, 2023
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #45256 at sha 9d4206d

@eyebrowsoffire eyebrowsoffire merged commit aeab1b0 into flutter:main Aug 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 30, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 30, 2023
…133706)

flutter/engine@b63eee2...d37cef8

2023-08-30 [email protected] [web] Roll to most recent fallback font data (flutter/engine#45301)
2023-08-30 [email protected] Increase maximum length of function names from 30 to 60. (flutter/engine#45296)
2023-08-30 [email protected] Add an API in `ui_web` to create a `ui.Image` from an `ImageBitmap` (flutter/engine#45256)

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],[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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine will affect goldens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants