/// Fill the inner vertex and command buffers by translating the given `primitives`.
///
/// This method may return an `Option<GlyphCacheCommand>`, in which case the user should use
/// the contained `glyph_cpu_buffer_pool` to write the pixel data to the GPU, and then use a
/// `copy_buffer_to_image` command to write the data to the given `glyph_cache_texture` image.
Fill the inner vertex and command buffers by translating the given `primitives`.
Fill the inner vertex and command buffers by translating the given ` primitives ` .
pub fn fill<P: render::PrimitiveWalker>(
        &mut self,
        image_map: &image::Map<Image>,
        viewport: [f32; 4],
        dpi_factor: f64,
        primitives: P,
    ) -> Result<Option<GlyphCacheCommand>, rt::gpu_cache::CacheWriteErr> {
        let Renderer {
            ref glyph_uploads,
            ref glyph_cache_tex,
            ref mut mesh,
            ..
        } = *self;
        let [vp_l, vp_t, vp_r, vp_b] = viewport;
        let lt = [vp_l as Scalar, vp_t as Scalar];
        let rb = [vp_r as Scalar, vp_b as Scalar];
        let viewport = Rect::from_corners(lt, rb);
        let fill = mesh.fill(viewport, dpi_factor, image_map, primitives)?;
        let glyph_cache_cmd = match fill.glyph_cache_requires_upload {
            false => None,
            true => Some(GlyphCacheCommand {
                glyph_cache_pixel_buffer: mesh.glyph_cache_pixel_buffer(),
                glyph_cpu_buffer_pool: glyph_uploads.clone(),
                glyph_cache_texture: glyph_cache_tex.clone(),
            }),
        };
        Ok(glyph_cache_cmd)
    }
pub fn fill < P : render :: PrimitiveWalker > ( & mut self , image_map : & image :: Map < Image > , viewport : [ f32 ; 4 ] , dpi_factor : f64 , primitives : P , ) -> Result < Option < GlyphCacheCommand > , rt :: gpu_cache :: CacheWriteErr > { let Renderer { ref glyph_uploads , ref glyph_cache_tex , ref mut mesh , .. } = * self ; let [ vp_l , vp_t , vp_r , vp_b ] = viewport ; let lt = [ vp_l as Scalar , vp_t as Scalar ] ; let rb = [ vp_r as Scalar , vp_b as Scalar ] ; let viewport = Rect :: from_corners ( lt , rb ) ; let fill = mesh . fill ( viewport , dpi_factor , image_map , primitives ) ? ; let glyph_cache_cmd = match fill . glyph_cache_requires_upload { false => None , true => Some ( GlyphCacheCommand { glyph_cache_pixel_buffer : mesh . glyph_cache_pixel_buffer ( ) , glyph_cpu_buffer_pool : glyph_uploads . clone ( ) , glyph_cache_texture : glyph_cache_tex . clone ( ) , } ) , } ; Ok ( glyph_cache_cmd ) }
Fill the inner vertex and command buffers by translating the given `primitives`.
Fill the inner vertex and command buffers by translating the given ` primitives ` .
&mut self
image_map
&image::Map<Image>
viewport
[f32; 4]
dpi_factor
f64
primitives
P