mirror of
https://github.com/servo/servo.git
synced 2025-07-31 03:00:29 +01:00
Measure heap memory usage for more types. Fixes #6951
This commit is contained in:
parent
94c8dcd575
commit
45145108da
175 changed files with 669 additions and 94 deletions
|
@ -6,12 +6,13 @@ use ipc_channel::ipc::IpcSharedMemory;
|
|||
use png;
|
||||
use stb_image::image as stb_image2;
|
||||
use std::mem;
|
||||
use util::mem::HeapSizeOf;
|
||||
use util::vec::byte_swap;
|
||||
|
||||
// FIXME: Images must not be copied every frame. Instead we should atomically
|
||||
// reference count them.
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, HeapSizeOf)]
|
||||
pub enum PixelFormat {
|
||||
K8, // Luminance channel only
|
||||
KA8, // Luminance + alpha
|
||||
|
@ -19,11 +20,12 @@ pub enum PixelFormat {
|
|||
RGBA8, // RGB + alpha, 8 bits per channel
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, HeapSizeOf)]
|
||||
pub struct Image {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub format: PixelFormat,
|
||||
#[ignore_heap_size_of = "Defined in ipc-channel"]
|
||||
pub bytes: IpcSharedMemory,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue