summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Borelli <pborelli@gnome.org>2021-01-03 16:44:37 +0100
committerPaolo Borelli <pborelli@gnome.org>2021-01-04 21:04:33 +0100
commit1aaa1af8866c416dc304e501d3c79829b36eb11f (patch)
tree1ce624d629e1b37e9eea204af1d4b8c4821bdc7e
parent8b5033b4b0a3b1aca6566fc956438104a10ad7d6 (diff)
downloadlibrsvg-1aaa1af8866c416dc304e501d3c79829b36eb11f.tar.gz
surface_utils: rename param for clarity
-rw-r--r--src/document.rs2
-rw-r--r--src/surface_utils/shared_surface.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/document.rs b/src/document.rs
index f28316ef..28965b0d 100644
--- a/src/document.rs
+++ b/src/document.rs
@@ -267,7 +267,7 @@ fn load_image(
None
};
- let surface = SharedImageSurface::from_pixbuf(&pixbuf, bytes, content_type.as_deref())
+ let surface = SharedImageSurface::from_pixbuf(&pixbuf, content_type.as_deref(), bytes)
.map_err(|e| image_loading_error_from_cairo(e, aurl))?;
Ok(surface)
diff --git a/src/surface_utils/shared_surface.rs b/src/surface_utils/shared_surface.rs
index 4bf6a822..89fa480c 100644
--- a/src/surface_utils/shared_surface.rs
+++ b/src/surface_utils/shared_surface.rs
@@ -260,8 +260,8 @@ impl ImageSurface<Shared> {
pub fn from_pixbuf(
pixbuf: &Pixbuf,
- data: Option<Vec<u8>>,
content_type: Option<&str>,
+ mime_data: Option<Vec<u8>>,
) -> Result<SharedImageSurface, cairo::Status> {
assert!(pixbuf.get_colorspace() == Colorspace::Rgb);
assert!(pixbuf.get_bits_per_sample() == 8);
@@ -307,7 +307,7 @@ impl ImageSurface<Shared> {
}
}
- if let (Some(bytes), Some(content_type)) = (data, content_type) {
+ if let (Some(content_type), Some(bytes)) = (content_type, mime_data) {
surf.surface.set_mime_data(content_type, bytes)?;
}