[librsvg: 25/26] Merge branch 'master' into dimensions-api
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 25/26] Merge branch 'master' into dimensions-api
- Date: Tue, 19 Feb 2019 02:50:08 +0000 (UTC)
commit fd62af26ef0ae69d75a1c0c0499e2a993cc2c098
Merge: f8516131 c414d178
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Feb 18 20:19:47 2019 -0600
Merge branch 'master' into dimensions-api
.rustfmt.toml | 1 -
COMPILING.md | 6 +
Cargo.lock | 760 +++++++++++---------------
Cargo.toml | 1 +
Makefile.am | 55 +-
NEWS | 11 +-
README.md | 11 +-
configure.ac | 2 +-
doc/Makefile.am | 3 +-
librsvg/rsvg-base.c | 7 +-
librsvg/rsvg-handle.c | 52 +-
librsvg/rsvg.h | 7 +-
librsvg_crate/Cargo.toml | 22 +
librsvg_crate/build.rs | 65 +++
librsvg_crate/examples/render.rs | 34 ++
librsvg_crate/src/lib.rs | 400 ++++++++++++++
rsvg_internals/Cargo.toml | 8 +-
rsvg_internals/build.rs | 5 +-
rsvg_internals/src/c_api.rs | 88 +++
rsvg_internals/src/cond.rs | 17 +-
rsvg_internals/src/drawing_ctx.rs | 22 +-
rsvg_internals/src/error.rs | 15 +-
rsvg_internals/src/filters/context.rs | 71 +--
rsvg_internals/src/filters/convolve_matrix.rs | 4 +-
rsvg_internals/src/filters/gaussian_blur.rs | 4 +-
rsvg_internals/src/filters/image.rs | 19 +-
rsvg_internals/src/filters/node.rs | 71 +++
rsvg_internals/src/handle.rs | 51 +-
rsvg_internals/src/io.rs | 2 +-
rsvg_internals/src/lib.rs | 14 +-
rsvg_internals/src/shapes.rs | 90 ++-
rsvg_internals/src/svg.rs | 6 +-
rsvg_internals/src/util.rs | 27 +-
rsvg_internals/src/xml.rs | 14 -
rsvg_internals/src/xml2.rs | 2 +-
rsvg_internals/src/xml2_load.rs | 42 +-
tests/api.c | 125 ++++-
37 files changed, 1366 insertions(+), 768 deletions(-)
---
diff --cc librsvg/rsvg-handle.c
index 45aee588,faf34352..ac36a64a
--- a/librsvg/rsvg-handle.c
+++ b/librsvg/rsvg-handle.c
@@@ -337,14 -340,11 +340,18 @@@ extern RsvgHandle *rsvg_handle_rust_new
extern RsvgHandle *rsvg_handle_rust_new_from_data (const guint8 *data,
gsize data_len,
GError **error);
+extern void rsvg_handle_rust_get_intrinsic_dimensions (RsvgHandle *handle,
+ gboolean *out_has_width,
+ RsvgLength *out_width,
+ gboolean *out_has_height,
+ RsvgLength *out_height,
+ gboolean *out_has_viewbox,
+ RsvgRectangle *out_viewbox);
+ /* Implemented in rsvg_internals/src/c_api.rs */
+ extern GType rsvg_rust_error_get_type (void);
+ extern GType rsvg_rust_handle_flags_get_type (void);
+
typedef struct {
RsvgHandleRust *rust_handle;
} RsvgHandlePrivate;
diff --cc rsvg_internals/src/drawing_ctx.rs
index be7ba65e,6f8df89c..69255fc7
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@@ -959,13 -905,13 +950,24 @@@ impl From<cairo::Rectangle> for RsvgRec
}
}
+impl From<ViewBox> for RsvgRectangle {
+ fn from(vb: ViewBox) -> RsvgRectangle {
+ RsvgRectangle {
+ x: vb.x,
+ y: vb.y,
+ width: vb.width,
+ height: vb.height,
++ }
++ }
++}
++
+ impl From<RsvgRectangle> for cairo::Rectangle {
+ fn from(r: RsvgRectangle) -> cairo::Rectangle {
+ cairo::Rectangle {
+ x: r.x,
+ y: r.y,
+ width: r.width,
+ height: r.height,
}
}
}
diff --cc rsvg_internals/src/filters/image.rs
index e517a31e,05fb792e..4b6e702f
--- a/rsvg_internals/src/filters/image.rs
+++ b/rsvg_internals/src/filters/image.rs
@@@ -11,11 -11,9 +11,10 @@@ use float_eq_cairo::ApproxEqCairo
use node::{CascadedValues, NodeResult, NodeTrait, RsvgNode};
use parsers::{ParseError, ParseValue};
use property_bag::PropertyBag;
-use rect::IRect;
+use rect::{IRect, RectangleExt};
use surface_utils::shared_surface::{SharedImageSurface, SurfaceType};
+use viewbox::ViewBox;
- use super::bounds::BoundsBuilder;
use super::context::{FilterContext, FilterOutput, FilterResult};
use super::{Filter, FilterError, Primitive};
@@@ -125,21 -124,14 +125,20 @@@ impl Image
)?;
// TODO: this goes through a f64->i32->f64 conversion.
- let render_bounds = bounds_builder.into_irect_without_clipping(draw_ctx);
let aspect = self.aspect.get();
let (x, y, w, h) = aspect.compute(
- f64::from(surface.width()),
- f64::from(surface.height()),
- f64::from(unclipped_bounds.x0),
- f64::from(unclipped_bounds.y0),
- f64::from(unclipped_bounds.x1 - unclipped_bounds.x0),
- f64::from(unclipped_bounds.y1 - unclipped_bounds.y0),
+ &ViewBox::new(
+ 0.0,
+ 0.0,
+ f64::from(surface.width()),
+ f64::from(surface.height()),
+ ),
+ &Rectangle::new(
- f64::from(render_bounds.x0),
- f64::from(render_bounds.y0),
- f64::from(render_bounds.x1 - render_bounds.x0),
- f64::from(render_bounds.y1 - render_bounds.y0),
++ f64::from(unclipped_bounds.x0),
++ f64::from(unclipped_bounds.y0),
++ f64::from(unclipped_bounds.x1 - unclipped_bounds.x0),
++ f64::from(unclipped_bounds.y1 - unclipped_bounds.y0),
+ ),
);
if w.approx_eq_cairo(&0.0) || h.approx_eq_cairo(&0.0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]