Commit fa54852c authored by RazrFalcon's avatar RazrFalcon

Merge branch 'master' of github.com:RazrFalcon/resvg

parents 0973b3b0 fc4a3a08
language: rust
rust:
- 1.22.0
- stable
before_install:
# Qt 5.6
......
......@@ -33,10 +33,10 @@ log = "0.4.5"
usvg = { git = "https://github.com/RazrFalcon/usvg", rev = "405ad77" }
#usvg = { path = "../usvg" }
# cairo backend
cairo-rs = { version = "0.4.1", features = ["png"], optional = true }
gdk-pixbuf = { version = "0.4", optional = true }
pango = { version = "0.4", optional = true }
pangocairo = { version = "0.5", optional = true }
cairo-rs = { version = "0.5", features = ["png"], optional = true }
gdk-pixbuf = { version = "0.5", optional = true }
pango = { version = "0.5", optional = true }
pangocairo = { version = "0.6", optional = true }
# qt backend
#resvg-qt = { version = "0.3", optional = true }
#resvg-qt = { path = "../resvg-qt", optional = true }
......
......@@ -15,8 +15,8 @@ fern = "0.5"
log = "0.4"
resvg = { path = "../" }
# cairo backend
glib = { version = "0.5.0", optional = true }
cairo-sys-rs = { version = "0.6.0", optional = true }
glib = { version = "0.6.0", optional = true }
cairo-sys-rs = { version = "0.7.0", optional = true }
[features]
cairo-backend = ["resvg/cairo-backend", "glib", "cairo-sys-rs"]
......
......@@ -5,8 +5,8 @@ authors = ["Reizner Evgeniy <razrfalcon@gmail.com>"]
workspace = "../.."
[dependencies]
gio = "0.4"
gtk = "0.4"
gio = "0.5"
gtk = "0.5"
log = "0.4"
fern = "0.5"
......
......@@ -21,7 +21,7 @@ pub fn prepare_linear(
) {
let grad = cairo::LinearGradient::new(g.x1, g.y1, g.x2, g.y2);
prepare_base(&g.base, &grad, opacity, bbox);
cr.set_source(&grad);
cr.set_source(&cairo::Pattern::LinearGradient(grad));
}
pub fn prepare_radial(
......@@ -32,15 +32,15 @@ pub fn prepare_radial(
) {
let grad = cairo::RadialGradient::new(g.fx, g.fy, 0.0, g.cx, g.cy, g.r);
prepare_base(&g.base, &grad, opacity, bbox);
cr.set_source(&grad);
cr.set_source(&cairo::Pattern::RadialGradient(grad));
}
fn prepare_base(
fn prepare_base<G>(
g: &usvg::BaseGradient,
grad: &cairo::Gradient,
grad: &G,
opacity: usvg::Opacity,
bbox: Rect,
) {
) where G: cairo::Gradient {
let spread_method = match g.spread_method {
usvg::SpreadMethod::Pad => cairo::Extend::Pad,
usvg::SpreadMethod::Reflect => cairo::Extend::Reflect,
......
......@@ -56,6 +56,6 @@ pub fn apply(
let patt = cairo::SurfacePattern::create(&*mask_surface);
cr.set_matrix(cairo::Matrix::identity());
cr.mask(&patt);
cr.mask(&cairo::Pattern::SurfacePattern(patt));
cr.reset_source_rgba();
}
......@@ -6,7 +6,7 @@
use cairo::{
self,
MatrixTrait,
Pattern,
PatternTrait,
};
use usvg;
use usvg::prelude::*;
......@@ -90,5 +90,5 @@ pub fn apply(
m.invert();
patt.set_matrix(m);
cr.set_source(&patt);
cr.set_source(&cairo::Pattern::SurfacePattern(patt));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment