mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 06:28:12 +08:00
Port the create_context render test onto record wires
This commit is contained in:
@@ -221,7 +221,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn create_context_builds_the_render_context_from_the_root_vararg() {
|
fn create_context_builds_the_render_context_from_the_root_vararg() {
|
||||||
let arena = Arena::new(256).unwrap();
|
let arena = Arena::new(4096).unwrap();
|
||||||
let generations = [];
|
let generations = [];
|
||||||
let scope = EvalScope::new(None, None, None, &generations, &arena);
|
let scope = EvalScope::new(None, None, None, &generations, &arena);
|
||||||
let root = ContextImpl::root(&scope);
|
let root = ContextImpl::root(&scope);
|
||||||
@@ -240,12 +240,16 @@ mod tests {
|
|||||||
};
|
};
|
||||||
let ctx = root.with_varargs(&varargs);
|
let ctx = root.with_varargs(&varargs);
|
||||||
|
|
||||||
let graph = CreateContextNode::new(ProbeNode);
|
let probe = core_types::record::RecordLift::<RenderOutput, _>::new(ProbeNode);
|
||||||
let GPoll::Final(result) = <CreateContextNode<ProbeNode> as Node<ContextImpl>>::eval(&graph, &ctx) else {
|
let layout = Node::<ContextImpl>::layout(&probe).clone();
|
||||||
|
core_types::record::stack::reserve(layout.frame_bytes().max(1 << 12));
|
||||||
|
let graph = CreateContextNode::new(probe, &layout);
|
||||||
|
let GPoll::Final(result) = Node::<ContextImpl>::eval(&graph, &ctx) else {
|
||||||
panic!("create_context must complete synchronously");
|
panic!("create_context must complete synchronously");
|
||||||
};
|
};
|
||||||
|
let output: &RenderOutput = unsafe { core_types::record::borrow_element(layout.rec(&result)) };
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.data,
|
output.data,
|
||||||
RenderOutputType::Buffer {
|
RenderOutputType::Buffer {
|
||||||
data: Vec::new(),
|
data: Vec::new(),
|
||||||
width: 0,
|
width: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user