forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fabric] Tint images using CIFilter fixing wrong tinted image size #1843
Merged
Saadnajmi
merged 2 commits into
microsoft:main
from
lenaic:fabric/improved-image-tinting
Jul 6, 2023
Merged
[Fabric] Tint images using CIFilter fixing wrong tinted image size #1843
Saadnajmi
merged 2 commits into
microsoft:main
from
lenaic:fabric/improved-image-tinting
Jul 6, 2023
Conversation
This file contains 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
Saadnajmi
reviewed
Jun 7, 2023
Saadnajmi
reviewed
Jun 7, 2023
Saadnajmi
approved these changes
Jun 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, might check with someone else before merging since CoreImage/CoreAnimation isn't my strong suite
lenaic
added a commit
to lenaic/react-native-macos
that referenced
this pull request
Aug 7, 2023
…icrosoft#1843) * Tint images using CIFilter to fix wrong image size when enabling tinting. * Initialize the CIFilter input values with default values. --------- Co-authored-by: Nick <lefever@meta.com>
Saadnajmi
pushed a commit
that referenced
this pull request
Aug 7, 2023
* [Fabric] Return active touch identifiers in surface touch handler on mouse up. (#1815) Co-authored-by: Nick <lefever@meta.com> * [Fabric] Add mandatory color space conversion for macOS. (#1813) Co-authored-by: Nick <lefever@meta.com> * [Fabric] Clean up hit testing now that RCTUIView extends RCTPlatformView (#1814) * Clean up surface touch handler now that RCTUIView extends RCTPlatformView. * Fix the iOS build. --------- Co-authored-by: Nick <lefever@meta.com> * [Fabric] Use the layout metrics to get the scale factor in component views. (#1816) * Use the layout metrics to get the scale factor in component views. * Use layout metrics pointScaleFactor instead of RCTScreenScale on iOS. --------- Co-authored-by: Nick <lefever@meta.com> * Fix RNTester content not resizing with window. (#1818) Co-authored-by: Nick <lefever@meta.com> * Fix wrong text offset when a line height is set. (#1819) Co-authored-by: Nick <lefever@meta.com> * [Fabric] Fix scroll views hiding content underneath them in Fabric. (#1820) * Fix scroll views hiding content underneath them in Fabric. * Clean up Paper scroll view after shim scroll view fix. --------- Co-authored-by: Nick <lefever@meta.com> * [Fabric] Add support for image content mode and tint features (#1828) * Add RCTUIImageView to RCTUIKit to support iOS features on macOS. * Add support for tint and resize mode to Image on Fabric. * Clean up logging and add macOS tag. * Fix code style to match the style guide. --------- Co-authored-by: Nick <lefever@meta.com> * [Fabric] Fix text input rendering crashing by using layout metrics pixelScaleFactor (#1817) * Use layout metrics to assign the active scale factor to RCTUITextField. * Use layout metrics to assign the active scale factor to RCTUITextView. --------- Co-authored-by: Nick <lefever@meta.com> * [Fabric] Tint images using CIFilter fixing wrong tinted image size (#1843) * Tint images using CIFilter to fix wrong image size when enabling tinting. * Initialize the CIFilter input values with default values. --------- Co-authored-by: Nick <lefever@meta.com> --------- Co-authored-by: Nick <lefever@meta.com>
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.
Please select one of the following
Summary
Implement image tinting using a CALayer with a compositing CIFilter instead of generating a tinted image. This fixes the wrong image aspect ratio of the generated tint image and removes the need to change the source image.
Changelog
[macOS] [FIXED] - Image tint renders the images with the correct size on fabric.
Test Plan
Tested by running RNTester on macOS with fabric (RCT_NEW_ARCH_ENABLED=1) and launching the Image example.
With the fix:
Without the fix: