[librsvg: 1/3] mask: use cairo-rs mask_surface method
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/3] mask: use cairo-rs mask_surface method
- Date: Sat, 17 Nov 2018 13:59:36 +0000 (UTC)
commit 0feb235a1c13364a19ac74e76ba7822a5025dc07
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Nov 17 13:58:33 2018 +0100
mask: use cairo-rs mask_surface method
rsvg_internals/src/mask.rs | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
---
diff --git a/rsvg_internals/src/mask.rs b/rsvg_internals/src/mask.rs
index 453ec64d..906157b5 100644
--- a/rsvg_internals/src/mask.rs
+++ b/rsvg_internals/src/mask.rs
@@ -1,6 +1,4 @@
use cairo::{self, MatrixTrait};
-use cairo_sys;
-use glib::translate::*;
use std::cell::Cell;
use attributes::Attribute;
@@ -25,15 +23,6 @@ use surface_utils::{
coord_units!(MaskUnits, CoordUnits::ObjectBoundingBox);
coord_units!(MaskContentUnits, CoordUnits::UserSpaceOnUse);
-// remove this once cairo-rs has this mask_surface()
-fn cairo_mask_surface(cr: &cairo::Context, surface: &cairo::Surface, x: f64, y: f64) {
- unsafe {
- let raw_cr = cr.to_glib_none().0;
-
- cairo_sys::cairo_mask_surface(raw_cr, surface.to_raw_none(), x, y);
- }
-}
-
pub struct NodeMask {
x: Cell<Length>,
y: Cell<Length>,
@@ -170,7 +159,7 @@ impl NodeMask {
cr.identity_matrix();
let (xofs, yofs) = draw_ctx.get_offset();
- cairo_mask_surface(&cr, &mask_surface, xofs, yofs);
+ cr.mask_surface(&mask_surface, xofs, yofs);
Ok(())
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]