[librsvg] filters: shorten "merge" code
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] filters: shorten "merge" code
- Date: Tue, 14 Jan 2020 00:48:05 +0000 (UTC)
commit f68fbc05a5cae66a6c777444d2213e1aaeeb590c
Author: Paolo Borelli <pborelli gnome org>
Date: Tue Jan 14 01:45:28 2020 +0100
filters: shorten "merge" code
rsvg_internals/src/filters/merge.rs | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/rsvg_internals/src/filters/merge.rs b/rsvg_internals/src/filters/merge.rs
index f650fa59..b8b95cde 100644
--- a/rsvg_internals/src/filters/merge.rs
+++ b/rsvg_internals/src/filters/merge.rs
@@ -115,24 +115,18 @@ impl FilterEffect for FeMerge {
)?);
}
- let output_surface = match output_surface {
- Some(surface) => surface,
- None => SharedImageSurface::wrap(
- cairo::ImageSurface::create(
- cairo::Format::ARgb32,
- ctx.source_graphic().width(),
- ctx.source_graphic().height(),
- )?,
+ let surface = match output_surface {
+ Some(s) => s,
+ None => SharedImageSurface::empty(
+ ctx.source_graphic().width(),
+ ctx.source_graphic().height(),
SurfaceType::AlphaOnly,
)?,
};
Ok(FilterResult {
name: self.base.result.clone(),
- output: FilterOutput {
- surface: output_surface,
- bounds,
- },
+ output: FilterOutput { surface, bounds },
})
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]