合入界面分区慢帧计时与对话历史回合复用布局(R5-Z12 第一部分)
This commit is contained in:
commit
952104c655
@ -333,6 +333,7 @@ impl PhotocraftApp {
|
||||
}
|
||||
// In Full Screen Mode, Tab shows the menu bar, options bar, toolbar and dock (#6760).
|
||||
let tabbed_in = !chrome && self.ui.panels.full_screen_chrome;
|
||||
let menu_status_start = gpu_canvas::now_ms();
|
||||
if (chrome || tabbed_in) && self.ui.panels.menu_bar {
|
||||
panels::title_bar(self, ui);
|
||||
}
|
||||
@ -342,6 +343,7 @@ impl PhotocraftApp {
|
||||
if chrome && self.ui.panels.status_bar {
|
||||
panels::status_bar(self, ui);
|
||||
}
|
||||
self.perf.stage.ui_regions.menu_status += gpu_canvas::now_ms() - menu_status_start;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
if chrome { crate::jiansun::prepare(self, ui); }
|
||||
if (chrome && self.ui.panels.toolbar) || tabbed_in {
|
||||
|
||||
@ -1444,6 +1444,7 @@ struct CanvasOverlayInput<'a> {
|
||||
}
|
||||
|
||||
fn paint_primary_overlays(app: &mut PhotocraftApp, ui: &mut egui::Ui, view: &mut View, input: &CanvasOverlayInput<'_>, ants: Vec<egui::Shape>) {
|
||||
let overlay_start = crate::gpu_canvas::now_ms();
|
||||
let ctx = input.ctx;
|
||||
let painter = input.painter;
|
||||
let xf = input.xf;
|
||||
@ -1534,6 +1535,7 @@ fn paint_primary_overlays(app: &mut PhotocraftApp, ui: &mut egui::Ui, view: &mut
|
||||
crate::artboard_tool::draw_overlay(app, painter, xf);
|
||||
|
||||
draw_canvas_tool_cursor(app, ui, input, resizing);
|
||||
app.perf.stage.ui_regions.canvas_overlays += crate::gpu_canvas::now_ms() - overlay_start;
|
||||
}
|
||||
|
||||
fn draw_canvas_tool_cursor(app: &mut PhotocraftApp, ui: &mut egui::Ui, input: &CanvasOverlayInput<'_>, resizing: bool) {
|
||||
@ -2267,7 +2269,10 @@ pub fn canvas_view(app: &mut PhotocraftApp, ui: &mut egui::Ui, idx: usize, rect:
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
let (workspace_owns_pointer, workspace_navigation, workspace_camera) = if primary {
|
||||
crate::jiansun::canvas_workspace::overlay(app, ui, xf, doc.id.0, size[0] as f32)
|
||||
let overlay_start = crate::gpu_canvas::now_ms();
|
||||
let overlay = crate::jiansun::canvas_workspace::overlay(app, ui, xf, doc.id.0, size[0] as f32);
|
||||
app.perf.stage.ui_regions.canvas_overlays += crate::gpu_canvas::now_ms() - overlay_start;
|
||||
overlay
|
||||
} else { (false, true, None) };
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
let (workspace_owns_pointer, workspace_navigation) = (false, true);
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
//! into [`SlowFrames`], the last [`SLOW_FRAMES`] of them, which the control channel's `perf`
|
||||
//! output lists as `slowFrames`; one `info` log line per second names them. The stroke trace
|
||||
//! (`stroke_trace`) reads the same record, so the app times a frame in one place.
|
||||
//!
|
||||
//! On the web `now_ms()` is 0, so no frame is ever slow and the ring stays empty.
|
||||
|
||||
use std::collections::VecDeque;
|
||||
|
||||
@ -19,6 +17,18 @@ pub const SLOW_FRAMES: usize = 64;
|
||||
/// At most one slow-frame log line per this many ms.
|
||||
const LOG_EVERY_MS: f64 = 1000.0;
|
||||
|
||||
/// UI build time per region, in milliseconds.
|
||||
#[derive(Clone, Debug, Default, PartialEq, serde::Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct UiRegions {
|
||||
pub conversation: f64,
|
||||
pub production_head: f64,
|
||||
pub composer: f64,
|
||||
pub dock_panels: f64,
|
||||
pub canvas_overlays: f64,
|
||||
pub menu_status: f64,
|
||||
}
|
||||
|
||||
/// One frame's stages. Times in ms.
|
||||
#[derive(Clone, Debug, Default, PartialEq, serde::Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@ -28,6 +38,8 @@ pub struct FrameStages {
|
||||
/// The whole frame: from its start until its UI is built. Never less than the stages below
|
||||
/// (a command run between frames counts toward the next one).
|
||||
pub frame_ms: f64,
|
||||
/// Time building individual UI regions, included in `ui_ms`.
|
||||
pub ui_regions: UiRegions,
|
||||
/// From the raw input hook to the start of the UI build (input handling, minus commands).
|
||||
pub input_ms: f64,
|
||||
/// Commands run through the app since the previous frame ended.
|
||||
@ -116,8 +128,9 @@ impl FrameStages {
|
||||
pub fn line(&self) -> String {
|
||||
let opt = |v: Option<f64>| v.map_or("-".to_string(), |v| format!("{v:.1}"));
|
||||
let command = if self.command.is_empty() { String::new() } else { format!(" ({})", self.command) };
|
||||
let UiRegions { conversation, production_head, composer, dock_panels, canvas_overlays, menu_status } = self.ui_regions;
|
||||
format!(
|
||||
"slow frame: {:.1} ms on the {} path: input {:.1}, command {:.1}{command}, damage {:.1}, composite {:.1}, upload {:.1}, gpu {}, present {}; refresh {} {} px",
|
||||
"slow frame: {:.1} ms on the {} path: input {:.1}, command {:.1}{command}, damage {:.1}, composite {:.1}, upload {:.1}, gpu {}, present {}; refresh {} {} px; ui conversation {conversation:.1}, production head {production_head:.1}, composer {composer:.1}, dock panels {dock_panels:.1}, canvas overlays {canvas_overlays:.1}, menu/status {menu_status:.1}",
|
||||
self.frame_ms,
|
||||
self.path,
|
||||
self.input_ms,
|
||||
@ -269,6 +282,21 @@ mod tests {
|
||||
assert!(next.stage_ms() <= next.frame_ms);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ui_regions_are_kept_in_the_log_and_control_output() {
|
||||
let mut ring = SlowFrames::default();
|
||||
let mut stage = frame(1000.0, 0.0);
|
||||
stage.ui_regions.conversation = 38.0;
|
||||
stage.ui_regions.dock_panels = 3.0;
|
||||
ring.finish(stage, 1060.0, false, None);
|
||||
let line = ring.frames().next().unwrap().line();
|
||||
assert!(line.contains("ui conversation 38.0"));
|
||||
assert!(line.contains("dock panels 3.0"));
|
||||
let value = serde_json::to_value(&ring).unwrap();
|
||||
assert_eq!(value[0]["uiRegions"]["conversation"], 38.0);
|
||||
assert_eq!(value[0]["uiRegions"]["dockPanels"], 3.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn slow_frame_log_is_rate_limited() {
|
||||
let mut r = SlowFrames::default();
|
||||
|
||||
@ -74,6 +74,12 @@ const CONTINUE_PRODUCTION: &str = "继续制作整套";
|
||||
|
||||
/// A settled turn owns no request, pause or unresolved result. Follow-ups and
|
||||
/// composer suggestions both wait for it.
|
||||
#[derive(Clone, Default)]
|
||||
struct ConversationRows {
|
||||
layout: Option<(Id, usize, u32, u32, crate::theme::ThemeKind)>,
|
||||
rects: Vec<Option<Rect>>,
|
||||
}
|
||||
|
||||
fn conversation_settled(workspace: &Workspace, production: bool) -> bool {
|
||||
!production && workspace.turn_idle() && !workspace.unknown && !workspace.pi_review
|
||||
&& !workspace.agent_effects_paused && workspace.error.is_empty() && workspace.stream_reply.is_empty()
|
||||
@ -1123,6 +1129,7 @@ impl Workspace {
|
||||
visuals.widgets.active.weak_bg_fill = t.pressed;
|
||||
visuals.widgets.active.bg_stroke = Stroke::new(1.0, t.text_dim);
|
||||
|
||||
let composer_start = crate::gpu_canvas::now_ms();
|
||||
let input_id = super::composer_input_id();
|
||||
let mut focused = ui.memory(|m| m.has_focus(input_id));
|
||||
// An empty editor loses focus on toolbar press. Keep its surface in
|
||||
@ -1224,7 +1231,13 @@ impl Workspace {
|
||||
}
|
||||
});
|
||||
self.pi_ui_decorations(ui,false);
|
||||
if production { self.production_head_ui(app, ui); }
|
||||
app.perf.stage.ui_regions.composer += crate::gpu_canvas::now_ms() - composer_start;
|
||||
if production {
|
||||
let head_start = crate::gpu_canvas::now_ms();
|
||||
self.production_head_ui(app, ui);
|
||||
app.perf.stage.ui_regions.production_head += crate::gpu_canvas::now_ms() - head_start;
|
||||
}
|
||||
let conversation_start = crate::gpu_canvas::now_ms();
|
||||
let jump_id = Id::unique("jiansun-conversation-jump");
|
||||
let jump = ui.ctx().data_mut(|data| data.remove_temp::<bool>(jump_id)).unwrap_or(false);
|
||||
let timeline_viewport = ui.available_rect_before_wrap();
|
||||
@ -1256,6 +1269,15 @@ impl Workspace {
|
||||
self.loaded_draft,
|
||||
));
|
||||
let trace_id = conversation_id.with(("candidate-trace", app.session.active().map(|state| state.revision)));
|
||||
let rows_id = ui.scope_id().with("conversation-row-layout");
|
||||
let mut rows = ui.data_mut(|data| data.remove_temp::<ConversationRows>(rows_id)).unwrap_or_default();
|
||||
let layout = Some((trace_id, count, column_width.to_bits(), ui.pixels_per_point().to_bits(), app.ui.theme));
|
||||
if rows.layout != layout {
|
||||
rows.layout = layout;
|
||||
rows.rects.clear();
|
||||
}
|
||||
rows.rects.resize(turn_count, None);
|
||||
let visible_rows = ui.clip_rect().expand2(vec2(0.0, 240.0));
|
||||
let trace_scope = json!([self.origin,self.account["id"],self.project_context["localId"],
|
||||
app.session.active().map(|state| state.doc.id.0),self.loaded_draft,app.session.active().map(|state| state.revision)]);
|
||||
let pending_trace = self.pending_candidate_trace.take().filter(|pending| pending["scope"] == trace_scope)
|
||||
@ -1273,11 +1295,25 @@ impl Workspace {
|
||||
for (index, turn) in conversation.into_iter().enumerate() {
|
||||
let turn_id = turn.user_index;
|
||||
let last = index + 1 == turn_count;
|
||||
let anchor = ui.next_widget_position().to_vec2();
|
||||
let highlight = ui.data(|data| data.get_temp::<(Option<usize>, f64)>(trace_id))
|
||||
.filter(|(highlighted, _)| *highlighted == turn_id);
|
||||
// A measured historical turn can reserve its old layout without building
|
||||
// widgets. Always lay out the live turn and any explicit trace destination.
|
||||
if !last && pending_trace != Some(turn_id) && highlight.is_none()
|
||||
&& let Some(rect) = rows.rects[index].map(|rect| rect.translate(anchor))
|
||||
&& !rect.intersects(visible_rows)
|
||||
{
|
||||
ui.advance_cursor_after_rect(rect);
|
||||
ui.add_space(20.0);
|
||||
continue;
|
||||
}
|
||||
let background = agent_motion::reserve_background(ui);
|
||||
let response = ui.push_id(index, |ui| {
|
||||
ui.set_width(column_width);
|
||||
self.turn_ui(ui, turn, conversation_id, count, last)
|
||||
});
|
||||
rows.rects[index] = Some(response.response.rect.translate(-anchor));
|
||||
if let Some(target) = response.inner {
|
||||
locate = Some(target);
|
||||
}
|
||||
@ -1298,6 +1334,7 @@ impl Workspace {
|
||||
}
|
||||
ui.add_space(20.0);
|
||||
}
|
||||
ui.data_mut(|data| data.insert_temp(rows_id, rows));
|
||||
if let Some(geometry)=ui.ctx().data(|data|data.get_temp::<Value>(Id::unique("copy-options-geometry"))){self.panel_geometry["copywritingOptions"]=geometry;}
|
||||
if let Some(geometry)=ui.ctx().data(|data|data.get_temp::<Value>(Id::unique("copy-fields-geometry"))){self.panel_geometry["copywritingFields"]=geometry;}
|
||||
if let Some(geometry)=ui.ctx().data(|data|data.get_temp::<Value>(Id::unique("pi-ui-geometry"))){self.panel_geometry["piUi"]=geometry;}
|
||||
@ -1376,6 +1413,7 @@ impl Workspace {
|
||||
self.panel_geometry["latestMessage"] = rect_value(response.rect);
|
||||
if response.clicked() { ui.ctx().data_mut(|data| data.insert_temp(jump_id, true)); }
|
||||
}
|
||||
app.perf.stage.ui_regions.conversation += crate::gpu_canvas::now_ms() - conversation_start;
|
||||
}
|
||||
|
||||
/// Only render request-owned snapshots; the currently selected canvas
|
||||
@ -3868,12 +3906,16 @@ mod tests {
|
||||
}
|
||||
|
||||
fn dock_fixture() -> (PhotocraftApp, mpsc::Receiver<Request>) {
|
||||
dock_fixture_with_size(3600)
|
||||
}
|
||||
|
||||
fn dock_fixture_with_size(height: u32) -> (PhotocraftApp, mpsc::Receiver<Request>) {
|
||||
let (tx, requests) = mpsc::channel();
|
||||
let (_, rx) = mpsc::channel();
|
||||
let mut w = Workspace::new(tx, rx);
|
||||
while requests.try_recv().is_ok() {}
|
||||
let mut session = photocraft_engine::Session::new();
|
||||
session.execute("file.new", json!({"width":1440,"height":3600,"name":"小壹 · 本地界面验收"})).unwrap();
|
||||
session.execute("file.new", json!({"width":1440,"height":height,"name":"小壹 · 本地界面验收"})).unwrap();
|
||||
let services = crate::Services {
|
||||
import: Some(Box::new(|name, bytes, depth| {
|
||||
photocraft_io::import_with_options(name, bytes, depth).map(|r| (r.document, r.warnings)).map_err(|error| error.to_string())
|
||||
@ -4110,7 +4152,11 @@ mod tests {
|
||||
}
|
||||
|
||||
fn live_production_fixture() -> (PhotocraftApp, mpsc::Receiver<Request>) {
|
||||
let (mut app, requests) = dock_fixture();
|
||||
live_production_fixture_with_size(3600)
|
||||
}
|
||||
|
||||
fn live_production_fixture_with_size(height: u32) -> (PhotocraftApp, mpsc::Receiver<Request>) {
|
||||
let (mut app, requests) = dock_fixture_with_size(height);
|
||||
let w = app.jiansun.as_mut().unwrap();
|
||||
w.composer.clear();
|
||||
w.pi_run = Some("offline-production".into());
|
||||
@ -4169,6 +4215,143 @@ mod tests {
|
||||
[(1, WorkerStage::Generating), (2, WorkerStage::Generating), (27, WorkerStage::Reviewing)]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn long_conversation_frame_budget() {
|
||||
use std::time::Instant;
|
||||
|
||||
let (mut app, _requests) = live_production_fixture_with_size(34_838);
|
||||
for index in 0..299 {
|
||||
app.session.execute("layer.new.layer", json!({"name":format!("详情图层 {index}")})).unwrap();
|
||||
}
|
||||
app.session.execute("type.create", json!({"text":"原始标题","x":40,"y":40})).unwrap();
|
||||
let state = app.session.active_mut().unwrap();
|
||||
let layer = state.selected_layers()[0].0;
|
||||
let doc = Arc::make_mut(&mut state.doc);
|
||||
let pages = json!([{"documentId":"S01","outputId":"detail","mapping":{"fields":[
|
||||
{"kind":"image","slotId":"hero"},{"kind":"image","slotId":"scene"}
|
||||
]}}]);
|
||||
let mapping = json!({"version":1,"canvasFirst":true,"workspaceId":"offline",
|
||||
"templateId":"chair","templateVersion":"1","templateHash":"offline",
|
||||
"variantId":"wood","component":"detail","outputs":pages});
|
||||
doc.metadata.text.push(("jiansun.slot-mapping.v1".into(), mapping.to_string()));
|
||||
let w = app.jiansun.as_mut().unwrap();
|
||||
for key in ["workspaceId", "templateId", "templateVersion", "templateHash", "variantId"] {
|
||||
w.template_workflow[key] = mapping[key].clone();
|
||||
}
|
||||
w.template_workflow["outputs"] = pages;
|
||||
for slot in w.template_workflow["slots"].as_array_mut().unwrap() {
|
||||
slot["documentId"] = json!("S01");
|
||||
slot["variantId"] = json!("wood");
|
||||
}
|
||||
w.owner_doc = Some(doc.id.0);
|
||||
w.observed_doc = w.owner_doc;
|
||||
w.pi_binding = json!({"accountId":w.account["id"],"origin":w.origin});
|
||||
let mut progress = w.workflow.production_progress().clone();
|
||||
progress["pictureCells"] = json!((0..16).map(|i| json!({"slotId":format!("pic-{i}"),"label":format!("图位 {i}"),"state":"verified"})).collect::<Vec<_>>());
|
||||
progress["copyCells"] = json!(vec![json!({"state":"filled"}); 33]);
|
||||
w.workflow.set_production_progress(&progress);
|
||||
let active_turn = std::mem::take(&mut w.messages);
|
||||
for index in 0..60 {
|
||||
w.messages.extend([
|
||||
json!({"role":"user","text":"保留椅子的木纹和结构,补一张自然光下的细节图。"}),
|
||||
json!({"role":"assistant","kind":"thinking","active":false}),
|
||||
json!({"role":"assistant","kind":"activity","text":"工具活动","event":{
|
||||
"version":1,"type":"tool","toolCallId":format!("read-{index}"),"toolName":"canvas_read","status":"completed","durationMs":320
|
||||
}}),
|
||||
json!({"role":"assistant","kind":"image","taskId":format!("candidate-{index}"),"width":1440,"height":1800}),
|
||||
json!({"role":"assistant","kind":"reply","text":"候选图已生成。保留当前画布,确认光线和细节后可以采纳这张图。"}),
|
||||
json!({"role":"assistant","kind":"copywriting-fields","optionsId":format!("copy-{index}"),"items":[
|
||||
{"layer":layer,"name":"主标题","field":{"fieldId":"S01-T01","label":"主标题","maxChars":16,"maxLines":1},
|
||||
"original":"原始标题","text":"自然木纹餐椅","applied":false}
|
||||
],"target":{}}),
|
||||
]);
|
||||
}
|
||||
w.messages.extend(active_turn);
|
||||
let screenshots = std::env::var_os("PHOTOCRAFT_LONG_CONVERSATION_QA_OUT").map(std::path::PathBuf::from);
|
||||
let _gpu = screenshots.as_ref().map(|_| photocraft_testkit::gpu_lock());
|
||||
let builder = egui_kittest::Harness::builder()
|
||||
.with_size(vec2(1440.0, 900.0)).with_max_steps(4);
|
||||
let builder = if screenshots.is_some() { builder.wgpu() } else { builder };
|
||||
let mut harness = builder.build_eframe(move |cc| {
|
||||
PhotocraftApp::setup_context(&cc.egui_ctx, crate::theme::ThemeKind::ProMedium);
|
||||
crate::cjk_fonts::install_system_provider_for_tests(&cc.egui_ctx);
|
||||
let workspace = app.jiansun.as_mut().unwrap();
|
||||
workspace.pi_touched = Instant::now();
|
||||
let images = &mut workspace.agent_images;
|
||||
for index in 0..60 {
|
||||
let id = format!("candidate-{index}");
|
||||
let image = egui::ColorImage::filled([96, 120], Color32::from_rgb(index * 3, 92, 52));
|
||||
images.insert(id.clone(), cc.egui_ctx.load_texture(id, image, egui::TextureOptions::LINEAR));
|
||||
}
|
||||
app
|
||||
});
|
||||
harness.run_steps(8);
|
||||
let app = harness.state_mut();
|
||||
let panel = &app.jiansun.as_ref().unwrap().panel_geometry;
|
||||
assert_eq!(panel["open"], true);
|
||||
assert!(panel["productionProgress"].is_array(), "{panel}");
|
||||
app.slow_frames.set_threshold_ms(0.0);
|
||||
if let Some(directory) = screenshots {
|
||||
std::fs::create_dir_all(&directory).unwrap();
|
||||
let point = geometry(app.jiansun.as_ref().unwrap(), "conversationClip").center();
|
||||
for (name, delta) in [("bottom", 0.0), ("recent", 1400.0), ("history", 7000.0)] {
|
||||
if delta != 0.0 {
|
||||
harness.event(egui::Event::PointerMoved(point));
|
||||
harness.event(egui::Event::MouseWheel {
|
||||
source: egui::MouseWheelSource::Unknown,
|
||||
phase: egui::TouchPhase::Move,
|
||||
unit: egui::MouseWheelUnit::Point,
|
||||
delta: vec2(0.0, delta),
|
||||
modifiers: egui::Modifiers::NONE,
|
||||
});
|
||||
harness.step();
|
||||
harness.run_steps(12);
|
||||
}
|
||||
harness.render().unwrap().save(directory.join(format!("{name}.png"))).unwrap();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
let thread_cpu_ticks = || {
|
||||
let (_, _, kernel, user) = winsafe::HTHREAD::GetCurrentThread().GetThreadTimes().unwrap();
|
||||
u64::from(kernel) + u64::from(user)
|
||||
};
|
||||
#[cfg(target_os = "windows")]
|
||||
let cpu_start = (Instant::now(), thread_cpu_ticks());
|
||||
|
||||
let mut samples = Vec::with_capacity(600);
|
||||
let mut total = 0.0;
|
||||
let mut regions = [0.0; 6];
|
||||
for _ in 0..600 {
|
||||
// Keep the offline run connected across all 600 frames.
|
||||
harness.state_mut().jiansun.as_mut().unwrap().pi_touched = Instant::now();
|
||||
let started = Instant::now();
|
||||
harness.step();
|
||||
samples.push(started.elapsed().as_secs_f64() * 1000.0);
|
||||
let frame = harness.state().slow_frames.frames().next_back().unwrap();
|
||||
let ui = &frame.ui_regions;
|
||||
total += frame.frame_ms;
|
||||
for (sum, time) in regions.iter_mut().zip([
|
||||
ui.conversation, ui.production_head, ui.composer, ui.dock_panels, ui.canvas_overlays, ui.menu_status,
|
||||
]) {
|
||||
*sum += time;
|
||||
}
|
||||
}
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let cpu_ms = (thread_cpu_ticks() - cpu_start.1) as f64 / 10_000.0;
|
||||
let cpu_share = cpu_ms / (cpu_start.0.elapsed().as_secs_f64() * 10.0);
|
||||
eprintln!("UI thread CPU: {cpu_ms:.1} ms ({cpu_share:.1}% of one core)");
|
||||
}
|
||||
samples.sort_unstable_by(f64::total_cmp);
|
||||
let (p50, p95, p99, max) = (samples[299], samples[569], samples[593], samples[599]);
|
||||
let shares = regions.map(|time| time * 100.0 / total);
|
||||
eprintln!("600 frames: p50 {p50:.2}, p95 {p95:.2}, p99 {p99:.2}, max {max:.2} ms");
|
||||
eprintln!("Percent of frame build (conversation, head, composer, dock, overlays, menu/status): {shares:.1?}");
|
||||
assert!(p95 <= 150.0, "long conversation p95 {p95:.2} ms");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "GPU screenshots from the production dock with offline fixtures"]
|
||||
fn agent_panel_batch2_gpu_evidence() {
|
||||
|
||||
@ -108,10 +108,14 @@ pub fn request_dock_width(ctx: &egui::Context, w: f32) {
|
||||
/// One dock group's tab content; `panel_docking` bounds it and scrolls it when it's taller.
|
||||
pub(crate) fn dock_body(app: &mut PhotocraftApp, ui: &mut egui::Ui, group: crate::dock::Group, tab: usize) {
|
||||
use crate::dock::Group;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
if (group, tab) == (Group::Color, 4) {
|
||||
crate::jiansun::agent_dock(app, ui);
|
||||
return;
|
||||
}
|
||||
let start = crate::gpu_canvas::now_ms();
|
||||
let pro = Tokens::get(ui.ctx()).pro;
|
||||
match (group, tab) {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
(Group::Color, 4) => crate::jiansun::agent_dock(app, ui),
|
||||
(Group::Color, 2) => crate::preset_panels::gradients_panel(app, ui),
|
||||
(Group::Color, 3) => crate::preset_panels::patterns_panel(app, ui),
|
||||
// The Color tab is the same in every theme, in the mode picked from its panel menu
|
||||
@ -132,4 +136,5 @@ pub(crate) fn dock_body(app: &mut PhotocraftApp, ui: &mut egui::Ui, group: crate
|
||||
(Group::Layers, _) => crate::vector_ui::paths_panel(app, ui),
|
||||
(Group::Brushes, _) => crate::brushes_tab::show(app, ui),
|
||||
}
|
||||
app.perf.stage.ui_regions.dock_panels += crate::gpu_canvas::now_ms() - start;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user