<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CARenderer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CARenderer"
  },
  "title" : "CARenderer"
}
-->

# CARenderer

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

```
class CARenderer
```

## Overview

For real-time output you should use an instance of <doc://com.apple.documentation/documentation/AppKit/NSView> to host the layer-tree.

## Topics

### Creating a Renderer

[`+  rendererWithCGLContext:options:`](/documentation/QuartzCore/CARenderer/init(cglContext:options:)-1l3m2)

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

[`+  rendererWithMTLTexture:options:`](/documentation/QuartzCore/CARenderer/init(mtlTexture:options:)-1cr0b)

Creates a layer renderer from a Metal texture.

### Getting the Rendered Layer

[`layer`](/documentation/QuartzCore/CARenderer/layer)

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

### Determining Layer Bounds

[`bounds`](/documentation/QuartzCore/CARenderer/bounds)

The bounds of the receiver.

### Rendering a Frame

[`-  beginFrameAtTime:timeStamp:`](/documentation/QuartzCore/CARenderer/beginFrame(atTime:timeStamp:))

Begin rendering a frame at the specified time.

[`-  updateBounds`](/documentation/QuartzCore/CARenderer/updateBounds())

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

[`-  addUpdateRect:`](/documentation/QuartzCore/CARenderer/addUpdate(_:))

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

[`-  render`](/documentation/QuartzCore/CARenderer/render())

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

[`-  nextFrameTime`](/documentation/QuartzCore/CARenderer/nextFrameTime())

Returns the time at which the next update should happen.

[`-  endFrame`](/documentation/QuartzCore/CARenderer/endFrame())

Release any data associated with the current frame.

### Instance Methods

[`-  setDestination:`](/documentation/QuartzCore/CARenderer/setDestination(_:))

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)