JoshDSommer / nativescript-ngx-shadow

Angular directive to apply shadows to native elements according to the elevation level guidelines of material design specification
Apache License 2.0
9 stars 6 forks source link

Better iOS Performance with shadowPath and rasterize #8

Closed edusperoni closed 5 years ago

edusperoni commented 6 years ago

This PR adds two extra options for iOS:

useShadowPath:

Defaults to true.

Determines whether shadowPath should be used. As per documentation:

the layer creates its shadow using the specified path instead of the layer’s composited alpha channel. Specifying an explicit path usually improves rendering performance.

rasterize:

Defaults to false.

You can rasterize any iOS view. It makes it so the rendered view gets saved in memory and then drawn. This increases memory usage but massively increases performance during movements and animations, for example.

As the memory increase is noticeable, it defaults to false.

Testing

I've done my fair amount of testing, but it'd be good to get a confirmation from others, as this changes the default behavior.

Fixes #7

patrick-nurt commented 5 years ago

@TheOriginalJosh can this be merged?

JoshDSommer commented 5 years ago

@edusperoni @patrick-nurt thank you for the reminder.

JoshDSommer commented 5 years ago

Published in 6.3.0