Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: src/raster/ftmisc.h

Issue 89753003: Update freetype to latest version of ASOP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src/third_party/freetype.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/psnames/pspic.c ('k') | src/raster/ftraster.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /***************************************************************************/ 1 /***************************************************************************/
2 /* */ 2 /* */
3 /* ftmisc.h */ 3 /* ftmisc.h */
4 /* */ 4 /* */
5 /* Miscellaneous macros for stand-alone rasterizer (specification */ 5 /* Miscellaneous macros for stand-alone rasterizer (specification */
6 /* only). */ 6 /* only). */
7 /* */ 7 /* */
8 /* Copyright 2005, 2009, 2010 by */ 8 /* Copyright 2005, 2009, 2010 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* */ 10 /* */
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 if ( a < 0 ) { a = -a; s = -1; } 108 if ( a < 0 ) { a = -a; s = -1; }
109 if ( b < 0 ) { b = -b; s = -s; } 109 if ( b < 0 ) { b = -b; s = -s; }
110 if ( c < 0 ) { c = -c; s = -s; } 110 if ( c < 0 ) { c = -c; s = -s; }
111 111
112 d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c 112 d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
113 : 0x7FFFFFFFL ); 113 : 0x7FFFFFFFL );
114 114
115 return ( s > 0 ) ? d : -d; 115 return ( s > 0 ) ? d : -d;
116 } 116 }
117 117
118
119 static FT_Long
120 FT_MulDiv_No_Round( FT_Long a,
121 FT_Long b,
122 FT_Long c )
123 {
124 FT_Int s;
125 FT_Long d;
126
127
128 s = 1;
129 if ( a < 0 ) { a = -a; s = -1; }
130 if ( b < 0 ) { b = -b; s = -s; }
131 if ( c < 0 ) { c = -c; s = -s; }
132
133 d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
134 : 0x7FFFFFFFL );
135
136 return ( s > 0 ) ? d : -d;
137 }
138
118 #endif /* __FTMISC_H__ */ 139 #endif /* __FTMISC_H__ */
119 140
120 141
121 /* END */ 142 /* END */
OLDNEW
« no previous file with comments | « src/psnames/pspic.c ('k') | src/raster/ftraster.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698