Skip to main content

Drawable

Struct Drawable 

Source
pub struct Drawable { /* private fields */ }

Implementations§

Source§

impl Drawable

Source

pub fn new(name: String) -> Self

Source

pub fn set_depth_mode_for_3d(&mut self, value: &DepthMode)

Source

pub fn set_stencil_mode_for_3d(&mut self, value: &StencilMode)

Source

pub fn set_vertex_attr_id(&mut self, id: usize)

Source

pub fn upload(&mut self, upload_pass: &UploadPass)

Trait Implementations§

Source§

impl Drawable for Drawable

Source§

fn base(&self) -> &DrawableBase

Source§

fn base_mut(&mut self) -> &mut DrawableBase

Source§

fn as_any(&self) -> &dyn Any

Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Source§

fn draw(&mut self, parameters: &mut dyn PaintParameters)

Draw the drawable. (C++ draw(PaintParameters&) const; the backends mutate their impl state, so &mut self here.)
Source§

fn update_vertex_attributes( &mut self, vertices: Option<VertexAttributeArrayPtr>, vertex_count: usize, mode: DrawMode, indexes: Option<IndexVectorBasePtr>, segments: &[SegmentBase], )

Update vertices, indices, and segments
Source§

fn set_vertices( &mut self, data: Vec<u8>, count: usize, data_type: AttributeDataType, )

Provide raw data for vertices. Incompatible with adding primitives
Source§

fn set_index_data( &mut self, indexes: Option<IndexVectorBasePtr>, segments: Vec<UniqueDrawSegment>, )

Set shared indexes and segments
Source§

fn get_uniform_buffers(&self) -> &UniformBufferArray

Get the uniform buffers attached to this drawable
Source§

fn mutable_uniform_buffers(&mut self) -> &mut UniformBufferArray

Source§

fn set_color_mode(&mut self, value: &ColorMode)

Source§

fn set_enable_stencil(&mut self, value: bool)

Source§

fn set_enable_depth(&mut self, value: bool)

Source§

fn set_sub_layer_index(&mut self, value: i32)

Source§

fn set_depth_type(&mut self, value: DepthMaskType)

Source§

fn set_shader(&mut self, value: Option<ShaderProgramBasePtr>)

Source§

fn set_line_width(&mut self, value: i32)

Source§

fn set_textures(&mut self, textures: [Option<Rc<RefCell<dyn Texture2D>>>; 3])

Source§

fn set_texture( &mut self, texture: Option<Rc<RefCell<dyn Texture2D>>>, id: usize, )

Attach the given texture to this drawable at the given internal ID.
Source§

fn set_enable_color(&mut self, value: bool)

Source§

fn set_cull_face_mode(&mut self, value: &CullFaceMode)

Source§

fn get_id(&self) -> SimpleIdentity

Source§

fn get_name(&self) -> &str

Source§

fn set_name(&mut self, value: String)

Source§

fn get_shader(&self) -> &Option<Rc<dyn ShaderProgramBase>>

Source§

fn get_render_pass(&self) -> RenderPass

Source§

fn set_render_pass(&mut self, value: RenderPass)

Source§

fn has_render_pass(&self, value: RenderPass) -> bool

Test whether to draw this drawable in a given render pass.
Source§

fn has_all_render_passes(&self, value: RenderPass) -> bool

If multiple render pass bits are set, all must be present.
Source§

fn get_line_width(&self) -> i32

Source§

fn get_texture(&self, id: usize) -> Option<&Rc<RefCell<dyn Texture2D>>>

Source§

fn get_enabled(&self) -> bool

Source§

fn set_enabled(&mut self, value: bool)

Source§

fn get_enable_color(&self) -> bool

Source§

fn get_enable_stencil(&self) -> bool

Source§

fn get_draw_priority(&self) -> i64

Source§

fn set_draw_priority(&mut self, value: i64)

Source§

fn get_enable_depth(&self) -> bool

Source§

fn get_sub_layer_index(&self) -> i32

Source§

fn get_depth_type(&self) -> DepthMaskType

Source§

fn get_is_3d(&self) -> bool

Source§

fn set_is_3d(&mut self, value: bool)

Source§

fn get_is_custom(&self) -> bool

Source§

fn set_is_custom(&mut self, value: bool)

Source§

fn get_tile_id(&self) -> Option<OverscaledTileID>

Source§

fn set_tile_id(&mut self, value: OverscaledTileID)

Source§

fn get_cull_face_mode(&self) -> &CullFaceMode

Source§

fn get_color_mode(&self) -> &ColorMode

Source§

fn get_vertex_attributes(&self) -> Option<&Rc<RefCell<VertexAttributeArray>>>

Source§

fn set_vertex_attributes( &mut self, value: Option<Rc<RefCell<VertexAttributeArray>>>, )

Source§

fn get_instance_attributes(&self) -> Option<&Rc<RefCell<VertexAttributeArray>>>

Source§

fn set_instance_attributes( &mut self, value: Option<Rc<RefCell<VertexAttributeArray>>>, )

Source§

fn set_index_data_vec( &mut self, indexes: Vec<u16>, segments: Vec<Box<DrawSegment>>, )

Provide raw indexes and segments
Source§

fn get_tweakers(&self) -> &Vec<Rc<dyn DrawableTweaker>>

Source§

fn add_tweaker(&mut self, value: Rc<dyn DrawableTweaker>)

Source§

fn set_tweakers(&mut self, value: Vec<Rc<dyn DrawableTweaker>>)

Source§

fn clear_tweakers(&mut self)

Source§

fn get_data(&self) -> Option<&(dyn Any + 'static)>

Source§

fn set_data(&mut self, value: Option<Box<dyn Any>>)

Source§

fn set_type(&mut self, type_: usize)

Source§

fn get_type(&self) -> usize

Source§

fn set_ubo_index(&mut self, ubo_index: u32)

Source§

fn get_ubo_index(&self) -> u32

Source§

fn set_layer_tweaker(&mut self, tweaker: Option<Rc<dyn Any>>)

Associate the drawable with a layer tweaker (lifetime management).
Source§

fn get_layer_tweaker(&self) -> Option<&Rc<dyn Any>>

Source§

fn set_binders(&mut self, binders: Option<Rc<dyn Any>>)

setBinders(std::shared_ptr<Bucket>, PaintPropertyBindersBase*).
Source§

fn get_binders(&self) -> Option<&Rc<dyn Any>>

getBinders() (+ getBucket()), as the renderer stored them.
Source§

fn set_render_tile(&mut self, render_tile: Option<Rc<dyn Any>>)

setRenderTile(Immutable<std::vector<RenderTile>>, const RenderTile*).
Source§

fn get_render_tile(&self) -> Option<&Rc<dyn Any>>

getRenderTile().
Source§

fn get_origin(&self) -> Option<Point<f64>>

Source§

fn set_origin(&mut self, p: Option<Point<f64>>)

Source§

fn get_attribute_update_time(&self) -> Option<Instant>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>