mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Remove some condition in CanvasData::write_image
The surface creation should never fail.
This commit is contained in:
parent
6c469b90b1
commit
2bf4fcd9bd
1 changed files with 15 additions and 15 deletions
|
@ -639,23 +639,23 @@ fn write_image(
|
||||||
} else {
|
} else {
|
||||||
Filter::Point
|
Filter::Point
|
||||||
};
|
};
|
||||||
// azure_hl operates with integers. We need to cast the image size
|
|
||||||
let image_size = image_size.to_i32();
|
let image_size = image_size.to_i32();
|
||||||
|
|
||||||
if let Some(source_surface) =
|
let source_surface = draw_target.create_source_surface_from_data(
|
||||||
draw_target.create_source_surface_from_data(&image_data,
|
&image_data,
|
||||||
image_size,
|
image_size,
|
||||||
image_size.width * 4,
|
image_size.width * 4,
|
||||||
SurfaceFormat::B8G8R8A8) {
|
SurfaceFormat::B8G8R8A8,
|
||||||
let draw_surface_options = DrawSurfaceOptions::new(filter, true);
|
).unwrap();
|
||||||
let draw_options = DrawOptions::new(global_alpha, composition_op, AntialiasMode::None);
|
let draw_surface_options = DrawSurfaceOptions::new(filter, true);
|
||||||
|
let draw_options = DrawOptions::new(global_alpha, composition_op, AntialiasMode::None);
|
||||||
draw_target.draw_surface(source_surface,
|
draw_target.draw_surface(
|
||||||
dest_rect.to_azure_style(),
|
source_surface,
|
||||||
image_rect.to_azure_style(),
|
dest_rect.to_azure_style(),
|
||||||
draw_surface_options,
|
image_rect.to_azure_style(),
|
||||||
draw_options);
|
draw_surface_options,
|
||||||
}
|
draw_options,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait PointToi32 {
|
pub trait PointToi32 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue