import { Color } from '../../../../common/colors' ; import { clearCanvas , renderLayers , withContext } from '../../../../renderers/canvas' ; import { Mark } from '../../layout/viewmodel/geoms' ; internal export function renderCanvas2d ( ctx , dpr , geomObjects , background ) { withContext ( ctx , ( ) => { ctx . scale ( dpr , dpr ) ; ctx . textAlign = 'center' ; ctx . textBaseline = 'middle' ; renderLayers ( ctx , [ ( ) => clearCanvas ( ctx , background ) , ( ) => geomObjects . forEach ( ( mark ) => withContext ( ctx , ( ) => mark . render ( ctx ) ) ) , ] ) ; } ) ; }