[PATCH] pixman: Cleanup documentation of radial_gradient_get_scanline_32

Fernando Carrijo fcarrijo at yahoo.com.br
Sat Jan 2 03:16:09 PST 2010


Hi!

The first two hunks of this patch change the notation of gradients
from (c₁,r₁) to <c₁,r₁>, which is appropriate for it makes clearer
the distinction between those elements and points, whose nature is
necessarily ordered.

The following two hunks catch the same typo by renaming r2 to r₂.

The last two hunks are a tribute to Bhaskara.


Signed-off-by: Fernando Carrijo <fcarrijo at yahoo.com.br>
---
 pixman/pixman-radial-gradient.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pixman/pixman-radial-gradient.c b/pixman/pixman-radial-gradient.c
index 022157b..ae5d93d 100644
--- a/pixman/pixman-radial-gradient.c
+++ b/pixman/pixman-radial-gradient.c
@@ -43,8 +43,8 @@ radial_gradient_get_scanline_32 (pixman_image_t *image,
                                  uint32_t        mask_bits)
 {
     /*
-     * In the radial gradient problem we are given two circles (c₁,r₁) and
-     * (c₂,r₂) that define the gradient itself. Then, for any point p, we
+     * In the radial gradient problem we are given two circles <c₁,r₁> and
+     * <c₂,r₂> that define the gradient itself. Then, for any point p, we
      * must compute the value(s) of t within [0.0, 1.0] representing the
      * circle(s) that would color the point.
      *
@@ -70,7 +70,7 @@ radial_gradient_get_scanline_32 (pixman_image_t *image,
      *    ╌╌•
      *      c₁
      *
-     * Given (c₁,r₁), (c₂,r₂) and p, we must find an angle θ such that two
+     * Given <c₁,r₁>, <c₂,r₂> and p, we must find an angle θ such that two
      * points p₁ and p₂ on the two circles are collinear with p. Then, the
      * desired value of t is the ratio of the length of p₁p to the length
      * of p₁p₂.
@@ -85,8 +85,8 @@ radial_gradient_get_scanline_32 (pixman_image_t *image,
      *
      * Point p₂ is a distance r₂ from c₂ at an angle of θ:
      *
-     *	3. p₂x = c₂x + r2·cos θ
-     *	4. p₂y = c₂y + r2·sin θ
+     *	3. p₂x = c₂x + r₂·cos θ
+     *	4. p₂y = c₂y + r₂·sin θ
      *
      * Point p lies at a fraction t along the line segment p₁p₂:
      *
@@ -154,7 +154,7 @@ radial_gradient_get_scanline_32 (pixman_image_t *image,
      * precomputed. From here we just use the quadratic formula to solve
      * for t:
      *
-     * t = (-2·B ± ⎷(B² - 4·A·C)) / 2·A
+     * t = (-B ± ⎷(B² - 4·A·C)) / 2·A
      */
 
     gradient_t *gradient = (gradient_t *)image;
@@ -201,7 +201,7 @@ radial_gradient_get_scanline_32 (pixman_image_t *image,
 	/* When computing t over a scanline, we notice that some expressions
 	 * are constant so we can compute them just once. Given:
 	 *
-	 * t = (-2·B ± ⎷(B² - 4·A·C)) / 2·A
+	 * t = (-B ± ⎷(B² - 4·A·C)) / 2·A
 	 *
 	 * where
 	 *
-- 
1.5.6.



More information about the xorg-devel mailing list