Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Do not merge this version into `stable`. # DO NOT CHANGE THIS FILE
snapshot_test_goldens/**/*.png filter=lfs diff=lfs merge=lfs -text # DO NOT EDIT THE LINE BELOW.
.gitattributes merge=gitattributes
snapshot_test_goldens/**/*.png filter=lfs diff=lfs merge=lfs -text
# .gitattributes merge=gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ - (CALayer *)layerCombiningHorizontalGradient:(CAGradientLayer *)horizontalGradi
return layer;
}

- (UIImage *)createImageWithLayer:(CALayer *)layer {
UIGraphicsBeginImageContext(layer.frame.size);
[layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;

//Replace deprecated UIGraphicsBeginImageContext with UIGraphicsImageRenderer in createImageWithLayer
- (UIImage *)createImageWithLayer:(CALayer *)layer{
UIGraphicsImageRenderer *render = [[UIGraphicsImageRenderer alloc] initWithSize:layer.frame.size];
UIImage *image = [render imageWithActions:^(UIGraphicsImageRendererContext *context){
[layer renderInContext:context.CGContext];
}];
return image;
}

- (CALayer *)createLayerWithImage:(UIImage *)image {
Expand Down