diff options
author | David Zbarsky <dzbarsky@gmail.com> | 2015-08-08 05:15:20 -0400 |
---|---|---|
committer | David Zbarsky <dzbarsky@gmail.com> | 2015-08-08 15:35:16 -0400 |
commit | 05c78fbd48dc4bbcd9db38aafe5758f8c4ef7f30 (patch) | |
tree | 445ee04fb91773462df14f75ed2053b2fb6cbcdf /components/canvas/canvas_paint_task.rs | |
parent | 51938d579fa82cdb3fb5b564ccb97431dcd5b34b (diff) | |
download | servo-05c78fbd48dc4bbcd9db38aafe5758f8c4ef7f30.tar.gz servo-05c78fbd48dc4bbcd9db38aafe5758f8c4ef7f30.zip |
Inline write_pixels
Diffstat (limited to 'components/canvas/canvas_paint_task.rs')
-rw-r--r-- | components/canvas/canvas_paint_task.rs | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/components/canvas/canvas_paint_task.rs b/components/canvas/canvas_paint_task.rs index bfa86a618be..5719bf808db 100644 --- a/components/canvas/canvas_paint_task.rs +++ b/components/canvas/canvas_paint_task.rs @@ -732,23 +732,7 @@ fn write_image(draw_target: &DrawTarget, let image_rect = Rect::new(Point2D::zero(), image_size); // rgba -> bgra byte_swap(&mut image_data); - write_pixels(&draw_target, &image_data, image_size, image_rect, - dest_rect, smoothing_enabled, composition_op, global_alpha); -} -/// It writes image data to the target -/// draw_target: the destination target where the imagedata will be copied -/// source_rect: the area of the image data to be written -/// dest_rect: The area of the target where the imagedata will be copied -/// smoothing_enabled: if smoothing is applied to the copied pixels -fn write_pixels(draw_target: &DrawTarget, - image_data: &[u8], - image_size: Size2D<f64>, - source_rect: Rect<f64>, - dest_rect: Rect<f64>, - smoothing_enabled: bool, - composition_op: CompositionOp, - global_alpha: f32) { // From spec https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage // When scaling up, if the imageSmoothingEnabled attribute is set to true, the user agent should attempt // to apply a smoothing algorithm to the image data when it is scaled. @@ -770,7 +754,7 @@ fn write_pixels(draw_target: &DrawTarget, draw_target.draw_surface(source_surface, dest_rect.to_azfloat(), - source_rect.to_azfloat(), + image_rect.to_azfloat(), draw_surface_options, draw_options); } |