ref: 7c4ac3cb0c3defe453009503d2a85026227bad55
parent: 9073e7ceb628ed8404896bd1901e4262d77a170f
author: Алексей Подтележников <[email protected]>
date: Sun Nov 28 03:23:40 EST 2010
[ftsmooth]: Minor code simplification. * src/smooth/ftgrays (gray_render_cubic): Do only one comparison instead of two.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-28 Alexei Podtelezhnikov <[email protected]>
+
+ [ftsmooth]: Minor code simplification.
+
+ * src/smooth/ftgrays (gray_render_cubic): Do only one comparison
+ instead of two.
+
2010-11-26 Johnson Y. Yan <[email protected]>
[truetype] Better multi-threading support.
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1057,7 +1057,13 @@
dx_ = FT_ABS( dx );
dy_ = FT_ABS( dy );
- L = ( 236 * FT_MAX( dx_, dy_ ) + 97 * FT_MIN( dx_, dy_ ) ) >> 8;
+
+ /* This is the same as */
+ /* */
+ /* L = ( 236 * FT_MAX( dx_, dy_ ) */
+ /* + 97 * FT_MIN( dx_, dy_ ) ) >> 8; */
+ L = ( dx_ > dy_ ? 236 * dx_ + 97 * dy_
+ : 97 * dx_ + 236 * dy_ ) >> 8;
/* Avoid possible arithmetic overflow below by splitting. */
if ( L > 32767 )