Question

The CGPath property of CAShapeLayer has the following sentence in it's documentation:

Specifying an explicit path usually improves rendering performance.

What is an "explicit" path? And how does setting an explicit path improve the render performance of a CAShapeLayer?

How is setting an explicit path more performant than no path?

No correct solution

OTHER TIPS

This looks like it might be a copy-paste error in the documentation—CALayer’s shadowPath property includes a similar block of text:

The default value of this property is nil, which causes the layer to use a standard shadow shape. If you specify a value for this property, the layer creates its shadow using the specified path instead of the layer’s composited alpha channel. The path you provide defines the outline of the shadow. It is filled using the non-zero winding rule and the current shadow color, opacity, and blur radius.

Specifying an explicit path usually improves rendering performance.

For shadowPath, there is actually a distinction: not specifying a value for the property causes the shadow to be calculated from the layer’s composited alpha. CAShapeLayer doesn’t do anything of the kind when it doesn’t have a path set, so the documentation you reference is misleading.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top