~eliasnaur/gio

ref: 5c3dcc6f9a07dc22a26319616adc2c63e33da966 gio/ui/paint/paint.go -rw-r--r-- 1.9 KiB
ui/paint: expand documentation and add package description

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/paint: rename the draw package

The draw package name clashes with the standard library draw package.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: remove exported Decode methods on operations

Add decode functions to the packages that need them instead. For
TransformOp that is used in multiple packages, add the decode
function to the internal ops package.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui,internal/ops,internal/opconst: move OpsReader to internal ops package

To avoid import cycles, move the op constants to its own package,
internal/opconst.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui,ui/draw: fix decoding of negative integers

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: get rid of Inf

It's not worth the special cases. Use a large value where needed
(layout.List, text.Editor...) instead.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/draw: rename ImageOp.Img to Src

To match widget.Image.Src field name.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/draw: rename ColorOp.Col to Color
ui/draw: switch to color.RGBA for colors

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: rename ops to have Op suffixed, not prefixed

Match Go's FooError name pattern.

While we're here, rename RedrawOp to InvalidateOp.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/draw,ui/layout: export OpClip

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: make the reference list argument to Ops.Write variadic

Makes the code nicer.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: build paths as ops

Instead of allocating and constructing a clip path, store path data
directly in op lists. Use separate op lists for cached text layout
paths.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: let OpsReader keep track of references

Instead of exposing the entire reference slice, return the relevant
references from Next.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: introduce OpColor, a specialized OpImage for uniform colors

To avoid allocating an image.Image for OpImage.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: split OpImage into OpImage and OpDraw

In preparation for an OpColor (and future OpGradient and similar).

Label and Editor no longer take an explicit source image. They
draw with the current image.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: delete the ui.Op type

It's no longer used.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: serialize ops

Pros:
- Much less per-frame garbage
- Allow future preprocessing of ops while building it
- Much fewer interface calls and pointer chasing
- Allow future serialization of ops for remote rendering

Cons:
- Slightly clumsier API

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: run goimports

gioui.org/ui was renamed from gioui.org/ui/ui before the release,
but the import order wasn't changed accordingly.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: initial import

Signed-off-by: Elias Naur <mail@eliasnaur.com>