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>
The os and gl packages were separate in the past, which required
uintptr for cross-package CFTypeRefs. That's no longer needed.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Now that syscall/js.TypedArrayOf is going away in Go 1.13 (sse
https://golang.org/issue/31980), copying byte slices to JS before
use is necessary. To avoid garbage, re-use a single buffer for all
transfers.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
syscall/js.TypedArrayOf is going away in Go 1.13. Avoid it for
invalidateFramebuffer by using a buffer managed by JS.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The frame callback for macOS comes in from a different thread than
the UI thread. Serialize event handling to maintain the invariant
that only one event is processed at a time.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
GL_EXT_disjoint_timer_query_webgl2 is the WebGL 2 counterpart to
the WebGL 1 GL_EXT_disjoint_timer_query extension.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Some devices don't support floating point FBOs even though they
support OpenGL ES 3. Check support by creating a FBO and fail early
if no support is found.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
I found a convincing use case: stopping asynchronous activities
while paused. A follow up change will rename the stages and add
an example.
This reverts commit f9840b0963.
I'm not convinced the API is right. For exmaple, an event that
notifies a program when to save its state is both smaller and
might be sufficient.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
It doesn't seem worth the trouble: images must be scanned for
alpha != 1 and GPUs don't like RGB formats. Use RGBA always.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
WebGL use opaque values for object handles, not integers. To ensure
portability, wrap handle types with a struct.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
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>
For some reason, the CADisplayLink.paused property didn't work on
iOS 10 but does on iOS 12. Use addToRunLoop and removeFromRunLoop
instead.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
It turns out we already support multiple windows on Android: when
the activity is recreated.
This reverts commit f21b5eb1df.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Replace it with a dummy event send on the synchronous event channel;
a bit of cleverness for a simpler API.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
We used to buffer input events to allow for batch processing
multiple events before redrawing. Now that redraws are scheduled to
run after the native event queue is empty, buffering is no longer
necessary.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
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>