[librsvg: 8/22] handle::get_dpi() - Inline into the single caller
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 8/22] handle::get_dpi() - Inline into the single caller
- Date: Tue, 8 Jan 2019 17:53:52 +0000 (UTC)
commit ce2c101f66a9d2c154f1e115abf56f3c71ee2730
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jan 7 19:46:03 2019 -0600
handle::get_dpi() - Inline into the single caller
This removes the 'handle' argument from Handle::create_drawing_ctx_for_node()
rsvg_internals/src/handle.rs | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 6280e6e6..bbff3fd3 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -251,7 +251,6 @@ impl Handle {
fn create_drawing_ctx_for_node(
&mut self,
- handle: *mut RsvgHandle,
cr: &cairo::Context,
dimensions: &RsvgDimensionData,
node: Option<&RsvgNode>,
@@ -263,7 +262,7 @@ impl Handle {
f64::from(dimensions.height),
dimensions.em,
dimensions.ex,
- get_dpi(handle).clone(),
+ self.dpi.clone(),
self.is_testing.get(),
);
@@ -301,7 +300,7 @@ impl Handle {
let dimensions = self.get_dimensions(handle)?;
let target = ImageSurface::create(cairo::Format::Rgb24, 1, 1)?;
let cr = cairo::Context::new(&target);
- let mut draw_ctx = self.create_drawing_ctx_for_node(handle, &cr, &dimensions, Some(node));
+ let mut draw_ctx = self.create_drawing_ctx_for_node(&cr, &dimensions, Some(node));
let svg_ref = self.svg.borrow();
let svg = svg_ref.as_ref().unwrap();
let root = svg.tree.root();
@@ -434,7 +433,7 @@ impl Handle {
cr.save();
- let mut draw_ctx = self.create_drawing_ctx_for_node(handle, cr, &dimensions, node.as_ref());
+ let mut draw_ctx = self.create_drawing_ctx_for_node(cr, &dimensions, node.as_ref());
let svg_ref = self.svg.borrow();
let svg = svg_ref.as_ref().unwrap();
@@ -588,12 +587,6 @@ pub fn load_extern(handle: *const RsvgHandle, aurl: &AllowedUrl) -> Result<*cons
}
}
-pub fn get_dpi<'a>(handle: *const RsvgHandle) -> &'a Dpi {
- let rhandle = get_rust_handle(handle);
-
- &rhandle.dpi
-}
-
pub fn get_base_url<'a>(handle: *const RsvgHandle) -> Ref<'a, Option<Url>> {
let rhandle = get_rust_handle(handle);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]