mirror of
https://github.com/servo/servo.git
synced 2025-07-02 21:13:39 +01:00
Remove Snapshot::from_shared_memory
to avoid double allocation (#37562)
It was always misused, causing extra allocations all over the place. Discovered in https://github.com/servo/servo/pull/37560#discussion_r2157222917 Testing: WPT tests Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
a97cde0a6f
commit
7d1d50f703
4 changed files with 14 additions and 22 deletions
|
@ -156,20 +156,6 @@ impl Snapshot<Data> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn from_shared_memory(
|
||||
size: Size2D<u32>,
|
||||
format: PixelFormat,
|
||||
alpha_mode: AlphaMode,
|
||||
ism: IpcSharedMemory,
|
||||
) -> Self {
|
||||
Self {
|
||||
size,
|
||||
data: Data::Owned(ism.to_vec()),
|
||||
format,
|
||||
alpha_mode,
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: https://github.com/servo/servo/issues/36594
|
||||
/*
|
||||
/// # Safety
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue