[librsvg: 1/11] Rename Gradient to ResolvedGradient




commit 9b9ebf1649249a49ddc09e306522ee1a6545e946
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Nov 30 20:21:43 2020 -0600

    Rename Gradient to ResolvedGradient

 src/drawing_ctx.rs  |  4 ++--
 src/gradient.rs     | 14 +++++++-------
 src/paint_server.rs |  4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index 0e9376ed..9069f581 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -20,7 +20,7 @@ use crate::error::{AcquireError, RenderingError};
 use crate::filter::FilterValue;
 use crate::filters;
 use crate::float_eq_cairo::ApproxEqCairo;
-use crate::gradient::{Gradient, GradientUnits, GradientVariant, SpreadMethod};
+use crate::gradient::{GradientUnits, GradientVariant, ResolvedGradient, SpreadMethod};
 use crate::marker;
 use crate::node::{CascadedValues, Node, NodeBorrow, NodeDraw};
 use crate::paint_server::{PaintServer, PaintSource};
@@ -935,7 +935,7 @@ impl DrawingCtx {
 
     fn set_gradient(
         self: &mut DrawingCtx,
-        gradient: &Gradient,
+        gradient: &ResolvedGradient,
         _acquired_nodes: &mut AcquiredNodes<'_>,
         opacity: UnitInterval,
         values: &ComputedValues,
diff --git a/src/gradient.rs b/src/gradient.rs
index ab112666..861dd988 100644
--- a/src/gradient.rs
+++ b/src/gradient.rs
@@ -290,7 +290,7 @@ struct Common {
 
     fallback: Option<Fragment>,
 
-    resolved: RefCell<Option<Gradient>>,
+    resolved: RefCell<Option<ResolvedGradient>>,
 }
 
 /// Node for the <linearGradient> element
@@ -332,7 +332,7 @@ struct UnresolvedGradient {
 
 /// Resolved gradient; this is memoizable after the initial resolution.
 #[derive(Clone)]
-pub struct Gradient {
+pub struct ResolvedGradient {
     units: GradientUnits,
     transform: Transform,
     spread: SpreadMethod,
@@ -342,7 +342,7 @@ pub struct Gradient {
 }
 
 impl UnresolvedGradient {
-    fn into_resolved(self) -> Gradient {
+    fn into_resolved(self) -> ResolvedGradient {
         assert!(self.is_resolved());
 
         let UnresolvedGradient {
@@ -354,7 +354,7 @@ impl UnresolvedGradient {
         } = self;
 
         match variant {
-            UnresolvedVariant::Linear { .. } => Gradient {
+            UnresolvedVariant::Linear { .. } => ResolvedGradient {
                 units: units.unwrap(),
                 transform: transform.unwrap(),
                 spread: spread.unwrap(),
@@ -363,7 +363,7 @@ impl UnresolvedGradient {
                 variant: variant.into_resolved(),
             },
 
-            UnresolvedVariant::Radial { .. } => Gradient {
+            UnresolvedVariant::Radial { .. } => ResolvedGradient {
                 units: units.unwrap(),
                 transform: transform.unwrap(),
                 spread: spread.unwrap(),
@@ -579,7 +579,7 @@ macro_rules! impl_gradient {
                 &self,
                 node: &Node,
                 acquired_nodes: &mut AcquiredNodes<'_>,
-            ) -> Result<Gradient, AcquireError> {
+            ) -> Result<ResolvedGradient, AcquireError> {
                 let mut resolved = self.common.resolved.borrow_mut();
                 if let Some(ref gradient) = *resolved {
                     return Ok(gradient.clone());
@@ -663,7 +663,7 @@ impl SetAttributes for RadialGradient {
 
 impl Draw for RadialGradient {}
 
-impl Gradient {
+impl ResolvedGradient {
     pub fn get_units(&self) -> GradientUnits {
         self.units
     }
diff --git a/src/paint_server.rs b/src/paint_server.rs
index 201d9868..06fdfd15 100644
--- a/src/paint_server.rs
+++ b/src/paint_server.rs
@@ -5,7 +5,7 @@ use cssparser::Parser;
 use crate::document::AcquiredNodes;
 use crate::element::Element;
 use crate::error::*;
-use crate::gradient::Gradient;
+use crate::gradient::ResolvedGradient;
 use crate::node::NodeBorrow;
 use crate::parsers::Parse;
 use crate::pattern::ResolvedPattern;
@@ -23,7 +23,7 @@ pub enum PaintServer {
 
 pub enum PaintSource {
     None,
-    Gradient(Gradient, Option<cssparser::Color>),
+    Gradient(ResolvedGradient, Option<cssparser::Color>),
     Pattern(ResolvedPattern, Option<cssparser::Color>),
     SolidColor(cssparser::Color),
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]