mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
gpu: rename method GPU.Frame to BeginFrame and drop redundant argument
The viewport size was already specified in the call to Collect. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -91,7 +91,7 @@ func (w *Window) Release() {
|
|||||||
func (w *Window) Frame(frame *op.Ops) {
|
func (w *Window) Frame(frame *op.Ops) {
|
||||||
contextDo(w.ctx, func() error {
|
contextDo(w.ctx, func() error {
|
||||||
w.gpu.Collect(w.size, frame)
|
w.gpu.Collect(w.size, frame)
|
||||||
w.gpu.Frame(w.size)
|
w.gpu.BeginFrame()
|
||||||
w.gpu.EndFrame()
|
w.gpu.EndFrame()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|||||||
+1
-1
@@ -83,7 +83,7 @@ func (l *renderLoop) renderLoop(glctx window.Context) error {
|
|||||||
g.Collect(frame.viewport, frame.ops)
|
g.Collect(frame.viewport, frame.ops)
|
||||||
// Signal that we're done with the frame ops.
|
// Signal that we're done with the frame ops.
|
||||||
l.ack <- struct{}{}
|
l.ack <- struct{}{}
|
||||||
g.Frame(frame.viewport)
|
g.BeginFrame()
|
||||||
var res frameResult
|
var res frameResult
|
||||||
res.err = glctx.Present()
|
res.err = glctx.Present()
|
||||||
g.EndFrame()
|
g.EndFrame()
|
||||||
|
|||||||
+4
-3
@@ -260,6 +260,8 @@ func (g *GPU) Release() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *GPU) Collect(viewport image.Point, frameOps *op.Ops) {
|
func (g *GPU) Collect(viewport image.Point, frameOps *op.Ops) {
|
||||||
|
g.renderer.blitter.viewport = viewport
|
||||||
|
g.renderer.pather.viewport = viewport
|
||||||
g.drawOps.reset(g.cache, viewport)
|
g.drawOps.reset(g.cache, viewport)
|
||||||
g.drawOps.collect(g.cache, frameOps, viewport)
|
g.drawOps.collect(g.cache, frameOps, viewport)
|
||||||
g.frameStart = time.Now()
|
g.frameStart = time.Now()
|
||||||
@@ -279,9 +281,8 @@ func (g *GPU) Collect(viewport image.Point, frameOps *op.Ops) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GPU) Frame(viewport image.Point) {
|
func (g *GPU) BeginFrame() {
|
||||||
g.renderer.blitter.viewport = viewport
|
viewport := g.renderer.blitter.viewport
|
||||||
g.renderer.pather.viewport = viewport
|
|
||||||
for _, img := range g.drawOps.imageOps {
|
for _, img := range g.drawOps.imageOps {
|
||||||
expandPathOp(img.path, img.clip)
|
expandPathOp(img.path, img.clip)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user