exp: golang.org/x/exp/shiny/driver/mtldriver/internal/coreanim Index | Files

package coreanim

import "golang.org/x/exp/shiny/driver/mtldriver/internal/coreanim"

Package coreanim provides access to Apple's Core Animation API (https://developer.apple.com/documentation/quartzcore).

This package is in very early stages of development. It's a minimal implementation with scope limited to supporting mtldriver.

It was copied from dmitri.shuralyov.com/gpu/mtl/example/movingtriangle/internal/ca.

Index

Package Files

coreanim.go

type Layer Uses

type Layer interface {
    // Layer returns the underlying CALayer * pointer.
    Layer() unsafe.Pointer
}

Layer is an object that manages image-based content and allows you to perform animations on that content.

Reference: https://developer.apple.com/documentation/quartzcore/calayer.

type MetalDrawable Uses

type MetalDrawable struct {
    // contains filtered or unexported fields
}

MetalDrawable is a displayable resource that can be rendered or written to by Metal.

Reference: https://developer.apple.com/documentation/quartzcore/cametaldrawable.

func (MetalDrawable) Drawable Uses

func (md MetalDrawable) Drawable() unsafe.Pointer

Drawable implements the mtl.Drawable interface.

func (MetalDrawable) Texture Uses

func (md MetalDrawable) Texture() mtl.Texture

Texture returns a Metal texture object representing the drawable object's content.

Reference: https://developer.apple.com/documentation/quartzcore/cametaldrawable/1478159-texture.

type MetalLayer Uses

type MetalLayer struct {
    // contains filtered or unexported fields
}

MetalLayer is a Core Animation Metal layer, a layer that manages a pool of Metal drawables.

Reference: https://developer.apple.com/documentation/quartzcore/cametallayer.

func MakeMetalLayer Uses

func MakeMetalLayer() MetalLayer

MakeMetalLayer creates a new Core Animation Metal layer.

Reference: https://developer.apple.com/documentation/quartzcore/cametallayer.

func (MetalLayer) Layer Uses

func (ml MetalLayer) Layer() unsafe.Pointer

Layer implements the Layer interface.

func (MetalLayer) NextDrawable Uses

func (ml MetalLayer) NextDrawable() (MetalDrawable, error)

NextDrawable returns a Metal drawable.

Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/1478172-nextdrawable.

func (MetalLayer) PixelFormat Uses

func (ml MetalLayer) PixelFormat() mtl.PixelFormat

PixelFormat returns the pixel format of textures for rendering layer content.

Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/1478155-pixelformat.

func (MetalLayer) SetDevice Uses

func (ml MetalLayer) SetDevice(device mtl.Device)

SetDevice sets the Metal device responsible for the layer's drawable resources.

Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/1478163-device.

func (MetalLayer) SetDisplaySyncEnabled Uses

func (ml MetalLayer) SetDisplaySyncEnabled(enabled bool)

SetDisplaySyncEnabled controls whether the Metal layer and its drawables are synchronized with the display's refresh rate.

Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/2887087-displaysyncenabled.

func (MetalLayer) SetDrawableSize Uses

func (ml MetalLayer) SetDrawableSize(width, height int)

SetDrawableSize sets the size, in pixels, of textures for rendering layer content.

Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/1478174-drawablesize.

func (MetalLayer) SetMaximumDrawableCount Uses

func (ml MetalLayer) SetMaximumDrawableCount(count int)

SetMaximumDrawableCount controls the number of Metal drawables in the resource pool managed by Core Animation.

It can set to 2 or 3 only. SetMaximumDrawableCount panics for other values.

Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/2938720-maximumdrawablecount.

func (MetalLayer) SetPixelFormat Uses

func (ml MetalLayer) SetPixelFormat(pf mtl.PixelFormat)

SetPixelFormat controls the pixel format of textures for rendering layer content.

The pixel format for a Metal layer must be PixelFormatBGRA8UNorm, PixelFormatBGRA8UNormSRGB, PixelFormatRGBA16Float, PixelFormatBGRA10XR, or PixelFormatBGRA10XRSRGB. SetPixelFormat panics for other values.

Reference: https://developer.apple.com/documentation/quartzcore/cametallayer/1478155-pixelformat.

Package coreanim imports 4 packages (graph) and is imported by 2 packages. Updated 2019-11-21 with GOOS=darwin. Refresh now. Tools for package owners.