Skip to content

Document Apple Graphite view APIs #214

Description

@mattleibow

Document the Apple-native Graphite view APIs added by mono/SkiaSharp#4745.

Platforms/namespaces:

  • iOS and Mac Catalyst: SkiaSharp.Views.iOS
  • macOS: SkiaSharp.Views.Mac
  • tvOS: SkiaSharp.Views.tvOS

Types:

  • SKGraphiteMetalView
  • SKPaintGraphiteSurfaceEventArgs
  • SKGraphiteRenderFailedEventArgs

SKPaintGraphiteSurfaceEventArgs also exposes:

public SKGraphiteRecorder? CreateRecorder();
public SKGraphiteRecorder? CreateRecorder(long recorderBudgetBytes);
public SKGraphiteInsertStatus InsertRecording(SKGraphiteRecording recording);

SKGraphiteRenderFailedEventArgs also exposes:

public SKGraphiteRenderFailedEventArgs(Exception exception, bool requiresContextRecreation);
public bool RequiresContextRecreation { get; }

The recorder helpers support Graphite's multi-recorder model: applications create independent worker-owned Recorders from the view's Context, record and snap work off the UI thread, then insert completed Recordings on the view/Context thread before the presentation Recording. Each helper-created Recorder owns an independent image cache and must be disposed before the view when RequiresContextRecreation is true.

Recovery follows Apple and Skia guidance: Metal device/queue objects remain long-lived for ordinary frame errors, while Graphite Context/Recorder state is recreated after Skia reports an unrecoverable insertion/submission failure. The view pauses and reports failure before recreation; retry is initiated by unpausing after dependent worker Recorders are disposed.

These APIs ship in the existing SkiaSharp.Views package and use Graphite over Metal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions