~eliasnaur/gio

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: add version to OpBlock to track invalidated blocks

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/gophers: switch to explicit drawing state stack

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: make OpPush and OpPop explicit

We're about to allow OpBlock for invoking ops from multiple (cached)
Ops containers. To allow for drawing state changes to stick after
invoking such a cached block, we can't let OpBlock perform an implicit
save and restore of drawing state.

Instead, introduce OpPush and OpPop for explicit drawing state stack
management.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui,ui/internal/ops: store owner Ops in OpBlock

Allows users to refer to other (cached) Ops from a main Ops.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: encapsulate encoded ops in a new type, opsData

Used for making OpBlock refer to other Ops.

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: move ops reader to ui package

To prepare support for cached OpBlock to refer to other Ops lists.

The exposure of OpsReader is alleviated by the removal of the Refs
and Data accessors for Ops.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/hello: update to explicit API

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/layout: activate sanity checks for Stack

Added by an earlier change, but not activated.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps: go get gioui.org/ui@latest

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/app/internal/gpu: track image and color in a state stack

Just like the other drawing state, the current image or color must
be tracked in a stack.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/draw: typo

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/gophers: switch to new OpImage, OpColor, OpDraw API

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>
apps/gophers: add per-frame mallocs to profiling status line

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/gophers: update event method names

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui: rename event methods to Update

For uniformity.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
apps/gophers: switch to explicit layout methods

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