Documentation
¶
Overview ¶
Package render defines the renderer interface that the software, GLES and Vulkan renderers implement.
Index ¶
- Constants
- func CheckDraw(texture image.Point, src FRect, transform Transform, alpha float32, m Mask) error
- func CheckGlass(texture image.Point, src FRect, alpha float32, m Mask, g Glass) error
- func CheckGradient(g Gradient, m Mask) error
- func CheckPixels(size image.Point, stride, n int) error
- func CheckRows(size image.Point, stride, n int, rows Rows) error
- func CheckUpdate(size image.Point, dst image.Rectangle, stride, n int) error
- func DrawEffects(p Pass, e Effects)
- func SoftwareDevice(name string) bool
- func TransformNames() []string
- type AlphaCut
- type AsyncReadTarget
- type AsyncReader
- type Axis
- type Border
- type BorderStops
- type Color
- type ColorTransform
- type Counts
- type Effects
- type FRect
- type Falloff
- type Format
- type Glass
- type Goo
- type Gradient
- type LostPass
- func (LostPass) Clear(Color)
- func (LostPass) ClearCut()
- func (LostPass) DrawGlass(Texture, FRect, image.Rectangle, float32, Mask, Glass)
- func (LostPass) DrawScreenShader(ScreenShader, Texture, image.Rectangle, float32)
- func (LostPass) DrawTexture(Texture, FRect, image.Rectangle, Transform, float32, Mask)
- func (LostPass) End() error
- func (LostPass) FillGoo(image.Rectangle, Color, Goo)
- func (LostPass) FillGradient(image.Rectangle, Gradient, Mask)
- func (LostPass) FillRect(image.Rectangle, Color, Mask)
- func (LostPass) Kawase(Texture, image.Rectangle, float32, bool)
- func (LostPass) SetColor(*ColorTransform)
- func (LostPass) SetCut(Texture, AlphaCut)
- type LostRead
- type Mask
- type NamedDevice
- type OffThreadBuilder
- type Pass
- type PendingRead
- type ReadTarget
- type Region
- type Renderer
- type RoundRect
- type Rows
- type ScreenShader
- type Speed
- type Target
- type Texture
- type TextureTarget
- type Transform
- func (t Transform) Axes() (horizontal, vertical Axis)
- func (t Transform) FRect(r FRect, size image.Point) FRect
- func (t Transform) Invert() Transform
- func (t Transform) Point(p, size image.Point) image.Point
- func (t Transform) Rect(r image.Rectangle, size image.Point) image.Rectangle
- func (t Transform) Size(size image.Point) image.Point
- func (t Transform) String() string
- func (t Transform) SwapsAxes() bool
- func (t Transform) Unit(x, y float64) (float64, float64)
Constants ¶
const MaxBorderColors = 10
Variables ¶
This section is empty.
Functions ¶
func CheckGlass ¶
func CheckGradient ¶
func DrawEffects ¶
func SoftwareDevice ¶
func TransformNames ¶
func TransformNames() []string
Types ¶
type AsyncReadTarget ¶
type AsyncReadTarget interface {
ReadTarget
ReadAsync() (PendingRead, error)
}
type AsyncReader ¶
type AsyncReader interface {
AsyncReads() bool
NewAsyncTarget(size image.Point) (AsyncReadTarget, error)
}
type Border ¶
type Border struct {
// contains filtered or unexported fields
}
func SolidBorder ¶
func (Border) Stops ¶
func (b Border) Stops() BorderStops
type BorderStops ¶
type BorderStops struct {
// contains filtered or unexported fields
}
type Color ¶
type Color struct {
R, G, B, A uint8
}
func (Color) Premultiplied ¶
func (Color) Premultiply ¶
type ColorTransform ¶
type ColorTransform = lgpu.ColorTransform
type Effects ¶
type Effects struct {
Textures []Texture
Stops Texture
Sources []Texture
Cut Texture
Color *ColorTransform
}
type LostPass ¶
type LostPass struct{}
func (LostPass) DrawScreenShader ¶
func (LostPass) DrawTexture ¶
func (LostPass) SetColor ¶
func (LostPass) SetColor(*ColorTransform)
type LostRead ¶
func NewLostRead ¶
type NamedDevice ¶
type NamedDevice interface {
DeviceName() string
}
type OffThreadBuilder ¶
type OffThreadBuilder interface {
BuildOffThread() error
}
type Pass ¶
type Pass interface {
SetColor(t *ColorTransform)
SetCut(t Texture, c AlphaCut)
ClearCut()
Clear(c Color)
FillRect(r image.Rectangle, c Color, m Mask)
FillGradient(r image.Rectangle, g Gradient, m Mask)
Kawase(t Texture, dst image.Rectangle, offset float32, up bool)
FillGoo(r image.Rectangle, c Color, g Goo)
DrawTexture(t Texture, src FRect, dst image.Rectangle, transform Transform, alpha float32, m Mask)
DrawScreenShader(s ScreenShader, t Texture, dst image.Rectangle, seconds float32)
DrawGlass(t Texture, src FRect, dst image.Rectangle, alpha float32, m Mask, g Glass)
End() error
}
type PendingRead ¶
type ReadTarget ¶
type Renderer ¶
type Renderer interface {
Speed() Speed
Counts() Counts
Formats() []Format
NewTexture(format Format, size image.Point, stride int, data []byte) (Texture, error)
NewBlankTexture(format Format, size image.Point) (Texture, error)
NewTarget(size image.Point) (ReadTarget, error)
NewTextureTarget(size image.Point) (TextureTarget, error)
NewScreenShader(p *shader.Program) (ScreenShader, error)
NewWorkingTarget(size image.Point) (TextureTarget, error)
Begin(target Target, damage Region) (Pass, error)
Lost() error
Recover() error
LoseDevice()
}
type ScreenShader ¶
ScreenShader is a shader program in the form a renderer draws with. Prepare does what drawing into target still takes, the last part a driver may refuse, so that a caller can draw without it while no pass is open.
type Texture ¶
type Texture interface {
Working() bool
Size() image.Point
Update(dst image.Rectangle, stride int, data []byte) error
Destroy() error
}
Texture is a renderer's image. Update and Renderer.NewTexture may be handed a client's memory, which faults if the client shrank its file: a renderer reads data only from Go on the calling goroutine and stays usable when that read panics, and keeps no reference to data.
type TextureTarget ¶
type TextureTarget interface {
ReadTarget
Texture() Texture
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gles is the GLES2 renderer: shm textures, premultiplied blending, and passes into framebuffers backed by textures or dmabufs.
|
Package gles is the GLES2 renderer: shm textures, premultiplied blending, and passes into framebuffers backed by textures or dmabufs. |
|
Package rendertest holds the scene and checks every renderer's tests share, so each GPU renderer is held to the software renderer's pixels.
|
Package rendertest holds the scene and checks every renderer's tests share, so each GPU renderer is held to the software renderer's pixels. |
|
Package soft is the CPU renderer over premultiplied ARGB8888 buffers.
|
Package soft is the CPU renderer over premultiplied ARGB8888 buffers. |
|
Package vulkan renders the compositor's frames with Vulkan through lys-lib's gpu package, the stack lys-ui and lys-shell draw with.
|
Package vulkan renders the compositor's frames with Vulkan through lys-lib's gpu package, the stack lys-ui and lys-shell draw with. |