Commit 56bcd0c
authored
[google_maps_flutter_ios] Fix kCGImageAlphaPremultipliedLast implicit conversion from enumeration type (#9720)
[Docs for `CGBitmapContextCreate ` `bitmapInfo`](https://developer.apple.com/documentation/coregraphics/cgcontext/init(data:width:height:bitspercomponent:bytesperrow:space:bitmapinfo:)?language=objc) parameter say:
> The constants for specifying the alpha channel information are declared with the [CGImageAlphaInfo](https://developer.apple.com/documentation/coregraphics/cgimagealphainfo?language=objc) type but can be passed to this parameter safely. You can also pass the other constants associated with the [CGBitmapInfo](https://developer.apple.com/documentation/coregraphics/cgbitmapinfo?language=objc) type.
The docs still [show `kCGImageAlphaPremultipliedLast` being passed in directly](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_context/dq_context.html#//apple_ref/doc/uid/TP30001066-CH203-CJBHBFFE).
Instead of casting to `CGBitmapInfo` (which would also work I believe), use [`kCGBitmapAlphaInfoMask`](https://developer.apple.com/documentation/coregraphics/cgbitmapinfo/kcgbitmapalphainfomask).
Further explanation at inkling/Subliminal#23 (comment).
Tested here:
https://github.com/flutter/packages/blob/b2aef15c15a75ac6853dc1b79ee2ad2086934f58/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/GoogleMapsTests.m#L81
Fixes flutter/flutter#170440
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.1 parent 0727ed3 commit 56bcd0c
File tree
4 files changed
+10
-4
lines changed- packages/google_maps_flutter/google_maps_flutter_ios
- example/ios14/ios/RunnerTests
- ios/Classes
4 files changed
+10
-4
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments