Skip to content
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

Fix regression where InvertedMatteLayers wouldn't animate #1684

Merged
merged 7 commits into from
Aug 1, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ final class InvertedMatteLayer: CALayer, CompositionLayerDelegate {
let wrapperLayer = CALayer()

func frameUpdated(frame _: CGFloat) {
setNeedsDisplay()
displayIfNeeded()
}

Expand Down
1 change: 1 addition & 0 deletions Tests/Samples/Issues/issue_1664.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Tests/Samples/Issues/issue_1683.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"v":"5.5.3","fr":60,"ip":0,"op":180,"w":800,"h":800,"nm":"Animation_2","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[1000,1000,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[-225,63.5],[-225,76.875],[-206.5,76.875],[-206.25,51.875]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.804000016755,0.136999990426,0.136999990426,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":116,"s":[0]},{"t":117,"s":[100]}],"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 4","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-6,-36.75],[-18.5,0],[-0.25,32.25]],"o":[[6,36.75],[18.5,0],[0.151,-19.499]],"v":[[56,69.75],[105.5,111.5],[151.75,64.5]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":29,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.2],"y":[1]},"o":{"x":[0.6],"y":[0]},"t":55,"s":[0]},{"t":60,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":4,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 3","np":4,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-24.25,-10.75],[-2.375,49.375]],"o":[[24.25,10.75],[1.715,-35.656]],"v":[[-126.25,107],[-56.625,60.625]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":29,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.2],"y":[1]},"o":{"x":[0.6],"y":[0]},"t":39,"s":[0]},{"t":50,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":4,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 2","np":4,"cix":2,"bm":0,"ix":3,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[-1.627,31.458],[-22.499,0.149],[0.5,-33],[0,0],[-44.5,0],[0,0],[0,0],[0.866,24.74],[85.75,0],[64.999,0.286],[0,-60.671],[6.23,-81.799],[0,0],[0,0]],"o":[[0,0],[0,0],[1.5,-29],[18.875,-0.125],[28,0],[0,0],[47,0],[0,0],[0,0],[-1.259,-35.981],[0,-52.75],[-56.75,-0.25],[-38.835,0],[-0.744,9.771],[0,0],[0,0]],"v":[[-222.5,232.25],[-129,104.5],[-151,61.5],[-103.875,15.125],[-56.813,63.5],[55.5,64.5],[102,15.5],[152,64],[224.5,64.76],[217.634,18.76],[113.25,-60],[-3,-158],[-120,-60.75],[-217.23,22.799],[-222.75,64],[-178.125,64.625]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.2],"y":[1]},"o":{"x":[0.6],"y":[0]},"t":-1,"s":[0]},{"t":149,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[1,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":29,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":4,"cix":2,"bm":0,"ix":4,"mn":"ADBE Vector Group","hd":false}],"ip":-1,"op":179,"st":-1,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"logo copy 3 Outlines 2","tt":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[1000,1000,0],"ix":2},"a":{"a":0,"k":[1000,1000,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[18.978,0],[0,19.541],[-18.979,0],[0,-19.542]],"o":[[-18.979,0],[0,-19.542],[18.978,0],[0,19.541]],"v":[[103.222,77.646],[68.806,42.211],[103.222,6.77],[137.639,42.211]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[18.979,0],[0,19.541],[-18.978,0],[0,-19.542]],"o":[[-18.978,0],[0,-19.542],[18.979,0],[0,19.541]],"v":[[-103.667,77.646],[-138.083,42.211],[-103.667,6.77],[-69.25,42.211]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[44.141,7.266],[2.746,0.483],[57.839,0],[7.164,-59.608],[1.928,-0.256],[-6.846,-125.192],[0,0],[0,0],[0,0],[0,0],[-41.028,5.491],[-5.582,0.984],[0,0],[0,0],[-49.934,0],[0,-46.964],[0,0],[0,0],[-6.427,-1.059],[1.399,-84.141],[0,0],[29.008,0],[5.931,-27.719],[0,0],[29.008,0],[0,-34.002],[-10.728,-11.128],[0,0],[0,0],[0,0],[-7.532,0],[-5.932,27.714],[0,0],[-29.008,0],[-5.932,27.714],[0,0],[0,0]],"o":[[-2.891,-0.478],[-7.255,-57.902],[-58.7,0],[-1.918,0.268],[-44.879,6.004],[0,0],[0,0],[0,0],[0,0],[-2.129,-88.983],[5.725,-0.763],[0,0],[0,0],[0,-48.523],[48.91,0],[0,0],[0,0],[6.368,1.4],[41.709,6.863],[0,0],[-5.931,-27.719],[-29.008,0],[0,0],[-5.931,-27.719],[-33.434,0],[0,16.775],[0,0],[0,0],[0,0],[6.661,2.565],[29.007,0],[0,0],[5.932,27.714],[29.007,0],[0,0],[0,0],[6.535,-119.462]],"v":[[134.233,-93.753],[125.781,-95.176],[-3.374,-192.518],[-132.324,-96.519],[-138.094,-95.74],[-231.98,42.928],[-231.302,55.322],[-181.513,55.322],[-181.513,29.1],[-206.29,29.1],[-134.618,-69.75],[-117.606,-72.266],[-106.774,-74.178],[-106.774,-85.178],[-3.374,-166.296],[100.24,-84.239],[100.24,-73.7],[110.533,-71.435],[129.973,-67.878],[206.559,29.1],[162.448,29.1],[103.222,-19.452],[43.995,29.1],[-44.44,29.1],[-103.667,-19.452],[-164.305,42.211],[-146.935,85.328],[-213.434,176.395],[-192.848,192.518],[-125.045,99.835],[-103.667,103.869],[-44.44,55.322],[43.995,55.322],[103.222,103.869],[162.448,55.322],[231.615,55.322],[232.292,42.928]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.804000016755,0.136999990426,0.136999990426,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[999.887,1021.629],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"Pre-comp 1","td":1,"refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2},"a":{"a":0,"k":[1000,1000,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":2000,"h":2000,"ip":0,"op":180,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"logo copy 3 Outlines 2","tt":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[150.5,688.75,0],"ix":2},"a":{"a":0,"k":[750.5,1288.75,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[-50.169,0],[0,157.334],[164.526,0],[0,-157.333],[-54.049,-51.516]],"o":[[0,0],[0,0],[41.567,20.645],[165.813,0],[0,-158.317],[-165.814,0],[0,78.435],[0,0]],"v":[[-192.929,214.101],[-249.102,288.997],[-138.991,248.375],[0.001,280.758],[300.233,-4.119],[0.001,-288.997],[-300.232,-4.119],[-212.766,196.853]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.717999985639,0.804000016755,0.136999990426,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1000,1000],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
4 changes: 4 additions & 0 deletions Tests/SnapshotConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ extension SnapshotConfiguration {
]),
]),

"Issues/issue_1664": .customValueProviders([
AnimationKeypath(keypath: "**.base_color.**.Color"): ColorValueProvider(.black),
]),

// Test cases for `AnimatedImageProvider`
"Nonanimating/_dog": .customImageProvider(HardcodedImageProvider(imageName: "Samples/Images/dog.png")),

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Does not support Core Animation engine. Encountered compatibility issues:
[root layer] The Core Animation rendering engine currently only supports `MatteMode.add`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Does not support Core Animation engine. Encountered compatibility issues:
[root layer] The Core Animation rendering engine currently only supports `MatteMode.add`.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.