Commit fa54852c authored by RazrFalcon's avatar RazrFalcon

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

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