/// Draws the provided primitives in the given [`Target`].
///
/// The text provided as overlay will be renderer on top of the primitives.
/// This is useful for rendering debug information.
///
/// [`Target`]: struct.Target.html
Draws the provided primitives in the given [`Target`].
The text provided as overlay will be renderer on top of the primitives.
This is useful for rendering debug information.


Draws the provided primitives in the given [ ` Target ` ] . The text provided as overlay will be renderer on top of the primitives . This is useful for rendering debug information .
pub fn draw<T: AsRef<str>>(
        &mut self,
        device: &wgpu::Device,
        encoder: &mut wgpu::CommandEncoder,
        target: Target<'_>,
        (primitive, mouse_cursor): &(Primitive, MouseCursor),
        scale_factor: f64,
        overlay: &[T],
    ) -> MouseCursor {
        log::debug!("Drawing");
        let (width, height) = target.viewport.dimensions();
        let scale_factor = scale_factor as f32;
        let transformation = target.viewport.transformation();
        let mut layers = Vec::new();
        layers.push(Layer::new(Rectangle {
            x: 0,
            y: 0,
            width,
            height,
        }));
        self.draw_primitive(Vector::new(0.0, 0.0), primitive, &mut layers);
        self.draw_overlay(overlay, &mut layers);
        for layer in layers {
            self.flush(
                device,
                scale_factor,
                transformation,
                &layer,
                encoder,
                target.texture,
                width,
                height,
            );
        }
        #[cfg(any(feature = "image", feature = "svg"))]
        self.image_pipeline.trim_cache();
        *mouse_cursor
    }
pub fn draw < T : AsRef < str > > ( & mut self , device : & wgpu :: Device , encoder : & mut wgpu :: CommandEncoder , target : Target < ' _ > , ( primitive , mouse_cursor ) : & ( Primitive , MouseCursor ) , scale_factor : f64 , overlay : & [ T ] , ) -> MouseCursor { log :: debug ! ( " " ) ; let ( width , height ) = target . viewport . dimensions ( ) ; let scale_factor = scale_factor as f32 ; let transformation = target . viewport . transformation ( ) ; let mut layers = Vec :: new ( ) ; layers . push ( Layer :: new ( Rectangle { x : 0 , y : 0 , width , height , } ) ) ; self . draw_primitive ( Vector :: new ( 0.0 , 0.0 ) , primitive , & mut layers ) ; self . draw_overlay ( overlay , & mut layers ) ; for layer in layers { self . flush ( device , scale_factor , transformation , & layer , encoder , target . texture , width , height , ) ; } # [ cfg ( any ( feature " " feature " " ) ) ] self . image_pipeline . trim_cache ( ) ; * mouse_cursor }
Draws the provided primitives in the given [`Target`].
Draws the provided primitives in the given [ ` Target ` ] .
&mut self
device
&wgpu::Device
encoder
&mut wgpu::CommandEncoder
target
&(Primitive, MouseCursor)
scale_factor
f64
overlay
&[T]