Keep the Apps screen smooth on phones
The launcher rebuilt both app groups' catalogs and the shared Apps UI parsed them again on every frame, so the Apps screen and leaving it ran at about 5 fps on a Pixel 3a. Each group's catalog now carries a revision, and an unchanged catalog is answered as unchanged (Apps 8b2ed79). Pins the Apps controller built from that commit. Updating Apps through ziran also moves the shared Kryon pin to 06d10bdf, the local checkout.
This commit is contained in:
1 parent
101a72657f
commit
8e781e5799
3 files changed
+42
-23
No files matched your search
@@ -70,6 +70,10 @@ LauncherAppGroup :: struct {
|
||||
|
||||
launcher_app_groups: [2]LauncherAppGroup;
|
||||
launcher_app_catalogs: [2]string;
|
||||
// Each group's catalog without its revision, and that revision. The Apps
|
||||
// controller keeps an unchanged catalog instead of parsing it every frame.
|
||||
launcher_app_catalog_bodies: [2]string;
|
||||
launcher_app_revisions: [2]s64;
|
||||
launcher_app_button_codec: WidgetButtonPropsCodec;
|
||||
|
||||
LauncherAppPackage :: (route: s32) -> s32 {
|
||||
@@ -134,7 +138,12 @@ LauncherAppService :: (context: *void, text: string) -> string {
|
||||
group := cast(*LauncherAppGroup)context
|
||||
request: Rules.AppsRequest
|
||||
if !Rules.AppsReadRequest(text, *request) { return "" }
|
||||
if request.operation == Rules.APPS_CATALOG { return launcher_app_catalogs[group.index] }
|
||||
if request.operation == Rules.APPS_CATALOG {
|
||||
if request.revision > 0 && request.revision == launcher_app_revisions[group.index] {
|
||||
return "{\"v\":1,\"unchanged\":true}"
|
||||
}
|
||||
return launcher_app_catalogs[group.index]
|
||||
}
|
||||
if request.operation == Rules.APPS_STATUS {
|
||||
if request.request != group.sequence { return "" }
|
||||
return LauncherAppReply(group, group.status)
|
||||
@@ -382,17 +391,27 @@ app_launcher_shared_group :: (app: *InnerBreeze, section: s32, routes: []s32,
|
||||
Controller.AppControllerPlatform.{.context = cast(*void)group,
|
||||
.service = LauncherAppService, .widgets = LauncherAppWidgets}) { return false }
|
||||
}
|
||||
PackageFree(launcher_app_catalogs[section])
|
||||
group.count = 0
|
||||
document: Vec(u8)
|
||||
BuilderPrint(*document, "{\"v\":1,\"title\":\"\",\"locale\":")
|
||||
BuilderPrint(*document, "\"title\":\"\",\"locale\":")
|
||||
Rules.AppsWriteQuoted(*document, LocaleActiveCode())
|
||||
BuilderPrint(*document, ",\"presentation\":{\"mode\":\"icon\",\"tile_class\":%,\"action_class\":%,\"muted_class\":%},\"children\":[",
|
||||
KssClassId(KssMakeName("launcher-tile")), KssClassId(KssMakeName("launcher-action")), KssClassId(KssMakeName("launcher-muted")))
|
||||
for route: routes { LauncherAppCatalogEntry(group, *document, route) }
|
||||
for offer: offers { LauncherAppCatalogEntry(group, *document, -1, offer) }
|
||||
BuilderPrint(*document, "]}")
|
||||
launcher_app_catalogs[section] = BuilderFinish(document)
|
||||
body := BuilderFinish(document)
|
||||
if launcher_app_revisions[section] > 0 && body == launcher_app_catalog_bodies[section] {
|
||||
PackageFree(body)
|
||||
} else {
|
||||
PackageFree(launcher_app_catalog_bodies[section])
|
||||
launcher_app_catalog_bodies[section] = body
|
||||
launcher_app_revisions[section] += 1
|
||||
catalog: Vec(u8)
|
||||
BuilderPrint(*catalog, "{\"v\":1,\"revision\":%,%", launcher_app_revisions[section], body)
|
||||
PackageFree(launcher_app_catalogs[section])
|
||||
launcher_app_catalogs[section] = BuilderFinish(catalog)
|
||||
}
|
||||
group.controller.app.session = app.ui.session
|
||||
group.controller.app.bounds = bounds
|
||||
group.controller.app.dark = app.dark_mode != 0
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// Trusted shared Apps UI reviewed for this host. Containers may carry these
|
||||
// bytes, but cannot select or replace the host's controller trust anchor.
|
||||
AppsControllerSha256 :: "aac28dbb360304544b517bfcdb7889b636d63ec4b75b06fad37a0401c313895c"
|
||||
AppsControllerSha256 :: "e1f3536ae7490f48f72f555fb3e71ca760098f4adc2f2109560b0d647e283426"
|
||||
+18
-18
@@ -12,7 +12,7 @@
|
||||
},
|
||||
{
|
||||
"commit": "aa1281eba2ed3adc93308e0a80196e32683e7a0b",
|
||||
"dependencies": {"kryon": "p63a696f4944cc536"},
|
||||
"dependencies": {"kryon": "pe36a130dad1424fc"},
|
||||
"id": "p0a9cefe423582025",
|
||||
"name": "plot",
|
||||
"ref": "master",
|
||||
@@ -27,14 +27,6 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/LoupVaillant/Monocypher.git"
|
||||
},
|
||||
{
|
||||
"commit": "c174c4c9924fa945fe2c7dfbbe2662f3b879cbea",
|
||||
"dependencies": {"crypto": "p7a547cc31d71f0e5", "kryon": "p63a696f4944cc536"},
|
||||
"id": "p41f45fa3517a0d81",
|
||||
"name": "Apps",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/apps.git"
|
||||
},
|
||||
{
|
||||
"commit": "5cc7677b290f0448462410f7c7e85f518664b943",
|
||||
"dependencies": {"liboqs": "pfb3df7cb222b1bdc"},
|
||||
@@ -62,19 +54,19 @@
|
||||
},
|
||||
{
|
||||
"commit": "e9410df5b4ebd23b7e049db8a00742bf6930478c",
|
||||
"dependencies": {"daochi_client": "p96e1f539ccb91af5", "kryon": "p63a696f4944cc536", "monocypher": "p0bd527640057f7d4", "qrcode": "pf0ce9cea355c9228"},
|
||||
"dependencies": {"daochi_client": "p96e1f539ccb91af5", "kryon": "pe36a130dad1424fc", "monocypher": "p0bd527640057f7d4", "qrcode": "pf0ce9cea355c9228"},
|
||||
"id": "p631e0098a83ae5d4",
|
||||
"name": "Self",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/self.git"
|
||||
},
|
||||
{
|
||||
"commit": "b7591d503329356eebc5e0ccc43e398dc6b978d5",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "p63a696f4944cc536",
|
||||
"name": "kryon",
|
||||
"commit": "8b2ed79338452b5a64aff032b7d512951766845f",
|
||||
"dependencies": {"crypto": "p7a547cc31d71f0e5", "kryon": "pe36a130dad1424fc"},
|
||||
"id": "p65875adec8ce924a",
|
||||
"name": "Apps",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
"url": "https://github.com/waozixyz/apps.git"
|
||||
},
|
||||
{
|
||||
"commit": "187f59dfa2df8c60455fd7ce35afb85204e49acb",
|
||||
@@ -86,7 +78,7 @@
|
||||
},
|
||||
{
|
||||
"commit": "41538659afbbda300915ef009b55c18f6de159b8",
|
||||
"dependencies": {"kryon": "p63a696f4944cc536"},
|
||||
"dependencies": {"kryon": "pe36a130dad1424fc"},
|
||||
"id": "p9504fb8e5fabefc6",
|
||||
"name": "Kss",
|
||||
"ref": "master",
|
||||
@@ -102,7 +94,7 @@
|
||||
},
|
||||
{
|
||||
"commit": "7aa01465ac3f988e0404f3c6dc244bf4b009f253",
|
||||
"dependencies": {"kryon": "p63a696f4944cc536"},
|
||||
"dependencies": {"kryon": "pe36a130dad1424fc"},
|
||||
"id": "paa08e1730a25bda0",
|
||||
"name": "Game2D",
|
||||
"ref": "master",
|
||||
@@ -117,6 +109,14 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/curl/curl.git"
|
||||
},
|
||||
{
|
||||
"commit": "06d10bdf08202387165afada57adb8fc87d7fa9c",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "pe36a130dad1424fc",
|
||||
"name": "kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "58626f682afbc2e3467e8c2e5b37f7f29d89ed99",
|
||||
"dependencies": {},
|
||||
@@ -145,7 +145,7 @@
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {"apps": "p41f45fa3517a0d81", "crypto": "p7a547cc31d71f0e5", "curl": "pd4bcd11b7d623073", "daochi_client": "p96e1f539ccb91af5", "game2d": "paa08e1730a25bda0", "kryon": "p63a696f4944cc536", "kss": "p9504fb8e5fabefc6", "liboqs": "pfb3df7cb222b1bdc", "mingcute": "p56788fa3dab3e73a", "monocypher": "p0bd527640057f7d4", "oqs": "p55635fc8976895a9", "plot": "p0a9cefe423582025", "qrcode": "pf0ce9cea355c9228", "rini": "p09fa77e94b0dfc6c", "self": "p631e0098a83ae5d4", "sqlite": "peaa43c4b7ef72edf"},
|
||||
"dependencies": {"apps": "p65875adec8ce924a", "crypto": "p7a547cc31d71f0e5", "curl": "pd4bcd11b7d623073", "daochi_client": "p96e1f539ccb91af5", "game2d": "paa08e1730a25bda0", "kryon": "pe36a130dad1424fc", "kss": "p9504fb8e5fabefc6", "liboqs": "pfb3df7cb222b1bdc", "mingcute": "p56788fa3dab3e73a", "monocypher": "p0bd527640057f7d4", "oqs": "p55635fc8976895a9", "plot": "p0a9cefe423582025", "qrcode": "pf0ce9cea355c9228", "rini": "p09fa77e94b0dfc6c", "self": "p631e0098a83ae5d4", "sqlite": "peaa43c4b7ef72edf"},
|
||||
"name": "Inbe"
|
||||
},
|
||||
"toolchain": {
|
||||
|
||||
Reference in new issue
Block a user