pub struct HeadlessAtlas(/* private fields */);Expand description
A sprite atlas for windows without a GPU. It hands out uniquely identified tiles without uploading any pixels, so glyph, SVG, and image painting can run to completion in tests and headless platforms.
Trait Implementations§
Source§impl Default for HeadlessAtlas
impl Default for HeadlessAtlas
Source§impl PlatformAtlas for HeadlessAtlas
impl PlatformAtlas for HeadlessAtlas
Source§fn get_or_insert_with<'a>(
&self,
key: AtlasKey,
build: &mut dyn FnMut() -> Result<Option<(Size<DevicePixels>, Cow<'a, [u8]>)>>,
) -> Result<Option<AtlasTile>>
fn get_or_insert_with<'a>( &self, key: AtlasKey, build: &mut dyn FnMut() -> Result<Option<(Size<DevicePixels>, Cow<'a, [u8]>)>>, ) -> Result<Option<AtlasTile>>
The builder runs with the atlas locked and must not re-enter the same atlas.
fn remove(&self, key: &AtlasKey)
Source§fn upload_from_gpu(
&self,
_key: &AtlasKey,
_size: Size<DevicePixels>,
_texture: GpuTextureHandle,
) -> Result<Option<AtlasTile>>
fn upload_from_gpu( &self, _key: &AtlasKey, _size: Size<DevicePixels>, _texture: GpuTextureHandle, ) -> Result<Option<AtlasTile>>
Fill the tile for
key from a texture that is ALREADY in the renderer’s
own GPU memory, with no CPU round trip — the tile is allocated on the
first call and overwritten in place on every call after it. Read moreSource§fn upload_from_d3d12(
&self,
_key: &AtlasKey,
_size: Size<DevicePixels>,
_texture: D3D12TextureHandle,
_owner: Arc<dyn Any + Send + Sync>,
) -> Result<Option<AtlasTile>>
fn upload_from_d3d12( &self, _key: &AtlasKey, _size: Size<DevicePixels>, _texture: D3D12TextureHandle, _owner: Arc<dyn Any + Send + Sync>, ) -> Result<Option<AtlasTile>>
Copies a straight-alpha BGRA8 D3D12 texture on this atlas’s device.
The source is in RENDER_TARGET state before and after the copy. Its
producer signals
ready_fence at ready_value; the consumer waits on
its GPU queue. owner retains the producer allocation and fence until
the copy completes, not merely until this function returns.Source§fn tile(&self, _key: &AtlasKey) -> Option<AtlasTile>
fn tile(&self, _key: &AtlasKey) -> Option<AtlasTile>
vue-native fork: the tile
key maps to now, if any. None from a
backend that does not say, which makes every
crate::Window::write_image_tile report a moved tile: correct, only
never the cheap path.Source§fn write_bytes(
&self,
_key: &AtlasKey,
_size: Size<DevicePixels>,
_bytes: &[u8],
) -> Result<Option<AtlasTile>>
fn write_bytes( &self, _key: &AtlasKey, _size: Size<DevicePixels>, _bytes: &[u8], ) -> Result<Option<AtlasTile>>
vue-native fork: writes
bytes (size, in the key’s texture format,
rows packed) into the tile for key, overwriting it in place when it
exists at this size and taking a new one otherwise. The CPU twin of
PlatformAtlas::upload_from_gpu: not memoised, one tile per key. Read moreSource§fn stats(&self) -> Option<AtlasStats>
fn stats(&self) -> Option<AtlasStats>
vue-native fork: the atlas’s footprint, per texture kind — for an
embedder’s memory report.
None from a backend that does not keep
count.Auto Trait Implementations§
impl !Freeze for HeadlessAtlas
impl !RefUnwindSafe for HeadlessAtlas
impl Forget for HeadlessAtlas
impl Move for HeadlessAtlas
impl Send for HeadlessAtlas
impl Sync for HeadlessAtlas
impl Unpin for HeadlessAtlas
impl UnsafeUnpin for HeadlessAtlas
impl UnwindSafe for HeadlessAtlas
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
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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