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

Conversation

@kjlubick
Copy link
Contributor

@kjlubick kjlubick commented Apr 20, 2023

Skia would like to remove SkImageGenerator::MakeFromEncoded and this appears to be the only remaining usage. It appears to be easily swapped out for the SkImages::DeferredFromEncodedData. (skbug.com/13052)

This also removes the use of the internal SkCodecImageGenerator for the public SkCodec API (which the image generator had just been deferring to anyway).

While unbreaking some unit tests, I made a few assertions easier to debug and produce nicer error messages.

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.

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 Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on 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.

@kjlubick
Copy link
Contributor Author

Looks like Skia will need to expose https://github.com/google/skia/blob/main/src/codec/SkPixmapUtils.h#L37 or something similar to make some of the tests like ImageDecoderTest.VerifySubpixelDecodingPreservesExifOrientation continue to pass, as that was something the SkCodecImageGenerator handled

@kjlubick
Copy link
Contributor Author

Hopefully I've found all the places where the SkCodecImageGenerator was transparently applying Exif metadata rotations and made them explicit on the Flutter-side.

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 with a couple style nits.

@chinmaygarde
Copy link
Member

I believe this is good to go. Rebasing to kick off CI which tripped on a timeout.

@chinmaygarde chinmaygarde added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 27, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 28, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Apr 28, 2023

auto label is removed for flutter/engine, pr: 41368, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@dnfield
Copy link
Contributor

dnfield commented Apr 28, 2023

The google failures are not because of this changed, filed b/280066465 and manually marked status.

zanderso added a commit that referenced this pull request Apr 28, 2023
…public versions" (#41595)

Reverts #41368

This is blocking rolls into the framework. Let's revert until we sort
out whether there's a workaround for the change to the unpremultiplied
alpha issue.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 28, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 28, 2023
…125714)

flutter/engine@98b6fab...2a84ea5

2023-04-28 zanderso@users.noreply.github.com Revert "Replace deprecated and internal Skia EncodedImage calls with public versions" (flutter/engine#41595)
2023-04-28 maruel@gmail.com Roll buildroot to c96c9d4641714301fab450a5f3b0f3c42712e1e3 (flutter/engine#41589)
2023-04-28 ychris@google.com [platform_view] Only dispose view when it is removed from the composition order (flutter/engine#41521)
2023-04-28 gspencergoog@users.noreply.github.com Determine lifecycle by looking at window focus also (flutter/engine#41094)
2023-04-28 zanderso@users.noreply.github.com Increase timeout for clang-tidy on mac (flutter/engine#41588)
2023-04-28 bdero@google.com [Impeller] Always enable validation for goldens (flutter/engine#41574)
2023-04-28 maruel@gmail.com fuchsia: do not read version_history.json (flutter/engine#41585)
2023-04-28 skia-flutter-autoroll@skia.org Roll Dart SDK from c7160d4ea0b7 to 8e9bf2bb9878 (5 revisions) (flutter/engine#41586)
2023-04-28 kjlubick@users.noreply.github.com Replace deprecated and internal Skia EncodedImage calls with public versions (flutter/engine#41368)
2023-04-28 skia-flutter-autoroll@skia.org Roll Skia from 05d09f28250a to 9867fa253064 (18 revisions) (flutter/engine#41584)

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 jsimmons@google.com,rmistry@google.com,zra@google.com 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
@kjlubick kjlubick mentioned this pull request May 1, 2023
8 tasks
jason-simmons pushed a commit that referenced this pull request May 1, 2023
This is a reland of #41368 with fix for transparent images and a unit
test to verify it.

Skia would like to remove `SkImageGenerator::MakeFromEncoded` and this
appears to be the only remaining usage. It appears to be easily swapped
out for the `SkImages::DeferredFromEncodedData`. (skbug.com/13052)

This also removes the use of the internal `SkCodecImageGenerator` for
the public `SkCodec` API (which the image generator had just been
deferring to anyway).

While unbreaking some unit tests, I made a few assertions easier to
debug and produce nicer error messages.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] 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.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
emerick added a commit to brave/brave-core that referenced this pull request May 1, 2023
Chromium change:

chromium/chromium@1cd1998

commit 1cd1998bdcf00f30ea443f0c1a9b91a298f571d4
Author: Kevin Lubick <kjlubick@google.com>
Date:   Fri Apr 21 09:59:05 2023 -0400

    Expose SkPixmapUtils

    SkPixmapUtils::Orient is a useful utility when dealing with exif data.

    See also flutter/engine#41368

    Bug: skia:13983
dnfield pushed a commit to timmaffett/engine that referenced this pull request May 1, 2023
This is a reland of flutter#41368 with fix for transparent images and a unit
test to verify it.

Skia would like to remove `SkImageGenerator::MakeFromEncoded` and this
appears to be the only remaining usage. It appears to be easily swapped
out for the `SkImages::DeferredFromEncodedData`. (skbug.com/13052)

This also removes the use of the internal `SkCodecImageGenerator` for
the public `SkCodec` API (which the image generator had just been
deferring to anyway).

While unbreaking some unit tests, I made a few assertions easier to
debug and produce nicer error messages.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] 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.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
cdesouza-chromium pushed a commit to brave/brave-core that referenced this pull request May 6, 2023
Chromium change:

chromium/chromium@1cd1998

commit 1cd1998bdcf00f30ea443f0c1a9b91a298f571d4
Author: Kevin Lubick <kjlubick@google.com>
Date:   Fri Apr 21 09:59:05 2023 -0400

    Expose SkPixmapUtils

    SkPixmapUtils::Orient is a useful utility when dealing with exif data.

    See also flutter/engine#41368

    Bug: skia:13983
emerick added a commit to brave/brave-core that referenced this pull request May 15, 2023
Chromium change:

chromium/chromium@1cd1998

commit 1cd1998bdcf00f30ea443f0c1a9b91a298f571d4
Author: Kevin Lubick <kjlubick@google.com>
Date:   Fri Apr 21 09:59:05 2023 -0400

    Expose SkPixmapUtils

    SkPixmapUtils::Orient is a useful utility when dealing with exif data.

    See also flutter/engine#41368

    Bug: skia:13983
@kjlubick kjlubick deleted the image-generator branch August 3, 2023 18:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants