#[repr(C)]pub struct Texture {
pub gl_context: GlContextPtr,
pub texture_id: GLuint,
pub refcount: *const AtomicUsize,
pub size: PhysicalSizeU32,
pub format: RawImageFormat,
pub background_color: ColorU,
pub flags: TextureFlags,
pub run_destructor: bool,
}Expand description
OpenGL texture, use ReadOnlyWindow::create_texture to create a texture
Fields§
§gl_context: GlContextPtrA reference-counted pointer to the OpenGL context (so that the texture can be deleted in the destructor)
texture_id: GLuintRaw OpenGL texture ID
refcount: *const AtomicUsizeReference count, shared across
size: PhysicalSizeU32Size of this texture (in pixels)
format: RawImageFormatFormat of the texture (rgba8, brga8, etc.)
background_color: ColorUBackground color of this texture
flags: TextureFlagsHints and flags for optimization purposes
run_destructor: boolImplementations§
Source§impl Texture
impl Texture
pub fn create( texture_id: GLuint, flags: TextureFlags, size: PhysicalSizeU32, background_color: ColorU, gl_context: GlContextPtr, format: RawImageFormat, ) -> Self
pub fn allocate_rgba8( gl_context: GlContextPtr, size: PhysicalSizeU32, background: ColorU, ) -> Self
pub fn clear(&mut self)
pub fn get_descriptor(&self) -> ImageDescriptor
Sourcepub fn draw_tesselated_svg_gpu_node(
&mut self,
node: &TessellatedGPUSvgNode,
size: PhysicalSizeU32,
color: ColorU,
transforms: StyleTransformVec,
) -> bool
pub fn draw_tesselated_svg_gpu_node( &mut self, node: &TessellatedGPUSvgNode, size: PhysicalSizeU32, color: ColorU, transforms: StyleTransformVec, ) -> bool
Draws a TessellatedGPUSvgNode with the given color to the texture
Sourcepub fn draw_tesselated_colored_svg_gpu_node(
&mut self,
node: &TessellatedColoredGPUSvgNode,
size: PhysicalSizeU32,
transforms: StyleTransformVec,
) -> bool
pub fn draw_tesselated_colored_svg_gpu_node( &mut self, node: &TessellatedColoredGPUSvgNode, size: PhysicalSizeU32, transforms: StyleTransformVec, ) -> bool
Draws a TessellatedColoredGPUSvgNode to the texture
Trait Implementations§
Source§impl Ord for Texture
impl Ord for Texture
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Texture
impl PartialOrd for Texture
impl Eq for Texture
Auto Trait Implementations§
impl Freeze for Texture
impl RefUnwindSafe for Texture
impl !Send for Texture
impl !Sync for Texture
impl Unpin for Texture
impl UnsafeUnpin for Texture
impl UnwindSafe for Texture
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