[librsvg: 2/8] filters - rename "in_" inputs to "in1"
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 2/8] filters - rename "in_" inputs to "in1"
- Date: Thu, 11 Mar 2021 03:13:21 +0000 (UTC)
commit 16b53804aa99cbf5679d23c320b15011210f0a07
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Mar 10 17:05:16 2021 -0600
filters - rename "in_" inputs to "in1"
Those are the first input, and sometimes the only one, to a primitive
or sub-element.
src/filters/merge.rs | 12 ++++++------
src/filters/mod.rs | 8 ++++----
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/filters/merge.rs b/src/filters/merge.rs
index de3b2a57..dbfcb07c 100644
--- a/src/filters/merge.rs
+++ b/src/filters/merge.rs
@@ -20,7 +20,7 @@ pub struct FeMerge {
/// The `<feMergeNode>` element.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct FeMergeNode {
- in_: Option<Input>,
+ in1: Option<Input>,
}
impl Default for FeMerge {
@@ -42,7 +42,7 @@ impl SetAttributes for FeMerge {
impl SetAttributes for FeMergeNode {
#[inline]
fn set_attributes(&mut self, attrs: &Attributes) -> ElementResult {
- self.in_ = attrs
+ self.in1 = attrs
.iter()
.find(|(attr, _)| attr.expanded() == expanded_name!("", "in"))
.and_then(|(attr, value)| attr.parse(value).ok());
@@ -62,7 +62,7 @@ impl FeMergeNode {
bounds: IRect,
output_surface: Option<SharedImageSurface>,
) -> Result<SharedImageSurface, FilterError> {
- let input = ctx.get_input(acquired_nodes, draw_ctx, self.in_.as_ref())?;
+ let input = ctx.get_input(acquired_nodes, draw_ctx, self.in1.as_ref())?;
if output_surface.is_none() {
return Ok(input.surface().clone());
@@ -88,7 +88,7 @@ impl FilterRender for FeMerge {
// Compute the filter bounds, taking each feMergeNode's input into account.
let mut bounds = self.base.get_bounds(ctx)?;
for merge_node in ¶meters {
- let input = ctx.get_input(acquired_nodes, draw_ctx, merge_node.in_.as_ref())?;
+ let input = ctx.get_input(acquired_nodes, draw_ctx, merge_node.in1.as_ref())?;
bounds = bounds.add_input(&input);
}
@@ -172,10 +172,10 @@ mod tests {
¶ms[..],
vec![
FeMergeNode {
- in_: Some(Input::SourceGraphic)
+ in1: Some(Input::SourceGraphic)
},
FeMergeNode {
- in_: Some(Input::SourceAlpha)
+ in1: Some(Input::SourceAlpha)
},
]
);
diff --git a/src/filters/mod.rs b/src/filters/mod.rs
index 6a4c0e78..1c08c3a9 100644
--- a/src/filters/mod.rs
+++ b/src/filters/mod.rs
@@ -118,7 +118,7 @@ impl Parse for Input {
/// The base node for filter primitives which accept input.
struct PrimitiveWithInput {
base: Primitive,
- in_: Option<Input>,
+ in1: Option<Input>,
}
impl Primitive {
@@ -195,7 +195,7 @@ impl PrimitiveWithInput {
fn new() -> PrimitiveWithInput {
PrimitiveWithInput {
base: Primitive::new(),
- in_: None,
+ in1: None,
}
}
@@ -207,7 +207,7 @@ impl PrimitiveWithInput {
acquired_nodes: &mut AcquiredNodes<'_>,
draw_ctx: &mut DrawingCtx,
) -> Result<FilterInput, FilterError> {
- ctx.get_input(acquired_nodes, draw_ctx, self.in_.as_ref())
+ ctx.get_input(acquired_nodes, draw_ctx, self.in1.as_ref())
}
}
@@ -215,7 +215,7 @@ impl SetAttributes for PrimitiveWithInput {
fn set_attributes(&mut self, attrs: &Attributes) -> ElementResult {
self.base.set_attributes(attrs)?;
- self.in_ = attrs
+ self.in1 = attrs
.iter()
.find(|(attr, _)| attr.expanded() == expanded_name!("", "in"))
.and_then(|(attr, value)| attr.parse(value).ok());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]