-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Update ASPendingState backgroundColor type to UIColor #1592
Update ASPendingState backgroundColor type to UIColor #1592
Conversation
} | ||
|
||
- (void)setBackgroundColor:(UIColor *)newBackgroundColor | ||
{ | ||
_bridge_prologue_write; | ||
|
||
CGColorRef newBackgroundCGColor = [newBackgroundColor CGColor]; |
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.
Nit: Since newBackgroundCGColor
is always set below, let's leave it nil
at first.
Source/Private/_ASPendingState.mm
Outdated
@@ -18,7 +18,7 @@ | |||
|
|||
#define __shouldSetNeedsDisplay(layer) (flags.needsDisplay \ | |||
|| (flags.setOpaque && _flags.opaque != (layer).opaque)\ | |||
|| (flags.setBackgroundColor && !CGColorEqualToColor(backgroundColor, (layer).backgroundColor))) | |||
|| (flags.setBackgroundColor && [backgroundColor isEqual:[UIColor colorWithCGColor:(layer).backgroundColor]])) |
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.
|| (flags.setBackgroundColor && [backgroundColor isEqual:[UIColor colorWithCGColor:(layer).backgroundColor]])) | |
|| (flags.setBackgroundColor && ! [backgroundColor isEqual:[UIColor colorWithCGColor:(layer).backgroundColor]])) |
its new dynamic capabilties
96dd70c
to
5f06a7b
Compare
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.
LGTM!
…ing its new dynamic capabilties (#1592)
Given that UIColor is now a dynamic provider we can no longer rely on the fact that there is a 1:1 mapping between UIColor <-> CGColorRef.
I've updated the UIViewBridge and ASPendingState accordingly to use UIColor and translate to CGColorRef only when interacting with layers. This should preserve any dynamic capabilities we might need in the future when trying to re-render layer backed nodes.
Depends on #1588