Replace deprecated UIGraphicsBeginImageContextWithOptions with UIGraphicsImageRenderer#6285
Merged
auto-submit[bot] merged 2 commits intoflutter:mainfrom Mar 13, 2024
Merged
Conversation
e24413e to
8854f33
Compare
jmagman
commented
Mar 11, 2024
Comment on lines
54
to
59
Member
Author
There was a problem hiding this comment.
This code is new, and unrelated to the fix. If there is nothing to scale, return the original image instead of doing extra work.
…hicsImageRenderer
vashworth
reviewed
Mar 12, 2024
| XCTAssertEqual(scaledImage.size.height, scaledHeight); | ||
|
|
||
| // Check the corners. Format is "R G B A" | ||
| XCTAssertEqualObjects(ColorStringAtPixel(scaledImage, 0, 0), @"1 0.776471 0 1"); // yellow |
Contributor
There was a problem hiding this comment.
Nit: How about making these color string representations (e.g. @"1 0.776471 0 1") consts with descriptive names so they can be reused and seem less like a magic value?
Member
Author
There was a problem hiding this comment.
I can do that for the two tests that are the same. These exact values would changes based on how small the image is scaled.
vashworth
approved these changes
Mar 12, 2024
Contributor
vashworth
left a comment
There was a problem hiding this comment.
LGTM with a small suggestion
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Mar 14, 2024
…h UIGraphicsImageRenderer (flutter/packages#6285)
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Mar 14, 2024
flutter/packages@38711ac...b21c542 2024-03-14 pageli328@gmail.com Support overriding `ErrorWidget.builder` (flutter/packages#6302) 2024-03-13 engine-flutter-autoroll@skia.org Manual roll Flutter from 61812ca to 394269f (6 revisions) (flutter/packages#6320) 2024-03-13 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.1 to 4.1.2 (flutter/packages#6309) 2024-03-13 magder@google.com Replace deprecated UIGraphicsBeginImageContextWithOptions with UIGraphicsImageRenderer (flutter/packages#6285) 2024-03-13 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.24.6 to 3.24.7 (flutter/packages#6310) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@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://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
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UIGraphicsBeginImageContextWithOptionsisn't technically deprecated, butAPI_TO_BE_DEPRECATED. However, according to reports it's crashing in iOS 17. Replace usage withUIGraphicsImageRenderer, available in iOS 10.I kept introducing horizontal flipping bugs when I was writing this, but it wasn't causing test failures. Changed the test images from a single color to a gradient with different colors in each corner, then updated the tests to confirm the orientation is still correct.
Generated the test image with ImageMagick:
Also avoid doing extra work if there's nothing to scale, and return the original image.
Fixes flutter/flutter#144602