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

Side by Side Diff: third_party/freetype2/include/ftconfig.h

Issue 612523005: Roll FreeType to 2.4.8 plus Ubuntu Precise patches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 | « third_party/freetype2/freetype2.patch ('k') | third_party/freetype2/include/ftoption.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* ftconfig.h. Generated from ftconfig.in by configure. */ 1 /* ftconfig.h. Generated from ftconfig.in by configure. */
2 /***************************************************************************/ 2 /***************************************************************************/
3 /* */ 3 /* */
4 /* ftconfig.in */ 4 /* ftconfig.in */
5 /* */ 5 /* */
6 /* UNIX-specific configuration file (specification only). */ 6 /* UNIX-specific configuration file (specification only). */
7 /* */ 7 /* */
8 /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */ 8 /* Copyright 1996-2004, 2006-2009, 2011 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* */ 10 /* */
11 /* This file is part of the FreeType project, and may only be used, */ 11 /* This file is part of the FreeType project, and may only be used, */
12 /* modified, and distributed under the terms of the FreeType project */ 12 /* modified, and distributed under the terms of the FreeType project */
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 /* this file you indicate that you have read the license and */ 14 /* this file you indicate that you have read the license and */
15 /* understand and accept it fully. */ 15 /* understand and accept it fully. */
16 /* */ 16 /* */
17 /***************************************************************************/ 17 /***************************************************************************/
18 18
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 #define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) 111 #define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
112 #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL 112 #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
113 #define FT_SIZEOF_LONG (64 / FT_CHAR_BIT) 113 #define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
114 #else 114 #else
115 #error "Unsupported size of `long' type!" 115 #error "Unsupported size of `long' type!"
116 #endif 116 #endif
117 117
118 #endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ 118 #endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
119 119
120 120
121 /* Preferred alignment of data */
122 #define FT_ALIGNMENT 8
123
124
125 /* FT_UNUSED is a macro used to indicate that a given parameter is not */ 121 /* FT_UNUSED is a macro used to indicate that a given parameter is not */
126 /* used -- this is only used to get rid of unpleasant compiler warnings */ 122 /* used -- this is only used to get rid of unpleasant compiler warnings */
127 #ifndef FT_UNUSED 123 #ifndef FT_UNUSED
128 #define FT_UNUSED( arg ) ( (arg) = (arg) ) 124 #define FT_UNUSED( arg ) ( (arg) = (arg) )
129 #endif 125 #endif
130 126
131 127
132 /*************************************************************************/ 128 /*************************************************************************/
133 /* */ 129 /* */
134 /* AUTOMATIC CONFIGURATION MACROS */ 130 /* AUTOMATIC CONFIGURATION MACROS */
135 /* */ 131 /* */
136 /* These macros are computed from the ones defined above. Don't touch */ 132 /* These macros are computed from the ones defined above. Don't touch */
137 /* their definition, unless you know precisely what you are doing. No */ 133 /* their definition, unless you know precisely what you are doing. No */
138 /* porter should need to mess with them. */ 134 /* porter should need to mess with them. */
139 /* */ 135 /* */
140 /*************************************************************************/ 136 /*************************************************************************/
141 137
142 138
143 /*************************************************************************/ 139 /*************************************************************************/
144 /* */ 140 /* */
145 /* Mac support */ 141 /* Mac support */
146 /* */ 142 /* */
147 /* This is the only necessary change, so it is defined here instead */ 143 /* This is the only necessary change, so it is defined here instead */
148 /* providing a new configuration file. */ 144 /* providing a new configuration file. */
149 /* */ 145 /* */
150 #if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ 146 #if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
151 ( defined( __MWERKS__ ) && defined( macintosh ) ) 147 ( defined( __MWERKS__ ) && defined( macintosh ) )
152 /* no Carbon frameworks for 64bit 10.4.x */ 148 /* no Carbon frameworks for 64bit 10.4.x */
149 /* AvailabilityMacros.h is available since Mac OS X 10.2, */
150 /* so guess the system version by maximum errno before inclusion */
151 #include <errno.h>
152 #ifdef ECANCELED /* defined since 10.2 */
153 #include "AvailabilityMacros.h" 153 #include "AvailabilityMacros.h"
154 #endif
154 #if defined( __LP64__ ) && \ 155 #if defined( __LP64__ ) && \
155 ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) 156 ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
156 #define DARWIN_NO_CARBON 1 157 #define DARWIN_NO_CARBON 1
157 #else 158 #else
158 #define FT_MACINTOSH 1 159 #define FT_MACINTOSH 1
159 #endif 160 #endif
160 161
161 #elif defined( __SC__ ) || defined( __MRC__ ) 162 #elif defined( __SC__ ) || defined( __MRC__ )
162 /* Classic MacOS compilers */ 163 /* Classic MacOS compilers */
163 #include "ConditionalMacros.h" 164 #include "ConditionalMacros.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 281
281 #define FT_BEGIN_STMNT do { 282 #define FT_BEGIN_STMNT do {
282 #define FT_END_STMNT } while ( 0 ) 283 #define FT_END_STMNT } while ( 0 )
283 #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT 284 #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
284 285
285 286
286 #ifndef FT_CONFIG_OPTION_NO_ASSEMBLER 287 #ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
287 /* Provide assembler fragments for performance-critical functions. */ 288 /* Provide assembler fragments for performance-critical functions. */
288 /* These must be defined `static __inline__' with GCC. */ 289 /* These must be defined `static __inline__' with GCC. */
289 290
291 #if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
292 #define FT_MULFIX_ASSEMBLER FT_MulFix_arm
293
294 /* documentation is in freetype.h */
295
296 static __inline FT_Int32
297 FT_MulFix_arm( FT_Int32 a,
298 FT_Int32 b )
299 {
300 register FT_Int32 t, t2;
301
302
303 __asm
304 {
305 smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
306 mov a, t, asr #31 /* a = (hi >> 31) */
307 add a, a, #0x8000 /* a += 0x8000 */
308 adds t2, t2, a /* t2 += a */
309 adc t, t, #0 /* t += carry */
310 mov a, t2, lsr #16 /* a = t2 >> 16 */
311 orr a, a, t, lsl #16 /* a |= t << 16 */
312 }
313 return a;
314 }
315
316 #endif /* __CC_ARM || __ARMCC__ */
317
318
290 #ifdef __GNUC__ 319 #ifdef __GNUC__
291 320
292 #if defined( __arm__ ) && !defined( __thumb__ ) 321 #if defined( __arm__ ) && !defined( __thumb__ ) && \
322 !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
293 #define FT_MULFIX_ASSEMBLER FT_MulFix_arm 323 #define FT_MULFIX_ASSEMBLER FT_MulFix_arm
294 324
325 /* documentation is in freetype.h */
326
295 static __inline__ FT_Int32 327 static __inline__ FT_Int32
296 FT_MulFix_arm( FT_Int32 a, 328 FT_MulFix_arm( FT_Int32 a,
297 FT_Int32 b ) 329 FT_Int32 b )
298 { 330 {
299 register FT_Int32 t, t2; 331 register FT_Int32 t, t2;
300 332
301 333
302 __asm__ __volatile__ ( 334 __asm__ __volatile__ (
303 "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ 335 "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
304 "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ 336 "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
305 "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ 337 "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
306 "adds %1, %1, %0\n\t" /* %1 += %0 */ 338 "adds %1, %1, %0\n\t" /* %1 += %0 */
307 "adc %2, %2, #0\n\t" /* %2 += carry */ 339 "adc %2, %2, #0\n\t" /* %2 += carry */
308 "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ 340 "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
309 "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ 341 "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
310 : "=r"(a), "=&r"(t2), "=&r"(t) 342 : "=r"(a), "=&r"(t2), "=&r"(t)
311 : "r"(a), "r"(b) ); 343 : "r"(a), "r"(b) );
312 return a; 344 return a;
313 } 345 }
314 346
315 #endif /* __arm__ && !__thumb__ */ 347 #endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
316 348
317 #if defined( i386 ) 349 #if defined( __i386__ )
318 #define FT_MULFIX_ASSEMBLER FT_MulFix_i386 350 #define FT_MULFIX_ASSEMBLER FT_MulFix_i386
319 351
352 /* documentation is in freetype.h */
353
320 static __inline__ FT_Int32 354 static __inline__ FT_Int32
321 FT_MulFix_i386( FT_Int32 a, 355 FT_MulFix_i386( FT_Int32 a,
322 FT_Int32 b ) 356 FT_Int32 b )
323 { 357 {
324 register FT_Int32 result; 358 register FT_Int32 result;
325 359
326 360
327 __asm__ __volatile__ ( 361 __asm__ __volatile__ (
328 "imul %%edx\n" 362 "imul %%edx\n"
329 "movl %%edx, %%ecx\n" 363 "movl %%edx, %%ecx\n"
330 "sarl $31, %%ecx\n" 364 "sarl $31, %%ecx\n"
331 "addl $0x8000, %%ecx\n" 365 "addl $0x8000, %%ecx\n"
332 "addl %%ecx, %%eax\n" 366 "addl %%ecx, %%eax\n"
333 "adcl $0, %%edx\n" 367 "adcl $0, %%edx\n"
334 "shrl $16, %%eax\n" 368 "shrl $16, %%eax\n"
335 "shll $16, %%edx\n" 369 "shll $16, %%edx\n"
336 "addl %%edx, %%eax\n" 370 "addl %%edx, %%eax\n"
337 : "=a"(result), "+d"(b) 371 : "=a"(result), "=d"(b)
338 : "a"(a) 372 : "a"(a), "d"(b)
339 : "%ecx" ); 373 : "%ecx", "cc" );
340 return result; 374 return result;
341 } 375 }
342 376
343 #endif /* i386 */ 377 #endif /* i386 */
344 378
345 #endif /* __GNUC__ */ 379 #endif /* __GNUC__ */
346 380
381
382 #ifdef _MSC_VER /* Visual C++ */
383
384 #ifdef _M_IX86
385
386 #define FT_MULFIX_ASSEMBLER FT_MulFix_i386
387
388 /* documentation is in freetype.h */
389
390 static __inline FT_Int32
391 FT_MulFix_i386( FT_Int32 a,
392 FT_Int32 b )
393 {
394 register FT_Int32 result;
395
396 __asm
397 {
398 mov eax, a
399 mov edx, b
400 imul edx
401 mov ecx, edx
402 sar ecx, 31
403 add ecx, 8000h
404 add eax, ecx
405 adc edx, 0
406 shr eax, 16
407 shl edx, 16
408 add eax, edx
409 mov result, eax
410 }
411 return result;
412 }
413
414 #endif /* _M_IX86 */
415
416 #endif /* _MSC_VER */
417
347 #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ 418 #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
348 419
349 420
350 #ifdef FT_CONFIG_OPTION_INLINE_MULFIX 421 #ifdef FT_CONFIG_OPTION_INLINE_MULFIX
351 #ifdef FT_MULFIX_ASSEMBLER 422 #ifdef FT_MULFIX_ASSEMBLER
352 #define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER 423 #define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER
353 #endif 424 #endif
354 #endif 425 #endif
355 426
356 427
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 #endif /* FT_CALLBACK_TABLE */ 539 #endif /* FT_CALLBACK_TABLE */
469 540
470 541
471 FT_END_HEADER 542 FT_END_HEADER
472 543
473 544
474 #endif /* __FTCONFIG_H__ */ 545 #endif /* __FTCONFIG_H__ */
475 546
476 547
477 /* END */ 548 /* END */
OLDNEW
« no previous file with comments | « third_party/freetype2/freetype2.patch ('k') | third_party/freetype2/include/ftoption.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698