[][src]Struct webrender::api::ImageDescriptor

pub struct ImageDescriptor {
    pub format: ImageFormat,
    pub size: TypedSize2D<u32, DevicePixel>,
    pub stride: Option<u32>,
    pub offset: u32,
    pub is_opaque: bool,
    pub allow_mipmaps: bool,
}

Metadata (but not storage) describing an image In WebRender.

Fields

Format of the image data.

Width and length of the image data, in pixels.

The number of bytes from the start of one row to the next. If non-None, compute_stride will return this value, otherwise it returns width * bpp. Different source of images have different alignment constraints for rows, so the stride isn't always equal to width * bpp.

Offset in bytes of the first pixel of this image in its backing buffer. This is used for tiling, wherein WebRender extracts chunks of input images in order to cache, manipulate, and render them individually. This offset tells the texture upload machinery where to find the bytes to upload for this tile. Non-tiled images generally set this to zero.

Whether this image is opaque, or has an alpha channel. Avoiding blending for opaque surfaces is an important optimization.

Whether to allow the driver to automatically generate mipmaps. If images are already downscaled appropriately, mipmap generation can be wasted work, and cause performance problems on some cards/drivers.

See https://github.com/servo/webrender/pull/2555/

Methods

impl ImageDescriptor
[src]

Mints a new ImageDescriptor.

Returns the stride, either via an explicit stride stashed on the object or by the default computation.

Computes the total size of the image, in bytes.

Computes the bounding rectangle for the image, rooted at (0, 0).

Trait Implementations

impl Copy for ImageDescriptor
[src]

impl Clone for ImageDescriptor
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Serialize for ImageDescriptor
[src]

Serialize this value into the given Serde serializer. Read more

impl Debug for ImageDescriptor
[src]

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for ImageDescriptor
[src]

Deserialize this value from the given Serde deserializer. Read more

impl PartialEq<ImageDescriptor> for ImageDescriptor
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl Send for ImageDescriptor

impl Sync for ImageDescriptor

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]