Run source measurement and arrangement in the frame pipeline
Verify Tessera GUI / verify (push) Failing after 7m30s
Verify Tessera GUI / verify (push) Failing after 7m30s
This commit is contained in:
+41
-5
@@ -20,6 +20,9 @@ pub struct Mount {
|
||||
pub geometry: MountGeometry,
|
||||
pub version: u64,
|
||||
pub mounted: bool,
|
||||
// Private derived scratch, installed before the read-only layout call and
|
||||
// cleared by geometry commit. It contains no managed references or roots.
|
||||
pub layout: Option<Arc<Mutex<crate::layout::Context>>>,
|
||||
}
|
||||
|
||||
impl ObjectPayload for Mount {
|
||||
@@ -74,12 +77,28 @@ impl NativeCallable for Method {
|
||||
}
|
||||
let value = match self.query {
|
||||
Query::Bounds => {
|
||||
let geometry = if let Some(layout) = &mount.layout {
|
||||
layout
|
||||
.lock()
|
||||
.map_err(|_| VmError::InvalidArgument("layout context poisoned"))?
|
||||
.bounds
|
||||
.ok_or(VmError::InvalidArgument(
|
||||
"Mount geometry is unavailable during measurement",
|
||||
))?
|
||||
} else {
|
||||
[
|
||||
mount.geometry.x,
|
||||
mount.geometry.y,
|
||||
mount.geometry.width,
|
||||
mount.geometry.height,
|
||||
]
|
||||
};
|
||||
let bounds = cx.new_object()?;
|
||||
for (name, value) in [
|
||||
("x", mount.geometry.x),
|
||||
("y", mount.geometry.y),
|
||||
("width", mount.geometry.width),
|
||||
("height", mount.geometry.height),
|
||||
("x", geometry[0]),
|
||||
("y", geometry[1]),
|
||||
("width", geometry[2]),
|
||||
("height", geometry[3]),
|
||||
] {
|
||||
cx.set_attr(bounds, name, Value::Number((value as f64).into()))?;
|
||||
}
|
||||
@@ -103,6 +122,11 @@ impl NativeCallable for Method {
|
||||
Value::Nil
|
||||
}
|
||||
Query::HitTest => {
|
||||
if mount.layout.is_some() {
|
||||
return Err(VmError::InvalidArgument(
|
||||
"Mount hitTest is unavailable during layout",
|
||||
));
|
||||
}
|
||||
let number = |value: &Value| -> Result<f32, VmError> {
|
||||
let Value::Number(number) = value else {
|
||||
return Err(VmError::InvalidArgument(
|
||||
@@ -164,6 +188,7 @@ struct Sync {
|
||||
old: HashMap<u64, WeakObjectRef>,
|
||||
old_order: Vec<u64>,
|
||||
frame: Frame,
|
||||
preparing: bool,
|
||||
output: Arc<Mutex<HashMap<u64, WeakObjectRef>>>,
|
||||
}
|
||||
|
||||
@@ -251,6 +276,7 @@ impl NativeCallable for Sync {
|
||||
geometry: geometry.clone(),
|
||||
version: self.frame.layout_version,
|
||||
mounted: true,
|
||||
layout: None,
|
||||
})?;
|
||||
crate::ui_bridge::attach_desktop_type(cx, object, "Mount", self.desktop)?;
|
||||
for (name, query) in [
|
||||
@@ -295,9 +321,16 @@ impl NativeCallable for Sync {
|
||||
geometry: geometry.clone(),
|
||||
version: self.frame.layout_version,
|
||||
mounted: true,
|
||||
layout: if self.preparing {
|
||||
Some(Arc::new(Mutex::new(crate::layout::Context::default())))
|
||||
} else {
|
||||
None
|
||||
},
|
||||
};
|
||||
let old = cx.store().payload::<Mount>(object, "Mount")?;
|
||||
if !old.mounted
|
||||
if self.preparing
|
||||
|| old.layout.is_some()
|
||||
|| !old.mounted
|
||||
|| old.version != mount.version
|
||||
|| old.geometry != mount.geometry
|
||||
|| old.page != mount.page
|
||||
@@ -333,6 +366,7 @@ impl NativeCallable for Sync {
|
||||
{
|
||||
let mut mount = cx.store().payload::<Mount>(object, "Mount")?.clone();
|
||||
mount.mounted = false;
|
||||
mount.layout = None;
|
||||
mount.parent = None;
|
||||
mount.first_child = None;
|
||||
mount.next_sibling = None;
|
||||
@@ -384,6 +418,7 @@ impl MountTable {
|
||||
page: Option<ObjectRef>,
|
||||
nodes: Vec<WeakObjectRef>,
|
||||
frame: &Frame,
|
||||
preparing: bool,
|
||||
) -> Result<Option<ObjectRef>, VmError> {
|
||||
let output = Arc::new(Mutex::new(HashMap::new()));
|
||||
let mut captures = vec![desktop];
|
||||
@@ -397,6 +432,7 @@ impl MountTable {
|
||||
old: self.active.clone(),
|
||||
old_order: self.order.clone(),
|
||||
frame: frame.clone(),
|
||||
preparing,
|
||||
output: output.clone(),
|
||||
},
|
||||
captures,
|
||||
|
||||
Reference in New Issue
Block a user