ref: 84b2c63374cb5444e927285ece93a24084674e48
parent: da86b73f034c077637b169c374808a966e00f399
author: Alexei Podtelezhnikov <[email protected]>
date: Wed Mar 16 20:53:09 EDT 2016
[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.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-03-17 Alexei Podtelezhnikov <[email protected]>
+
+ [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 <[email protected]>
* src/autofit/aflatin.c (af_latin_compute_stem_width): Optimize.
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1063,25 +1063,15 @@
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 @@
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 @@
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 @@
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;
}