[ASDisplayNode] Use kCGBlendModeCopy in a Couple More Places (#2250)

* Use blend mode copy in a couple more places

* Add some tests
This commit is contained in:
Adlai Holler
2016-09-15 11:56:46 -07:00
committed by GitHub
parent 88d588d590
commit 1e86dcdbe2
5 changed files with 32 additions and 3 deletions

View File

@@ -677,7 +677,7 @@ extern asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(
[roundOutline addClip];
// Draw the original image
[originalImage drawAtPoint:CGPointZero];
[originalImage drawAtPoint:CGPointZero blendMode:kCGBlendModeCopy alpha:1];
// Draw a border on top.
if (borderWidth > 0.0) {
@@ -700,7 +700,7 @@ extern asimagenode_modification_block_t ASImageNodeTintColorModificationBlock(UI
// Set color and render template
[color setFill];
UIImage *templateImage = [originalImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[templateImage drawAtPoint:CGPointZero];
[templateImage drawAtPoint:CGPointZero blendMode:kCGBlendModeCopy alpha:1];
UIImage *modifiedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();