pub trait TextUpload {
// Required method
fn upload_text(
&self,
size: RenderSize,
rgba8: &[u8],
) -> Result<TextPixels, RenderError>;
}Expand description
Where TextTextures keeps the pixels of a rasterized text: the GPU
renderer uploads them to a texture, the CPU renderer keeps them.
Required Methods§
Sourcefn upload_text(
&self,
size: RenderSize,
rgba8: &[u8],
) -> Result<TextPixels, RenderError>
fn upload_text( &self, size: RenderSize, rgba8: &[u8], ) -> Result<TextPixels, RenderError>
Takes rgba8, premultiplied sRGB-encoded RGBA of size with rows
packed, as the renderer’s source for that text.
§Errors
Returns RenderError::InvalidImageData when rgba8 does not hold
size, or the GPU’s upload failure.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".