Class

CARenderer

A layer that allows an application to render a layer tree into a Core OpenGL context.

Declaration

class CARenderer : NSObject

Overview

For real-time output you should use an instance of NSView to host the layer-tree.

Topics

Creating a Renderer

init(cglContext: UnsafeMutableRawPointer, options: [AnyHashable : Any]?)

Creates and returns a CARenderer instance with the render target specified by the Core OpenGL context.

Deprecated
init(mtlTexture: MTLTexture, options: [AnyHashable : Any]?)

Creates a layer renderer from a Metal texture.

Getting the Rendered Layer

var layer: CALayer?

The root layer of the layer-tree the receiver should render.

Determining Layer Bounds

var bounds: CGRect

The bounds of the receiver.

Rendering a Frame

func updateBounds() -> CGRect

Returns the bounds of the update region that contains all pixels that will be rendered by the current frame.

func addUpdate(CGRect)

Adds the rectangle to the update region of the current frame.

func render()

Render the update region of the current frame to the target context.

func nextFrameTime() -> CFTimeInterval

Returns the time at which the next update should happen.

func endFrame()

Release any data associated with the current frame.

Relationships

Inherits From

Conforms To

See Also

Metal and OpenGL

class CAMetalLayer

A layer that manages a pool of Metal drawables.

protocol CAMetalDrawable

A displayable resource that can be rendered or written to by Metal.

class CAEAGLLayer

A layer that supports drawing OpenGL content in iOS and tvOS applications.

Deprecated
class CAEDRMetadata

Metadata describing how extended dynamic range (EDR) values should be tone mapped.

Beta
class CAOpenGLLayer

A layer that provides a layer suitable for rendering OpenGL content.

Deprecated