aboutsummaryrefslogtreecommitdiff
path: root/nexgb/dri2/dri2.go
diff options
context:
space:
mode:
Diffstat (limited to 'nexgb/dri2/dri2.go')
-rw-r--r--nexgb/dri2/dri2.go100
1 files changed, 43 insertions, 57 deletions
diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go
index 5ae789d..86d0996 100644
--- a/nexgb/dri2/dri2.go
+++ b/nexgb/dri2/dri2.go
@@ -404,7 +404,7 @@ type AuthenticateCookie struct {
}
// Authenticate sends a checked request.
-// If an error occurs, it will be returned with the reply by calling AuthenticateCookie.Reply()
+// If an error occurs, it will be returned with the reply by calling AuthenticateCookie.Reply.
func Authenticate(c *xgb.Conn, Window xproto.Window, Magic uint32) AuthenticateCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -468,8 +468,7 @@ func authenticateReply(buf []byte) *AuthenticateReply {
return v
}
-// Write request to wire for Authenticate
-// authenticateRequest writes a Authenticate request to a byte slice.
+// authenticateRequest writes a Authenticate request to a byte slice for transfer.
func authenticateRequest(c *xgb.Conn, Window xproto.Window, Magic uint32) []byte {
size := 12
b := 0
@@ -501,7 +500,7 @@ type ConnectCookie struct {
}
// Connect sends a checked request.
-// If an error occurs, it will be returned with the reply by calling ConnectCookie.Reply()
+// If an error occurs, it will be returned with the reply by calling ConnectCookie.Reply.
func Connect(c *xgb.Conn, Window xproto.Window, DriverType uint32) ConnectCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -593,8 +592,7 @@ func connectReply(buf []byte) *ConnectReply {
return v
}
-// Write request to wire for Connect
-// connectRequest writes a Connect request to a byte slice.
+// connectRequest writes a Connect request to a byte slice for transfer.
func connectRequest(c *xgb.Conn, Window xproto.Window, DriverType uint32) []byte {
size := 12
b := 0
@@ -626,8 +624,8 @@ type CopyRegionCookie struct {
}
// CopyRegion sends a checked request.
-// If an error occurs, it will be returned with the reply by calling CopyRegionCookie.Reply()
-func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie {
+// If an error occurs, it will be returned with the reply by calling CopyRegionCookie.Reply.
+func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region, Dest, Src uint32) CopyRegionCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -640,7 +638,7 @@ func CopyRegion(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint3
// CopyRegionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
-func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) CopyRegionCookie {
+func CopyRegionUnchecked(c *xgb.Conn, Drawable xproto.Drawable, Region, Dest, Src uint32) CopyRegionCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -686,9 +684,8 @@ func copyRegionReply(buf []byte) *CopyRegionReply {
return v
}
-// Write request to wire for CopyRegion
-// copyRegionRequest writes a CopyRegion request to a byte slice.
-func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) []byte {
+// copyRegionRequest writes a CopyRegion request to a byte slice for transfer.
+func copyRegionRequest(c *xgb.Conn, Drawable xproto.Drawable, Region, Dest, Src uint32) []byte {
size := 20
b := 0
buf := make([]byte, size)
@@ -738,7 +735,7 @@ func CreateDrawable(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie
}
// CreateDrawableChecked sends a checked request.
-// If an error occurs, it can be retrieved using CreateDrawableCookie.Check()
+// If an error occurs, it can be retrieved using CreateDrawableCookie.Check.
func CreateDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) CreateDrawableCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -756,8 +753,7 @@ func (cook CreateDrawableCookie) Check() error {
return cook.Cookie.Check()
}
-// Write request to wire for CreateDrawable
-// createDrawableRequest writes a CreateDrawable request to a byte slice.
+// createDrawableRequest writes a CreateDrawable request to a byte slice for transfer.
func createDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
size := 8
b := 0
@@ -799,7 +795,7 @@ func DestroyDrawable(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCooki
}
// DestroyDrawableChecked sends a checked request.
-// If an error occurs, it can be retrieved using DestroyDrawableCookie.Check()
+// If an error occurs, it can be retrieved using DestroyDrawableCookie.Check.
func DestroyDrawableChecked(c *xgb.Conn, Drawable xproto.Drawable) DestroyDrawableCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -817,8 +813,7 @@ func (cook DestroyDrawableCookie) Check() error {
return cook.Cookie.Check()
}
-// Write request to wire for DestroyDrawable
-// destroyDrawableRequest writes a DestroyDrawable request to a byte slice.
+// destroyDrawableRequest writes a DestroyDrawable request to a byte slice for transfer.
func destroyDrawableRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
size := 8
b := 0
@@ -847,7 +842,7 @@ type GetBuffersCookie struct {
}
// GetBuffers sends a checked request.
-// If an error occurs, it will be returned with the reply by calling GetBuffersCookie.Reply()
+// If an error occurs, it will be returned with the reply by calling GetBuffersCookie.Reply.
func GetBuffers(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) GetBuffersCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -926,8 +921,7 @@ func getBuffersReply(buf []byte) *GetBuffersReply {
return v
}
-// Write request to wire for GetBuffers
-// getBuffersRequest writes a GetBuffers request to a byte slice.
+// getBuffersRequest writes a GetBuffers request to a byte slice for transfer.
func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []uint32) []byte {
size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 4))))
b := 0
@@ -964,7 +958,7 @@ type GetBuffersWithFormatCookie struct {
}
// GetBuffersWithFormat sends a checked request.
-// If an error occurs, it will be returned with the reply by calling GetBuffersWithFormatCookie.Reply()
+// If an error occurs, it will be returned with the reply by calling GetBuffersWithFormatCookie.Reply.
func GetBuffersWithFormat(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) GetBuffersWithFormatCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -1043,8 +1037,7 @@ func getBuffersWithFormatReply(buf []byte) *GetBuffersWithFormatReply {
return v
}
-// Write request to wire for GetBuffersWithFormat
-// getBuffersWithFormatRequest writes a GetBuffersWithFormat request to a byte slice.
+// getBuffersWithFormatRequest writes a GetBuffersWithFormat request to a byte slice for transfer.
func getBuffersWithFormatRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Attachments []AttachFormat) []byte {
size := xgb.Pad((12 + xgb.Pad((len(Attachments) * 8))))
b := 0
@@ -1078,7 +1071,7 @@ type GetMSCCookie struct {
}
// GetMSC sends a checked request.
-// If an error occurs, it will be returned with the reply by calling GetMSCCookie.Reply()
+// If an error occurs, it will be returned with the reply by calling GetMSCCookie.Reply.
func GetMSC(c *xgb.Conn, Drawable xproto.Drawable) GetMSCCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -1162,8 +1155,7 @@ func getMSCReply(buf []byte) *GetMSCReply {
return v
}
-// Write request to wire for GetMSC
-// getMSCRequest writes a GetMSC request to a byte slice.
+// getMSCRequest writes a GetMSC request to a byte slice for transfer.
func getMSCRequest(c *xgb.Conn, Drawable xproto.Drawable) []byte {
size := 8
b := 0
@@ -1192,7 +1184,7 @@ type GetParamCookie struct {
}
// GetParam sends a checked request.
-// If an error occurs, it will be returned with the reply by calling GetParamCookie.Reply()
+// If an error occurs, it will be returned with the reply by calling GetParamCookie.Reply.
func GetParam(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) GetParamCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -1265,8 +1257,7 @@ func getParamReply(buf []byte) *GetParamReply {
return v
}
-// Write request to wire for GetParam
-// getParamRequest writes a GetParam request to a byte slice.
+// getParamRequest writes a GetParam request to a byte slice for transfer.
func getParamRequest(c *xgb.Conn, Drawable xproto.Drawable, Param uint32) []byte {
size := 12
b := 0
@@ -1298,8 +1289,8 @@ type QueryVersionCookie struct {
}
// QueryVersion sends a checked request.
-// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
-func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie {
+// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply.
+func QueryVersion(c *xgb.Conn, MajorVersion, MinorVersion uint32) QueryVersionCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -1312,7 +1303,7 @@ func QueryVersion(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVe
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
-func QueryVersionUnchecked(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) QueryVersionCookie {
+func QueryVersionUnchecked(c *xgb.Conn, MajorVersion, MinorVersion uint32) QueryVersionCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -1366,9 +1357,8 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
return v
}
-// Write request to wire for QueryVersion
-// queryVersionRequest writes a QueryVersion request to a byte slice.
-func queryVersionRequest(c *xgb.Conn, MajorVersion uint32, MinorVersion uint32) []byte {
+// queryVersionRequest writes a QueryVersion request to a byte slice for transfer.
+func queryVersionRequest(c *xgb.Conn, MajorVersion, MinorVersion uint32) []byte {
size := 12
b := 0
buf := make([]byte, size)
@@ -1399,8 +1389,8 @@ type SwapBuffersCookie struct {
}
// SwapBuffers sends a checked request.
-// If an error occurs, it will be returned with the reply by calling SwapBuffersCookie.Reply()
-func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie {
+// If an error occurs, it will be returned with the reply by calling SwapBuffersCookie.Reply.
+func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo uint32) SwapBuffersCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -1413,7 +1403,7 @@ func SwapBuffers(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, Targ
// SwapBuffersUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
-func SwapBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) SwapBuffersCookie {
+func SwapBuffersUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo uint32) SwapBuffersCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -1467,9 +1457,8 @@ func swapBuffersReply(buf []byte) *SwapBuffersReply {
return v
}
-// Write request to wire for SwapBuffers
-// swapBuffersRequest writes a SwapBuffers request to a byte slice.
-func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte {
+// swapBuffersRequest writes a SwapBuffers request to a byte slice for transfer.
+func swapBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo uint32) []byte {
size := 32
b := 0
buf := make([]byte, size)
@@ -1528,7 +1517,7 @@ func SwapInterval(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIn
}
// SwapIntervalChecked sends a checked request.
-// If an error occurs, it can be retrieved using SwapIntervalCookie.Check()
+// If an error occurs, it can be retrieved using SwapIntervalCookie.Check.
func SwapIntervalChecked(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) SwapIntervalCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -1546,8 +1535,7 @@ func (cook SwapIntervalCookie) Check() error {
return cook.Cookie.Check()
}
-// Write request to wire for SwapInterval
-// swapIntervalRequest writes a SwapInterval request to a byte slice.
+// swapIntervalRequest writes a SwapInterval request to a byte slice for transfer.
func swapIntervalRequest(c *xgb.Conn, Drawable xproto.Drawable, Interval uint32) []byte {
size := 12
b := 0
@@ -1579,8 +1567,8 @@ type WaitMSCCookie struct {
}
// WaitMSC sends a checked request.
-// If an error occurs, it will be returned with the reply by calling WaitMSCCookie.Reply()
-func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie {
+// If an error occurs, it will be returned with the reply by calling WaitMSCCookie.Reply.
+func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo uint32) WaitMSCCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -1593,7 +1581,7 @@ func WaitMSC(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMs
// WaitMSCUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
-func WaitMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) WaitMSCCookie {
+func WaitMSCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo uint32) WaitMSCCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -1663,9 +1651,8 @@ func waitMSCReply(buf []byte) *WaitMSCReply {
return v
}
-// Write request to wire for WaitMSC
-// waitMSCRequest writes a WaitMSC request to a byte slice.
-func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi uint32, TargetMscLo uint32, DivisorHi uint32, DivisorLo uint32, RemainderHi uint32, RemainderLo uint32) []byte {
+// waitMSCRequest writes a WaitMSC request to a byte slice for transfer.
+func waitMSCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetMscHi, TargetMscLo, DivisorHi, DivisorLo, RemainderHi, RemainderLo uint32) []byte {
size := 32
b := 0
buf := make([]byte, size)
@@ -1711,8 +1698,8 @@ type WaitSBCCookie struct {
}
// WaitSBC sends a checked request.
-// If an error occurs, it will be returned with the reply by calling WaitSBCCookie.Reply()
-func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie {
+// If an error occurs, it will be returned with the reply by calling WaitSBCCookie.Reply.
+func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi, TargetSbcLo uint32) WaitSBCCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -1725,7 +1712,7 @@ func WaitSBC(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSb
// WaitSBCUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
-func WaitSBCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) WaitSBCCookie {
+func WaitSBCUnchecked(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi, TargetSbcLo uint32) WaitSBCCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["DRI2"]; !ok {
@@ -1795,9 +1782,8 @@ func waitSBCReply(buf []byte) *WaitSBCReply {
return v
}
-// Write request to wire for WaitSBC
-// waitSBCRequest writes a WaitSBC request to a byte slice.
-func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi uint32, TargetSbcLo uint32) []byte {
+// waitSBCRequest writes a WaitSBC request to a byte slice for transfer.
+func waitSBCRequest(c *xgb.Conn, Drawable xproto.Drawable, TargetSbcHi, TargetSbcLo uint32) []byte {
size := 16
b := 0
buf := make([]byte, size)