Switch from Asuka to MyGo, keeping the API client and the feature set: - servers: saved servers, passwordless and password login, proxy, self-signed certificates, per-server device tokens (Keystore), connect form, instance list sheet with switch/disconnect - sessions: virtualized list, search, new session, rename/archive/delete, running indicator, event stream keeps it live - chat: pushed window with system back bar, streaming Markdown via ui/markdown, reasoning and tool rows with image previews, footer menu (read aloud via a Kotlin TTS plugin, copy, fork), user message menu (copy, revert, fork), context usage ring and detail sheet, attachments (photos/files via the document picker), permissions - release builds allow plain http:// LAN servers (Go's net/http dials directly, no cleartext manifest needed) - a local fork of MyGo (third_party/mygo) lowers the Android host's minSdk to 24 (Android 7.0); Go 1.27.4 via mise Version 0.3.0.
49 lines
1.8 KiB
Go
49 lines
1.8 KiB
Go
//go:build darwin && !ios
|
|
|
|
package metal
|
|
|
|
import (
|
|
"github.com/egoist/mygo/internal/scene"
|
|
"testing"
|
|
)
|
|
|
|
// BenchmarkRenderFillRate measures GPU timestamp duration for large opaque
|
|
// layers, border-only rings and stacked shadows at Retina window size.
|
|
// Like BenchmarkRenderSprites, it waits for each offscreen frame; it does
|
|
// not measure drawable waits, presentation latency or frames in flight.
|
|
func BenchmarkRenderFillRate(b *testing.B) {
|
|
const w, h = 3456, 2000
|
|
fill := func(r scene.Rect, c scene.Color) scene.Op { return scene.Op{Kind: scene.OpFill, Rect: r, Color: c} }
|
|
background := fill(scene.Rect{W: w, H: h}, scene.Color{R: 20, G: 22, B: 28, A: 255})
|
|
var layers []scene.Op
|
|
for i := range 6 {
|
|
d := float32(i)
|
|
layers = append(layers, fill(scene.Rect{X: d, Y: d, W: w - 2*d, H: h - 2*d}, scene.Color{R: byte(20 + i), G: 22, B: 28, A: 255}))
|
|
}
|
|
panel := scene.Rect{X: 576, Y: 48, W: 2800, H: 1856}
|
|
radii := scene.Uniform(24)
|
|
card := fill(panel, scene.Color{R: 30, G: 32, B: 38, A: 255})
|
|
card.Radii = radii
|
|
card.Continuous = true
|
|
ring := fill(panel, scene.Color{})
|
|
ring.Radii = radii
|
|
ring.Continuous = true
|
|
ring.Border = scene.Uniform(2)
|
|
ring.BorderColor = scene.Color{A: 100}
|
|
shadows := []scene.Op{background, fill(scene.Rect{W: w, H: h}, scene.Color{A: 100})}
|
|
for _, blur := range []float32{6, 16, 32, 64} {
|
|
shadows = append(shadows, scene.Op{Kind: scene.OpShadow, Rect: panel, Radii: radii, Cast: panel, CastRadii: radii, Blur: blur, Color: scene.Color{A: 60}})
|
|
}
|
|
shadows = append(shadows, card)
|
|
for _, tc := range []struct {
|
|
name string
|
|
ops []scene.Op
|
|
}{
|
|
{"nested_layers", layers}, {"border_ring", []scene.Op{background, card, ring}}, {"shadow_panel", shadows},
|
|
} {
|
|
b.Run(tc.name, func(b *testing.B) {
|
|
benchRender(b, &scene.Scene{Width: w, Height: h, Clear: scene.Color{A: 255}, Ops: tc.ops})
|
|
})
|
|
}
|
|
}
|