MCPcopy Create free account
hub / github.com/endbasic/endbasic / new_test_raster_ops

Function new_test_raster_ops

web/src/canvas.rs:395–402  ·  view source on GitHub ↗

Creates a new test raster ops with the given dimensions.

(width: u32, height: u32)

Source from the content-addressed store, hash-verified

393
394 /// Creates a new test raster ops with the given dimensions.
395 fn new_test_raster_ops(width: u32, height: u32) -> CanvasRasterOps {
396 let document = web_sys::window().unwrap().document().unwrap();
397 let canvas =
398 document.create_element("canvas").unwrap().dyn_into::<HtmlCanvasElement>().unwrap();
399 canvas.set_width(width);
400 canvas.set_height(height);
401 CanvasRasterOps::new(canvas, &FONT_5X8, WebYielder::new()).unwrap()
402 }
403
404 /// Runs a partial "move pixels" test on the given `raster_ops`.
405 fn do_move_pixels_test(mut raster_ops: CanvasRasterOps) {

Calls

no outgoing calls