diff options
Diffstat (limited to 'prototypes')
-rw-r--r-- | prototypes/xgb-xrender.go | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/prototypes/xgb-xrender.go b/prototypes/xgb-xrender.go index 73b5fed..3ae51ad 100644 --- a/prototypes/xgb-xrender.go +++ b/prototypes/xgb-xrender.go @@ -73,11 +73,34 @@ func main() { _ = xproto.MapWindow(X, wid) + /* + rfilters, err := render.QueryFilters(X, xproto.Drawable(wid)).Reply() + if err != nil { + log.Fatalln(err) + } + + filters := []string{} + for _, f := range rfilters.Filters { + filters = append(filters, f.Name) + } + + log.Printf("filters: %v\n", filters) + */ + pformats, err := render.QueryPictFormats(X).Reply() if err != nil { log.Fatalln(err) } + /* + for _, pf := range pformats.Formats { + log.Printf("format %2d: depth %2d, RGBA %3x %3x %3x %3x\n", + pf.Id, pf.Depth, + pf.Direct.RedMask, pf.Direct.GreenMask, pf.Direct.BlueMask, + pf.Direct.AlphaMask) + } + */ + // Similar to XRenderFindVisualFormat. // The DefaultScreen is almost certain to be zero. var pformat render.Pictformat @@ -100,6 +123,8 @@ func main() { if err != nil { log.Fatalln(err) } + + // Dithering is not supported. :( render.CreatePicture(X, pid, xproto.Drawable(wid), pformat, 0, []uint32{}) // Reserve an ID for the gradient. @@ -133,6 +158,7 @@ func main() { return } + // We could also use a transformation matrix for changes in size. _ = render.CreateLinearGradient(X, gid, render.Pointfix{F64ToFixed(0), F64ToFixed(0)}, render.Pointfix{F64ToFixed(0), F64ToFixed(float64(h) - 100)}, @@ -172,5 +198,4 @@ func main() { gradient() } } - } |