~eliasnaur/gio

ref: ad4215a7ebb19bf5063e01bb8f3162fa95c63696 gio/ui/ui.go -rw-r--r-- 3.0 KiB
ui: use ints for unit conversions to pixels

The dp and sp units are approximate and mostly used for layout
dimensions that operate in whole pixels. This change alters the
Config methods to return pixels in ints instead of floats, which
results in smoother use for layout and emphasize the inexactness of
the device independent units.

Clients can still access to raw PxPrDp and PxPrSp factors from
Config.

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/app: update comment and fix typo

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: 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: add Config.Sp and Config.Dp convenience methods

And rename Pixels to Val.

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>
ui: add doc.go

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

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