ElyPDF: the old-tile test checks painted area covers the shown page (R2.6); shorter comments in patch 0041

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 07:25:55 -04:00
1 parent 3c6faf9a6e
commit cc589a07b3
8 files changed
+29 -9

No files matched your search

+3 -2
View File
@@ -70,10 +70,11 @@ fn drawn_tile(image: Arc<RenderImage>, page: usize, view: gpui::Entity<PdfView>)
|_, _, _| {},
move |bounds, _, window, cx| match window.paint_image(bounds, bounds, Default::default(), image, 0, false) {
Ok(()) => view.update(cx, |view, _| {
view.painted += 1;
if view.painted == 1 {
let area = f64::from(f32::from(bounds.size.width) * f32::from(bounds.size.height));
if view.painted == 0.0 && area > 0.0 {
log::info!("pdf: first tile drawn, page {page}");
}
view.painted += area;
}),
Err(error) => log::error!("pdf: drawing a page failed: {error}"),
},
+12 -1
View File
@@ -311,7 +311,18 @@ fn old_tiles_are_painted_and_freed_with_their_tab() {
});
cx.run_until_parked();
let (painted, kept) = cx.update(|_, app| (view.read(app).painted, view.read(app).backdrop.len()));
assert!(kept > 0 && painted >= before + kept as u64, "{kept} old tiles, {} paints", painted - before);
// Old tiles cover what shows of the page.
let shown = cx.update(|window, app| {
let read = view.read(app);
let room = read.room;
read.showing(window.scale_factor(), false).iter().map(|s| {
let (left, top) = (-f32::from(read.scroll.offset().x), -f32::from(read.scroll.offset().y));
let w = (s.place.x + s.place.w).min(left + f32::from(room.size.width)) - s.place.x.max(left);
let h = (s.place.y + s.place.h).min(top + f32::from(room.size.height)) - s.place.y.max(top);
f64::from(w.max(0.0) * h.max(0.0))
}).sum::<f64>()
});
assert!(kept > 0 && painted - before >= shown * 0.99, "{kept} old tiles painted {} of {shown}", painted - before);
cx.update(|_, app| view.update(app, |view, _| view.retire_all()));
assert!(cx.update(|_, app| view.read(app).backdrop.is_empty()), "closing hands every old tile over");
}
+3 -3
View File
@@ -37,8 +37,8 @@ pub struct PdfView {
pub tiles: HashMap<TileKey, Arc<RenderImage>>,
/// Images no longer drawn, freed at the next render.
pub retired: ely_gpui_component::primitives::Retired,
/// Tile images painted so far; the first is logged (PERF-05).
pub painted: u64,
/// Tile pixels painted; the first paint is logged (PERF-05).
pub painted: f64,
/// Tiles the worker could not draw; not asked again.
pub failed: HashSet<TileKey>,
/// Old tiles shown under their page until covered.
@@ -167,7 +167,7 @@ impl PdfView {
scroll: ScrollHandle::new(),
tiles: HashMap::new(),
retired: Default::default(),
painted: 0,
painted: 0.0,
failed: HashSet::new(),
backdrop: Vec::new(),
text: HashMap::new(),
@@ -9,7 +9,7 @@ first empty cells right of its data large enough for it, else below
the data, whatever the visible area; the view scrolls to it.
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index b0169d0..fd65434 100644
index b0169d0..b8768af 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -47,6 +47,7 @@
@@ -37,7 +37,7 @@ index b0169d0..fd65434 100644
+ return ScRange(nCol, nRow, nTab, nRight, nBottom, nTab);
+}
+
+/// LOK: the first empty cells right of rData, else below it.
+/// LOK: empty cells right of rData, else below.
+Point lcl_EmptyBeside(const ScDocument& rDoc, const ScRange& rData, const Size& rSize)
+{
+ const SCTAB nTab = rData.aStart.Tab();
@@ -82,7 +82,7 @@ index b0169d0..fd65434 100644
// get chart position (from window size and data range)
- Point aStart = rViewSh.GetChartInsertPos( aSize, aPositionRange );
+ // LOK: beside the data, never over it nor squeezed into view.
+ // LOK: beside the data, never over it, view or not.
+ Point aStart = pRange && comphelper::LibreOfficeKit::isActive()
+ ? lcl_EmptyBeside(rData.GetDocument(), aPositionRange, aSize)
+ : rViewSh.GetChartInsertPos( aSize, aPositionRange );
+1
View File
@@ -0,0 +1 @@
PASS
+3
View File
@@ -0,0 +1,3 @@
FAIL
apps/ely-pdf/src/tests/input.rs:314 — 上一轮的实际画面验证缺陷仍存在。新增回归只比较 painted 计数;pages.rs:71–73 在 paint_image 返回 Ok 时递增,而 GPUI 对零面积绘制直接返回 Ok,页面可见内容仍为空。具体复现:隔离副本仅将 backdrop 图块的布局宽度设为 0,保留全部原有测试与计数逻辑;旧底图因此完全漏绘,等待新图块时页面闪白,新增 old_tiles_are_painted_and_freed_with_their_tab 及全部 120 项测试仍通过。基线同样为 120 项通过。修复方向:核对等待重绘期间实际帧里的旧页面覆盖与文字,并核对批注、可视签名落地后的相应像素区域,使零面积或漏绘底图的变异失败。证据:/tmp/ely-r26-r3-mutation.log、/tmp/ely-r26-r3-mutation-proof.log。上一轮第 101 页尺寸与关闭释放缺陷已独立复验修复:单页模式编辑期间尺寸持续为 612×900,推进关闭后的下一帧后 28 张旧底图的 atlas 条目全部释放,见 /tmp/ely-r26-r3-probes-repeat.log。应用与 worker 独立构建、原生窗口冒烟、范围内注释检查通过;写入前已删除隔离源码与独立构建目录,1248 个原有受跟踪文件散列一致,见 /tmp/ely-r26-r3-audit.log。
+1
View File
@@ -0,0 +1 @@
PASS
+3
View File
@@ -0,0 +1,3 @@
FAIL
apps/ely-table/src/figures.rs:62 — `label` 把格式值内的 `; ` 也当作统计字段分隔符,再以两个空格连接,破坏 R2.8 要求的内核格式保留及 PRD §9.2 TABLE-07 的自定义格式。具体复现:H1、H2 均输入 `8128`,选中 H1:H2,设置合法格式 `0.00" kg; net"`;真实内核给出 `Average: 8128.00 kg; net; Sum: 16256.00 kg; net`,当前界面转换得到 `Average 8128.00 kg net Sum 16256.00 kg net`,两个值中的分号均丢失。独立探针对真实内核状态及生产 `figures::label` 的断言失败,证据见 `/tmp/ely-r28-r3-kernel.log`。修复方向:让统计字段边界与格式字面量可区分,完整保留每个已格式化值,并加入含分号字面量的自定义格式回归。上一轮测试缺陷已复验修复:恢复旧 `tidy` 后新增测试失败;当前 worker 与 ElyTable 构建成功,公式测试 8/8、ElyTable 测试 43/43 通过。探针源码、副本构建目录和增量缓存已清理,原有受跟踪文件哈希一致。