[smooth] Minor refactoring. * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move upscaling from here... (gray_conic_to, gray_cubic_to):... to here.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
diff --git a/ChangeLog b/ChangeLog
index f963c83..b6f165d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-03-17 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [smooth] Minor refactoring.
+
+ * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move
+ upscaling from here...
+ (gray_conic_to, gray_cubic_to):... to here.
+
2016-03-15 Werner Lemberg <wl@gnu.org>
* src/autofit/aflatin.c (af_latin_compute_stem_width): Optimize.
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 020af82..c02c009 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1063,25 +1063,15 @@ typedef ptrdiff_t FT_PtrDist;
static void
- gray_render_conic( RAS_ARG_ const FT_Vector* control,
- const FT_Vector* to )
+ gray_render_conic( RAS_ARG )
{
TPos dx, dy;
TPos min, max, y;
int top, level;
- int* levels;
- FT_Vector* arc;
+ int* levels = ras.lev_stack;
+ FT_Vector* arc = ras.bez_stack;
- levels = ras.lev_stack;
-
- arc = ras.bez_stack;
- arc[0].x = UPSCALE( to->x );
- arc[0].y = UPSCALE( to->y );
- arc[1].x = UPSCALE( control->x );
- arc[1].y = UPSCALE( control->y );
- arc[2].x = ras.x;
- arc[2].y = ras.y;
top = 0;
dx = FT_ABS( arc[2].x + arc[0].x - 2 * arc[1].x );
@@ -1165,24 +1155,12 @@ typedef ptrdiff_t FT_PtrDist;
static void
- gray_render_cubic( RAS_ARG_ const FT_Vector* control1,
- const FT_Vector* control2,
- const FT_Vector* to )
+ gray_render_cubic( RAS_ARG )
{
- FT_Vector* arc;
+ FT_Vector* arc = ras.bez_stack;
TPos min, max, y;
- arc = ras.bez_stack;
- arc[0].x = UPSCALE( to->x );
- arc[0].y = UPSCALE( to->y );
- arc[1].x = UPSCALE( control2->x );
- arc[1].y = UPSCALE( control2->y );
- arc[2].x = UPSCALE( control1->x );
- arc[2].y = UPSCALE( control1->y );
- arc[3].x = ras.x;
- arc[3].y = ras.y;
-
/* Short-cut the arc that crosses the current band. */
min = max = arc[0].y;
@@ -1313,7 +1291,17 @@ typedef ptrdiff_t FT_PtrDist;
const FT_Vector* to,
gray_PWorker worker )
{
- gray_render_conic( RAS_VAR_ control, to );
+ FT_Vector* arc = ras.bez_stack;
+
+
+ arc[0].x = UPSCALE( to->x );
+ arc[0].y = UPSCALE( to->y );
+ arc[1].x = UPSCALE( control->x );
+ arc[1].y = UPSCALE( control->y );
+ arc[2].x = ras.x;
+ arc[2].y = ras.y;
+
+ gray_render_conic( RAS_VAR );
return 0;
}
@@ -1324,7 +1312,19 @@ typedef ptrdiff_t FT_PtrDist;
const FT_Vector* to,
gray_PWorker worker )
{
- gray_render_cubic( RAS_VAR_ control1, control2, to );
+ FT_Vector* arc = ras.bez_stack;
+
+
+ arc[0].x = UPSCALE( to->x );
+ arc[0].y = UPSCALE( to->y );
+ arc[1].x = UPSCALE( control2->x );
+ arc[1].y = UPSCALE( control2->y );
+ arc[2].x = UPSCALE( control1->x );
+ arc[2].y = UPSCALE( control1->y );
+ arc[3].x = ras.x;
+ arc[3].y = ras.y;
+
+ gray_render_cubic( RAS_VAR );
return 0;
}