Creates a new test raster ops with the given dimensions.
(width: u32, height: u32)
| 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) { |
no outgoing calls