dri2

package
v0.0.0-...-deaf085 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2021 License: BSD-3-Clause, GooglePatentClause Imports: 2 Imported by: 0

Documentation

Overview

Package dri2 is the X client API for the DRI2 extension.

Index

Constants

View Source
const (
	AttachmentBufferFrontLeft      = 0
	AttachmentBufferBackLeft       = 1
	AttachmentBufferFrontRight     = 2
	AttachmentBufferBackRight      = 3
	AttachmentBufferDepth          = 4
	AttachmentBufferStencil        = 5
	AttachmentBufferAccum          = 6
	AttachmentBufferFakeFrontLeft  = 7
	AttachmentBufferFakeFrontRight = 8
	AttachmentBufferDepthStencil   = 9
	AttachmentBufferHiz            = 10
)
View Source
const (
	DriverTypeDri   = 0
	DriverTypeVdpau = 1
)
View Source
const (
	EventTypeExchangeComplete = 1
	EventTypeBlitComplete     = 2
	EventTypeFlipComplete     = 3
)
View Source
const BufferSwapComplete = 0

BufferSwapComplete is the event number for a BufferSwapCompleteEvent.

View Source
const InvalidateBuffers = 1

InvalidateBuffers is the event number for a InvalidateBuffersEvent.

Variables

This section is empty.

Functions

func AttachFormatListBytes

func AttachFormatListBytes(buf []byte, list []AttachFormat) int

AttachFormatListBytes writes a list of AttachFormat values to a byte slice.

func AttachFormatRead

func AttachFormatRead(buf []byte, v *AttachFormat) int

AttachFormatRead reads a byte slice into a AttachFormat value.

func AttachFormatReadList

func AttachFormatReadList(buf []byte, dest []AttachFormat) int

AttachFormatReadList reads a byte slice into a list of AttachFormat values.

func BufferSwapCompleteEventNew

func BufferSwapCompleteEventNew(buf []byte) xgb.Event

BufferSwapCompleteEventNew constructs a BufferSwapCompleteEvent value that implements xgb.Event from a byte slice.

func DRI2BufferListBytes

func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int

DRI2BufferListBytes writes a list of DRI2Buffer values to a byte slice.

func DRI2BufferRead

func DRI2BufferRead(buf []byte, v *DRI2Buffer) int

DRI2BufferRead reads a byte slice into a DRI2Buffer value.

func DRI2BufferReadList

func DRI2BufferReadList(buf []byte, dest []DRI2Buffer) int

DRI2BufferReadList reads a byte slice into a list of DRI2Buffer values.

func Init

func Init(c *xgb.Conn) error

Init must be called before using the DRI2 extension.

func InvalidateBuffersEventNew

func InvalidateBuffersEventNew(buf []byte) xgb.Event

InvalidateBuffersEventNew constructs a InvalidateBuffersEvent value that implements xgb.Event from a byte slice.

Types

type AttachFormat

type AttachFormat struct {
	Attachment uint32
	Format     uint32
}

func (AttachFormat) Bytes

func (v AttachFormat) Bytes() []byte

Bytes writes a AttachFormat value to a byte slice.

type AuthenticateCookie

type AuthenticateCookie struct {
	*xgb.Cookie
}

AuthenticateCookie is a cookie used only for Authenticate requests.

func Authenticate

func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie

Authenticate sends a checked request. If an error occurs, it will be returned with the reply by calling AuthenticateCookie.Reply()

func AuthenticateUnchecked

func AuthenticateUnchecked(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie

AuthenticateUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (AuthenticateCookie) Reply

func (cook AuthenticateCookie) Reply() (*AuthenticateReply, error)

Reply blocks and returns the reply data for a Authenticate request.

type AuthenticateReply

type AuthenticateReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	Authenticated uint32
}

AuthenticateReply represents the data returned from a Authenticate request.

type BufferSwapCompleteEvent

type BufferSwapCompleteEvent struct {
	Sequence uint16
	// padding: 1 bytes
	EventType uint16
	// padding: 2 bytes
	Drawable xproto.Drawable
	UstHi    uint32
	UstLo    uint32
	MscHi    uint32
	MscLo    uint32
	Sbc      uint32
}

func (BufferSwapCompleteEvent) Bytes

func (v BufferSwapCompleteEvent) Bytes() []byte

Bytes writes a BufferSwapCompleteEvent value to a byte slice.

func (BufferSwapCompleteEvent) SequenceId

func (v BufferSwapCompleteEvent) SequenceId() uint16

SequenceId returns the sequence id attached to the BufferSwapComplete event. Events without a sequence number (KeymapNotify) return 0. This is mostly used internally.

func (BufferSwapCompleteEvent) String

func (v BufferSwapCompleteEvent) String() string

String is a rudimentary string representation of BufferSwapCompleteEvent.

type ConnectCookie

type ConnectCookie struct {
	*xgb.Cookie
}

ConnectCookie is a cookie used only for Connect requests.

func Connect

func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie

Connect sends a checked request. If an error occurs, it will be returned with the reply by calling ConnectCookie.Reply()

func ConnectUnchecked

func ConnectUnchecked(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie

ConnectUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (ConnectCookie) Reply

func (cook ConnectCookie) Reply() (*ConnectReply, error)

Reply blocks and returns the reply data for a Connect request.

type ConnectReply

type ConnectReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	DriverNameLength uint32
	DeviceNameLength uint32
	// padding: 16 bytes
	DriverName   string // size: xgb.Pad((int(DriverNameLength) * 1))
	AlignmentPad []byte // size: xgb.Pad(((((int(DriverNameLength) + 3) & -4) - int(DriverNameLength)) * 1))
	DeviceName   string // size: xgb.Pad((int(DeviceNameLength) * 1))
}

ConnectReply represents the data returned from a Connect request.

type CopyRegionCookie

type CopyRegionCookie struct {
	*xgb.Cookie
}

CopyRegionCookie is a cookie used only for CopyRegion requests.

func CopyRegion

func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie

CopyRegion sends a checked request. If an error occurs, it will be returned with the reply by calling CopyRegionCookie.Reply()

func CopyRegionUnchecked

func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie

CopyRegionUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (CopyRegionCookie) Reply

func (cook CopyRegionCookie) Reply() (*CopyRegionReply, error)

Reply blocks and returns the reply data for a CopyRegion request.

type CopyRegionReply

type CopyRegionReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply

}

CopyRegionReply represents the data returned from a CopyRegion request.

type CreateDrawableCookie

type CreateDrawableCookie struct {
	*xgb.Cookie
}

CreateDrawableCookie is a cookie used only for CreateDrawable requests.

func CreateDrawable

func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie

CreateDrawable sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func CreateDrawableChecked

func CreateDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie

CreateDrawableChecked sends a checked request. If an error occurs, it can be retrieved using CreateDrawableCookie.Check()

func (CreateDrawableCookie) Check

func (cook CreateDrawableCookie) Check() error

Check returns an error if one occurred for checked requests that are not expecting a reply. This cannot be called for requests expecting a reply, nor for unchecked requests.

type DRI2Buffer

type DRI2Buffer struct {
	Attachment uint32
	Name       uint32
	Pitch      uint32
	Cpp        uint32
	Flags      uint32
}

func (DRI2Buffer) Bytes

func (v DRI2Buffer) Bytes() []byte

Bytes writes a DRI2Buffer value to a byte slice.

type DestroyDrawableCookie

type DestroyDrawableCookie struct {
	*xgb.Cookie
}

DestroyDrawableCookie is a cookie used only for DestroyDrawable requests.

func DestroyDrawable

func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie

DestroyDrawable sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func DestroyDrawableChecked

func DestroyDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie

DestroyDrawableChecked sends a checked request. If an error occurs, it can be retrieved using DestroyDrawableCookie.Check()

func (DestroyDrawableCookie) Check

func (cook DestroyDrawableCookie) Check() error

Check returns an error if one occurred for checked requests that are not expecting a reply. This cannot be called for requests expecting a reply, nor for unchecked requests.

type GetBuffersCookie

type GetBuffersCookie struct {
	*xgb.Cookie
}

GetBuffersCookie is a cookie used only for GetBuffers requests.

func GetBuffers

func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie

GetBuffers sends a checked request. If an error occurs, it will be returned with the reply by calling GetBuffersCookie.Reply()

func GetBuffersUnchecked

func GetBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie

GetBuffersUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (GetBuffersCookie) Reply

func (cook GetBuffersCookie) Reply() (*GetBuffersReply, error)

Reply blocks and returns the reply data for a GetBuffers request.

type GetBuffersReply

type GetBuffersReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	Width  uint32
	Height uint32
	Count  uint32
	// padding: 12 bytes
	Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20))
}

GetBuffersReply represents the data returned from a GetBuffers request.

type GetBuffersWithFormatCookie

type GetBuffersWithFormatCookie struct {
	*xgb.Cookie
}

GetBuffersWithFormatCookie is a cookie used only for GetBuffersWithFormat requests.

func GetBuffersWithFormat

func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie

GetBuffersWithFormat sends a checked request. If an error occurs, it will be returned with the reply by calling GetBuffersWithFormatCookie.Reply()

func GetBuffersWithFormatUnchecked

func GetBuffersWithFormatUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie

GetBuffersWithFormatUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (GetBuffersWithFormatCookie) Reply

Reply blocks and returns the reply data for a GetBuffersWithFormat request.

type GetBuffersWithFormatReply

type GetBuffersWithFormatReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	Width  uint32
	Height uint32
	Count  uint32
	// padding: 12 bytes
	Buffers []DRI2Buffer // size: xgb.Pad((int(Count) * 20))
}

GetBuffersWithFormatReply represents the data returned from a GetBuffersWithFormat request.

type GetMSCCookie

type GetMSCCookie struct {
	*xgb.Cookie
}

GetMSCCookie is a cookie used only for GetMSC requests.

func GetMSC

func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie

GetMSC sends a checked request. If an error occurs, it will be returned with the reply by calling GetMSCCookie.Reply()

func GetMSCUnchecked

func GetMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie

GetMSCUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (GetMSCCookie) Reply

func (cook GetMSCCookie) Reply() (*GetMSCReply, error)

Reply blocks and returns the reply data for a GetMSC request.

type GetMSCReply

type GetMSCReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	UstHi uint32
	UstLo uint32
	MscHi uint32
	MscLo uint32
	SbcHi uint32
	SbcLo uint32
}

GetMSCReply represents the data returned from a GetMSC request.

type GetParamCookie

type GetParamCookie struct {
	*xgb.Cookie
}

GetParamCookie is a cookie used only for GetParam requests.

func GetParam

func GetParam(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) GetParamCookie

GetParam sends a checked request. If an error occurs, it will be returned with the reply by calling GetParamCookie.Reply()

func GetParamUnchecked

func GetParamUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) GetParamCookie

GetParamUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (GetParamCookie) Reply

func (cook GetParamCookie) Reply() (*GetParamReply, error)

Reply blocks and returns the reply data for a GetParam request.

type GetParamReply

type GetParamReply struct {
	Sequence          uint16 // sequence number of the request for this reply
	Length            uint32 // number of bytes in this reply
	IsParamRecognized bool
	ValueHi           uint32
	ValueLo           uint32
}

GetParamReply represents the data returned from a GetParam request.

type InvalidateBuffersEvent

type InvalidateBuffersEvent struct {
	Sequence uint16
	// padding: 1 bytes
	Drawable xproto.Drawable
}

func (InvalidateBuffersEvent) Bytes

func (v InvalidateBuffersEvent) Bytes() []byte

Bytes writes a InvalidateBuffersEvent value to a byte slice.

func (InvalidateBuffersEvent) SequenceId

func (v InvalidateBuffersEvent) SequenceId() uint16

SequenceId returns the sequence id attached to the InvalidateBuffers event. Events without a sequence number (KeymapNotify) return 0. This is mostly used internally.

func (InvalidateBuffersEvent) String

func (v InvalidateBuffersEvent) String() string

String is a rudimentary string representation of InvalidateBuffersEvent.

type QueryVersionCookie

type QueryVersionCookie struct {
	*xgb.Cookie
}

QueryVersionCookie is a cookie used only for QueryVersion requests.

func QueryVersion

func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie

QueryVersion sends a checked request. If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()

func QueryVersionUnchecked

func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie

QueryVersionUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (QueryVersionCookie) Reply

func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error)

Reply blocks and returns the reply data for a QueryVersion request.

type QueryVersionReply

type QueryVersionReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	MajorVersion uint32
	MinorVersion uint32
}

QueryVersionReply represents the data returned from a QueryVersion request.

type SwapBuffersCookie

type SwapBuffersCookie struct {
	*xgb.Cookie
}

SwapBuffersCookie is a cookie used only for SwapBuffers requests.

func SwapBuffers

func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie

SwapBuffers sends a checked request. If an error occurs, it will be returned with the reply by calling SwapBuffersCookie.Reply()

func SwapBuffersUnchecked

func SwapBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie

SwapBuffersUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (SwapBuffersCookie) Reply

func (cook SwapBuffersCookie) Reply() (*SwapBuffersReply, error)

Reply blocks and returns the reply data for a SwapBuffers request.

type SwapBuffersReply

type SwapBuffersReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	SwapHi uint32
	SwapLo uint32
}

SwapBuffersReply represents the data returned from a SwapBuffers request.

type SwapIntervalCookie

type SwapIntervalCookie struct {
	*xgb.Cookie
}

SwapIntervalCookie is a cookie used only for SwapInterval requests.

func SwapInterval

func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie

SwapInterval sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func SwapIntervalChecked

func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie

SwapIntervalChecked sends a checked request. If an error occurs, it can be retrieved using SwapIntervalCookie.Check()

func (SwapIntervalCookie) Check

func (cook SwapIntervalCookie) Check() error

Check returns an error if one occurred for checked requests that are not expecting a reply. This cannot be called for requests expecting a reply, nor for unchecked requests.

type WaitMSCCookie

type WaitMSCCookie struct {
	*xgb.Cookie
}

WaitMSCCookie is a cookie used only for WaitMSC requests.

func WaitMSC

func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie

WaitMSC sends a checked request. If an error occurs, it will be returned with the reply by calling WaitMSCCookie.Reply()

func WaitMSCUnchecked

func WaitMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie

WaitMSCUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (WaitMSCCookie) Reply

func (cook WaitMSCCookie) Reply() (*WaitMSCReply, error)

Reply blocks and returns the reply data for a WaitMSC request.

type WaitMSCReply

type WaitMSCReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	UstHi uint32
	UstLo uint32
	MscHi uint32
	MscLo uint32
	SbcHi uint32
	SbcLo uint32
}

WaitMSCReply represents the data returned from a WaitMSC request.

type WaitSBCCookie

type WaitSBCCookie struct {
	*xgb.Cookie
}

WaitSBCCookie is a cookie used only for WaitSBC requests.

func WaitSBC

func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie

WaitSBC sends a checked request. If an error occurs, it will be returned with the reply by calling WaitSBCCookie.Reply()

func WaitSBCUnchecked

func WaitSBCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie

WaitSBCUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (WaitSBCCookie) Reply

func (cook WaitSBCCookie) Reply() (*WaitSBCReply, error)

Reply blocks and returns the reply data for a WaitSBC request.

type WaitSBCReply

type WaitSBCReply struct {
	Sequence uint16 // sequence number of the request for this reply
	Length   uint32 // number of bytes in this reply
	// padding: 1 bytes
	UstHi uint32
	UstLo uint32
	MscHi uint32
	MscLo uint32
	SbcHi uint32
	SbcLo uint32
}

WaitSBCReply represents the data returned from a WaitSBC request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL