mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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
|
@ -17,7 +17,7 @@ use cssparser::color::clamp_unit_f32;
|
|||
use cssparser::{Parser, ParserInput};
|
||||
use euclid::default::{Point2D, Rect, Size2D, Transform2D};
|
||||
use euclid::vec2;
|
||||
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use net_traits::image_cache::{ImageCache, ImageResponse};
|
||||
use net_traits::request::CorsSettings;
|
||||
use pixels::PixelFormat;
|
||||
|
@ -358,11 +358,11 @@ impl CanvasState {
|
|||
premultiplied: false,
|
||||
};
|
||||
|
||||
Some(snapshot::Snapshot::from_shared_memory(
|
||||
Some(snapshot::Snapshot::from_vec(
|
||||
size.cast(),
|
||||
format,
|
||||
alpha_mode,
|
||||
IpcSharedMemory::from_bytes(img.first_frame().bytes),
|
||||
img.first_frame().bytes.to_vec(),
|
||||
))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue