[librsvg: 14/22] Rename PaintServerError to AcquireError
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 14/22] Rename PaintServerError to AcquireError
- Date: Wed, 2 Oct 2019 21:44:48 +0000 (UTC)
commit 5da875aa579a1e256e4a128850dd49cd240fac06
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Oct 2 08:50:31 2019 -0500
Rename PaintServerError to AcquireError
rsvg_internals/src/error.rs | 20 ++++++++++----------
rsvg_internals/src/gradient.rs | 10 +++++-----
rsvg_internals/src/paint_server.rs | 4 ++--
rsvg_internals/src/pattern.rs | 6 +++---
4 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/rsvg_internals/src/error.rs b/rsvg_internals/src/error.rs
index 57d1afb0..dde82541 100644
--- a/rsvg_internals/src/error.rs
+++ b/rsvg_internals/src/error.rs
@@ -124,32 +124,32 @@ impl From<cairo::Status> for RenderingError {
}
#[derive(Debug)]
-pub enum PaintServerError {
+pub enum AcquireError {
LinkNotFound(Fragment),
InvalidLinkType(Fragment),
CircularReference(Fragment),
}
-impl error::Error for PaintServerError {
+impl error::Error for AcquireError {
fn description(&self) -> &str {
match *self {
- PaintServerError::LinkNotFound(_) => "link to paint server not found",
- PaintServerError::InvalidLinkType(_) => "link is to object of invalid type",
- PaintServerError::CircularReference(_) => "circular reference in link"
+ AcquireError::LinkNotFound(_) => "link not found",
+ AcquireError::InvalidLinkType(_) => "link is to object of invalid type",
+ AcquireError::CircularReference(_) => "circular reference in link"
}
}
}
-impl fmt::Display for PaintServerError {
+impl fmt::Display for AcquireError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
- PaintServerError::LinkNotFound(ref frag) =>
- write!(f, "link to paint server not found: {}", frag),
+ AcquireError::LinkNotFound(ref frag) =>
+ write!(f, "link not found: {}", frag),
- PaintServerError::InvalidLinkType(ref frag) =>
+ AcquireError::InvalidLinkType(ref frag) =>
write!(f, "link {} is to object of invalid type", frag),
- PaintServerError::CircularReference(ref frag) =>
+ AcquireError::CircularReference(ref frag) =>
write!(f, "circular reference in link {}", frag),
}
}
diff --git a/rsvg_internals/src/gradient.rs b/rsvg_internals/src/gradient.rs
index 5bd501ec..3aa0b929 100644
--- a/rsvg_internals/src/gradient.rs
+++ b/rsvg_internals/src/gradient.rs
@@ -622,7 +622,7 @@ macro_rules! impl_paint_source {
&self,
node: &RsvgNode,
draw_ctx: &mut DrawingCtx,
- ) -> Result<Self::Resolved, PaintServerError> {
+ ) -> Result<Self::Resolved, AcquireError> {
let mut resolved = self.common.resolved.borrow_mut();
if let Some(ref gradient) = *resolved {
return Ok(gradient.clone());
@@ -638,7 +638,7 @@ macro_rules! impl_paint_source {
let acquired_node = acquired.get();
if stack.contains(acquired_node) {
- return Err(PaintServerError::CircularReference(fragment.clone()));
+ return Err(AcquireError::CircularReference(fragment.clone()));
}
let borrowed_node = acquired_node.borrow();
@@ -780,16 +780,16 @@ impl Gradient {
fn acquire_gradient<'a>(
draw_ctx: &'a mut DrawingCtx,
fragment: &Fragment,
-) -> Result<AcquiredNode, PaintServerError> {
+) -> Result<AcquiredNode, AcquireError> {
draw_ctx.acquired_nodes().get_node(fragment)
- .ok_or(PaintServerError::LinkNotFound(fragment.clone()))
+ .ok_or(AcquireError::LinkNotFound(fragment.clone()))
.and_then(|acquired| {
let node_type = acquired.get().borrow().get_type();
match node_type {
NodeType::LinearGradient => Ok(acquired),
NodeType::RadialGradient => Ok(acquired),
- _ => Err(PaintServerError::InvalidLinkType(fragment.clone()))
+ _ => Err(AcquireError::InvalidLinkType(fragment.clone()))
}
})
}
diff --git a/rsvg_internals/src/paint_server.rs b/rsvg_internals/src/paint_server.rs
index f403f718..f255e1ab 100644
--- a/rsvg_internals/src/paint_server.rs
+++ b/rsvg_internals/src/paint_server.rs
@@ -61,7 +61,7 @@ pub trait PaintSource {
&self,
node: &RsvgNode,
draw_ctx: &mut DrawingCtx,
- ) -> Result<Self::Resolved, PaintServerError>;
+ ) -> Result<Self::Resolved, AcquireError>;
fn resolve_fallbacks_and_set_pattern(
&self,
@@ -77,7 +77,7 @@ pub trait PaintSource {
resolved.set_pattern_on_draw_context(values, draw_ctx, opacity, bbox)
}
- Err(PaintServerError::CircularReference(_)) => {
+ Err(AcquireError::CircularReference(_)) => {
// FIXME: add a fragment or node id to this:
rsvg_log!("circular reference in paint server {}", node);
Err(RenderingError::CircularReference)
diff --git a/rsvg_internals/src/pattern.rs b/rsvg_internals/src/pattern.rs
index a53c08f9..80184847 100644
--- a/rsvg_internals/src/pattern.rs
+++ b/rsvg_internals/src/pattern.rs
@@ -8,7 +8,7 @@ use crate::aspect_ratio::*;
use crate::bbox::*;
use crate::coord_units::CoordUnits;
use crate::drawing_ctx::{DrawingCtx, NodeStack};
-use crate::error::{AttributeResultExt, PaintServerError, RenderingError};
+use crate::error::{AttributeResultExt, AcquireError, RenderingError};
use crate::float_eq_cairo::ApproxEqCairo;
use crate::length::*;
use crate::node::*;
@@ -158,7 +158,7 @@ impl PaintSource for NodePattern {
&self,
node: &RsvgNode,
draw_ctx: &mut DrawingCtx,
- ) -> Result<Self::Resolved, PaintServerError> {
+ ) -> Result<Self::Resolved, AcquireError> {
let mut resolved = self.resolved.borrow_mut();
if let Some(ref pattern) = *resolved {
return Ok(pattern.clone());
@@ -177,7 +177,7 @@ impl PaintSource for NodePattern {
let acquired_node = acquired.get();
if stack.contains(acquired_node) {
- return Err(PaintServerError::CircularReference(fragment.clone()));
+ return Err(AcquireError::CircularReference(fragment.clone()));
}
let borrowed_node = acquired_node.borrow();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]