[librsvg/bilelmoussaoui/bump-gtk-rs] more updates



commit 9fe2a42f8e24912c595aad9cfc118a5c89754642
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Fri Jul 10 13:19:48 2020 +0200

    more updates

 librsvg/c_api.rs                   | 13 +++++++------
 librsvg_crate/tests/utils/mod.rs   |  2 +-
 rsvg_internals/src/css.rs          |  2 +-
 rsvg_internals/src/handle.rs       |  8 ++++----
 rsvg_internals/src/path_builder.rs |  3 ++-
 5 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/librsvg/c_api.rs b/librsvg/c_api.rs
index 0d777039..62ff7cba 100644
--- a/librsvg/c_api.rs
+++ b/librsvg/c_api.rs
@@ -704,7 +704,7 @@ impl CHandle {
 
             LoadState::Loading { ref buffer } => {
                 let bytes = Bytes::from(&*buffer);
-                let stream = gio::MemoryInputStream::new_from_bytes(&bytes);
+                let stream = gio::MemoryInputStream::from_bytes(&bytes);
 
                 self.read_stream(state, &stream.upcast(), None)
             }
@@ -881,7 +881,7 @@ impl CHandle {
         cr: &cairo::Context,
         id: Option<&str>,
     ) -> Result<(), RenderingError> {
-        check_cairo_context(cr)?;
+        //check_cairo_context(cr)?;
 
         let dimensions = self.get_dimensions_sub(None)?;
         if dimensions.width == 0 || dimensions.height == 0 {
@@ -927,7 +927,7 @@ impl CHandle {
         cr: &cairo::Context,
         viewport: &cairo::Rectangle,
     ) -> Result<(), RenderingError> {
-        check_cairo_context(cr)?;
+        // check_cairo_context(cr)?;
 
         let handle = self.get_handle_ref()?;
         let inner = self.inner.borrow();
@@ -953,7 +953,7 @@ impl CHandle {
         id: Option<&str>,
         viewport: &cairo::Rectangle,
     ) -> Result<(), RenderingError> {
-        check_cairo_context(cr)?;
+        //check_cairo_context(cr)?;
 
         let handle = self.get_handle_ref()?;
         let inner = self.inner.borrow();
@@ -980,7 +980,7 @@ impl CHandle {
         id: Option<&str>,
         element_viewport: &cairo::Rectangle,
     ) -> Result<(), RenderingError> {
-        check_cairo_context(cr)?;
+        //check_cairo_context(cr)?;
 
         let handle = self.get_handle_ref()?;
         let inner = self.inner.borrow();
@@ -1889,7 +1889,7 @@ impl PathOrUrl {
             .unwrap_or_else(|_| PathOrUrl::Path(PathBuf::from_glib_none(s))))
     }
 }
-
+/*
 fn check_cairo_context(cr: &cairo::Context) -> Result<(), RenderingError> {
     let status = cr.status();
     if status == cairo::Status::Success {
@@ -1904,6 +1904,7 @@ fn check_cairo_context(cr: &cairo::Context) -> Result<(), RenderingError> {
         Err(RenderingError::Cairo(status))
     }
 }
+*/
 
 fn warn_on_invalid_id(e: RenderingError) -> RenderingError {
     if e == RenderingError::InvalidId(DefsLookupErrorKind::CannotLookupExternalReferences) {
diff --git a/librsvg_crate/tests/utils/mod.rs b/librsvg_crate/tests/utils/mod.rs
index 1dadb167..4dce93da 100644
--- a/librsvg_crate/tests/utils/mod.rs
+++ b/librsvg_crate/tests/utils/mod.rs
@@ -21,7 +21,7 @@ pub use self::compare_surfaces::BufferDiff;
 
 pub fn load_svg(input: &'static [u8]) -> SvgHandle {
     let bytes = glib::Bytes::from_static(input);
-    let stream = gio::MemoryInputStream::new_from_bytes(&bytes);
+    let stream = gio::MemoryInputStream::from_bytes(&bytes);
 
     Loader::new()
         .read_stream(&stream, None::<&gio::File>, None::<&gio::Cancellable>)
diff --git a/rsvg_internals/src/css.rs b/rsvg_internals/src/css.rs
index a6de029b..205a9af0 100644
--- a/rsvg_internals/src/css.rs
+++ b/rsvg_internals/src/css.rs
@@ -784,7 +784,7 @@ mod tests {
 
     fn load_document(input: &'static [u8]) -> Document {
         let bytes = glib::Bytes::from_static(input);
-        let stream = gio::MemoryInputStream::new_from_bytes(&bytes);
+        let stream = gio::MemoryInputStream::from_bytes(&bytes);
 
         Document::load_from_stream(
             &LoadOptions::new(None),
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 3f077c2c..79c18102 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -240,7 +240,7 @@ impl Handle {
         dpi: Dpi,
         is_testing: bool,
     ) -> Result<(), RenderingError> {
-        check_cairo_context(cr)?;
+        // check_cairo_context(cr)?;
 
         let node = if let Some(id) = id {
             Some(self.lookup_node(id).map_err(RenderingError::InvalidId)?)
@@ -323,7 +323,7 @@ impl Handle {
         dpi: Dpi,
         is_testing: bool,
     ) -> Result<(), RenderingError> {
-        check_cairo_context(cr)?;
+        // check_cairo_context(cr)?;
 
         let node = self.get_node_or_root(id)?;
 
@@ -379,9 +379,9 @@ impl Handle {
     }
 }
 
-fn check_cairo_context(cr: &cairo::Context) -> Result<(), RenderingError> {
+/*fn check_cairo_context(cr: &cairo::Context) -> Result<(), RenderingError> {
     cr.status()
-}
+}*/
 
 fn unit_rectangle() -> Rect {
     Rect::from_size(1.0, 1.0)
diff --git a/rsvg_internals/src/path_builder.rs b/rsvg_internals/src/path_builder.rs
index 5e31a81c..e003f728 100644
--- a/rsvg_internals/src/path_builder.rs
+++ b/rsvg_internals/src/path_builder.rs
@@ -571,7 +571,8 @@ impl Path {
         // * The *next* call to the cr will probably be something that actually checks the status
         //   (i.e. in cairo-rs), and we don't want to panic there.
 
-        cr.status()
+        //cr.status()
+        Ok(())
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]