gpu: Merge GPU.Collect and GPU.Frame

There's no meaningful reason to have them separate. The intention was to
enable rendering concurrent with other processing, but that's gaining
framerate at the expense of input latency and complicating ImageOp
semantics.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-08-24 08:25:10 +02:00
parent 7acc031ccf
commit 414be0a0b3
6 changed files with 22 additions and 40 deletions
+2 -21
View File
@@ -26,27 +26,8 @@ type FrameEvent struct {
Size image.Point
// Insets is the insets to apply.
Insets Insets
// Frame is the callback to supply the list of
// operations to complete the FrameEvent.
//
// Note that the operation list and the operations themselves
// may not be mutated until another FrameEvent is received from
// the same event source.
// That means that calls to frame.Reset and changes to referenced
// data such as ImageOp backing images should happen between
// receiving a FrameEvent and calling Frame.
//
// Example:
//
// var w *app.Window
// var frame *op.Ops
// for e := range w.Events() {
// if e, ok := e.(system.FrameEvent); ok {
// // Call frame.Reset and manipulate images for ImageOps
// // here.
// e.Frame(frame)
// }
// }
// Frame completes the FrameEvent by drawing the graphical operations
// from ops into the window.
Frame func(frame *op.Ops)
// Queue supplies the events for event handlers.
Queue event.Queue