GR32.inc 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. (* ***** BEGIN LICENSE BLOCK *****
  2. * Version: MPL 1.1 or LGPL 2.1 with linking exception
  3. *
  4. * The contents of this file are subject to the Mozilla Public License Version
  5. * 1.1 (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. * http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS" basis,
  10. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. * for the specific language governing rights and limitations under the
  12. * License.
  13. *
  14. * Alternatively, the contents of this file may be used under the terms of the
  15. * Free Pascal modified version of the GNU Lesser General Public License
  16. * Version 2.1 (the "FPC modified LGPL License"), in which case the provisions
  17. * of this license are applicable instead of those above.
  18. * Please see the file LICENSE.txt for additional information concerning this
  19. * license.
  20. *
  21. * The Original Code is Graphics32
  22. *
  23. * The Initial Developer of the Original Code is
  24. * Alex A. Denisov
  25. *
  26. * Portions created by the Initial Developer are Copyright (C) 2000-2009
  27. * the Initial Developer. All Rights Reserved.
  28. *
  29. * Contributor(s):
  30. * Andre Beckedorf <[email protected]>
  31. * Michael Hansen <[email protected]>
  32. * Christian Budde <[email protected]>
  33. *
  34. * ***** END LICENSE BLOCK ***** *)
  35. {$I GR32_Compiler.inc}
  36. (* Symbol PUREPASCAL:
  37. ------------------
  38. Forces GR32 into pure pascal mode. Should be used only for testing and
  39. debugging purposes.
  40. (Defined by default for FPC and DARWIN targets in GR32_Compilers.INC.)
  41. *)
  42. {-$DEFINE PUREPASCAL}
  43. (* Symbol DEPRECATEDMODE :
  44. -----------------------
  45. Defines if GR32 should behave like version 1.7.x and down.
  46. NOTE: Support for this will be dropped at some time and is only provided
  47. for transition *)
  48. {-$DEFINE DEPRECATEDMODE}
  49. (* Symbol CHANGED_IN_PIXELS :
  50. --------------------------
  51. Defines if the OnChange / OnAreaChange event should be fired with
  52. safe pixel setters (PixelS, PixelTS, PixelFS etc.)
  53. NOTE: While enabling this feature is generally better for the repaint and
  54. layer optimization, in "lazy code" it is also much slower. *)
  55. {-$DEFINE CHANGED_IN_PIXELS}
  56. (* Symbol USEINLINING :
  57. --------------------
  58. Defines whether to use function inlining.
  59. NOTE: Enabling this symbol increases executable size but will probably
  60. result in better performance in most cases. *)
  61. {$IFDEF INLININGSUPPORTED}
  62. {$DEFINE USEINLINING}
  63. {$ENDIF}
  64. (* Symbol USE_GUIDS_IN_MMF :
  65. -------------------------
  66. Defines whether to use GUIDs for temporary MMFs filename instead of
  67. using the GetTempFilename in WinAPI. *)
  68. {-$DEFINE USE_GUIDS_IN_MMF}
  69. (* Symbol USEMOVE :
  70. ----------------
  71. Defines whether to use Move instead of MoveLongword. *)
  72. {-$DEFINE USEMOVE}
  73. (* Symbol XPTHEMES :
  74. -----------------
  75. Enable support for windows xp themes. Eventually undefine if GR32 should
  76. be used within a DLL *)
  77. {$DEFINE XPTHEMES}
  78. (* Symbol USEMULTITHREADING :
  79. --------------------------
  80. Use multithreading by default if possible. *)
  81. {-$DEFINE USEMULTITHREADING}
  82. (* FastCode specific symbols:
  83. Adding these symbols to your project's define list will force use of the
  84. particular routine over the standard GR32 routine.
  85. GR32_FASTCODEMOVE - Uses the patched Move routine rather than MoveLongword.
  86. For more information on the FastCode project take a look at this URL:
  87. http://fastcode.sourceforge.net/
  88. For FastMove make sure to download the CPU id based function, ie. runtime
  89. RTL patching.
  90. *)
  91. {-$DEFINE GR32_FASTCODEMOVE}
  92. {$IFDEF GR32_FASTCODEMOVE}
  93. {$DEFINE USEMOVE}
  94. {$ENDIF}
  95. (*
  96. Symbol OMIT_MMX:
  97. ----------------
  98. If defined MMX optimizations are not used (omitted)
  99. For faster pixel/color processing, MMX can be used which results in a huge
  100. performance boost over PUREPASCAL code or native assembler code.
  101. However, there's a penalty (a call to EMMS) when switching between FPU and
  102. MMX registers. This call is not necessary when SSE2 is available. Though,
  103. for backward compatibility it is necessary to call EMMS even if SSE2 is used.
  104. NOTE: On every x64 system SSE2 is available and thus MMX support is not
  105. necessary. In fact it is problematic in case the Delphi XE2 compiler is used.
  106. *)
  107. {-$DEFINE OMIT_MMX}
  108. {$IFDEF TARGET_x64}
  109. {$DEFINE OMIT_MMX}
  110. {$ENDIF}
  111. (*
  112. Symbol OMIT_SSE2:
  113. ----------------
  114. If defined SSE2 optimizations are not used (omitted)
  115. For faster pixel/color processing, SSE2 can be used which results in a huge
  116. performance boost over PUREPASCAL code or native assembler code.
  117. *)
  118. {-$DEFINE OMIT_SSE2}
  119. (*
  120. Symbol: USEGR32GAMMA
  121. --------------------
  122. If defined the polygon rasterizer will use the GR32 gamma correction LUT.
  123. Disable for a slight performance increase.
  124. *)
  125. {$DEFINE USEGR32GAMMA}
  126. (*
  127. Symbol: CHANGENOTIFICATIONS
  128. ---------------------------
  129. If defined the polygon rasterizer will trigger change notifications.
  130. Undefining this will avoid bounding box computations, which may
  131. improve performance slightly.
  132. *)
  133. {$DEFINE CHANGENOTIFICATIONS}
  134. (*
  135. Symbol: USESTACKALLOC
  136. ---------------------
  137. If defined stack allocation routines will be used in some functions.
  138. Allocating memory on the stack is usually more efficient than using the
  139. memory manager. If a routine uses StackAllock/StackFree then it should
  140. always be wrapped inside a {$W+}...{$W-} block in order to generate
  141. a stack frame.
  142. NOTE: Undefine this symbol if you get stack overflow errors.
  143. *)
  144. {-$DEFINE USESTACKALLOC}
  145. (*
  146. Symbol: RGBA_FORMAT
  147. -------------------
  148. Assume RGBA pixel format instead of BGRA (used by e.g. OpenGL.)
  149. *)
  150. {-$DEFINE RGBA_FORMAT}
  151. (*
  152. Symbol: NOHINTING
  153. -----------------
  154. Disables font hinting by default when using TextToPath() method.
  155. It is usually preferrable to disable hinting when using a high quality
  156. polygon renderer like VPR. However, hinting can sometimes improve
  157. visual quality when rendering small text (text is adjusted to pixel
  158. boundaries which makes it more crisp.)
  159. *)
  160. {$DEFINE NOHINTING}
  161. (*
  162. Symbol: NOHORIZONTALHINTING
  163. ---------------------------
  164. Disables horizontal font hinting when using TextToPath() method.
  165. The following should not be used in conjunction with NOHINTING.
  166. It will attempt to address the problem of extreme font hinting in the
  167. GDI by disabling horizontal, but keeping vertical hinting.
  168. *)
  169. {-$DEFINE NOHORIZONTALHINTING}
  170. (*
  171. Symbol: USEKERNING
  172. -----------------
  173. Enables font kerning when using TextToPath() method.
  174. Kerning is the process of adjusting the spacing between characters in a
  175. proportional font, usually to achieve a visually pleasing result. However,
  176. parsing for kerning pairs is quite expensive in terms of CPU usage while the
  177. effect is often very little. Thus kerning is not enabled by default.
  178. *)
  179. {-$DEFINE USEKERNING}
  180. {-$DEFINE TEST_BLENDMEMRGB128SSE4}
  181. {$DEFINE GR32_FMX}
  182. {$DEFINE PLATFORM_INDEPENDENT}
  183. {$DEFINE PUREPASCAL}
  184. {$DEFINE NATIVE_SINCOS}
  185. {$IF Defined(ANDROID) or Defined(IOS)}
  186. {$DEFINE RGBA_FORMAT}
  187. {$ENDIF}