pub enum DeviceIndependentPixel {}
Expand description
A normalized “pixel” at the default resolution for the display.
Like the CSS “px” unit, the exact physical size of this unit may vary between devices, but it should approximate a device-independent reference length. This unit corresponds to Android’s “density-independent pixel” (dip), Mac OS X’s “point”, and Windows “device-independent pixel.”
The relationship between DevicePixel and DeviceIndependentPixel is defined by the OS. On most low-dpi screens, one DeviceIndependentPixel is equal to one DevicePixel. But on high-density screens it can be some larger number. For example, by default on Apple “retina” displays, one DeviceIndependentPixel equals two DevicePixels. On Android “MDPI” displays, one DeviceIndependentPixel equals 1.5 device pixels.
The ratio between DeviceIndependentPixel and DevicePixel for a given display be found by calling
servo::windowing::WindowMethods::hidpi_factor
.
Trait Implementations§
source§impl Clone for DeviceIndependentPixel
impl Clone for DeviceIndependentPixel
source§fn clone(&self) -> DeviceIndependentPixel
fn clone(&self) -> DeviceIndependentPixel
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DeviceIndependentPixel
impl Debug for DeviceIndependentPixel
source§impl MallocSizeOf for DeviceIndependentPixel
impl MallocSizeOf for DeviceIndependentPixel
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
impl Copy for DeviceIndependentPixel
Auto Trait Implementations§
impl Freeze for DeviceIndependentPixel
impl RefUnwindSafe for DeviceIndependentPixel
impl Send for DeviceIndependentPixel
impl Sync for DeviceIndependentPixel
impl Unpin for DeviceIndependentPixel
impl UnwindSafe for DeviceIndependentPixel
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more