-
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
Improve no-copy rendering experiment, remove +load method #771
Conversation
@@ -143,8 +143,9 @@ CGFloat ASScreenScale() | |||
static CGFloat __scale = 0.0; | |||
static dispatch_once_t onceToken; | |||
dispatch_once(&onceToken, ^{ | |||
ASDisplayNodeCAssertMainThread(); | |||
__scale = [[UIScreen mainScreen] scale]; | |||
UIGraphicsBeginImageContextWithOptions(CGSizeMake(1, 1), YES, 0); |
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.
@Adlai-Holler as an extra measure of safety, could you add a unit test that verifies the equality of [[UIScreen mainScreen] scale] with ASScreenScale()?
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.
Good call, done.
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
* Improve graphics contexts experiment * Update changelog * Remove extra space * Add a unit test for screen scale * Fix typo and use unique value
…up#771) * Improve graphics contexts experiment * Update changelog * Remove extra space * Add a unit test for screen scale * Fix typo and use unique value
This PR achieves the following:
+load
method by changingASScreenScale
to useUIGraphics
which is thread-safe.