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 <Andre@metaException.de>
|
---|
31 | * Michael Hansen <dyster_tid@hotmail.com>
|
---|
32 | * Christian Budde <Christian@aixcoustic.com>
|
---|
33 | *
|
---|
34 | * ***** END LICENSE BLOCK ***** *)
|
---|
35 |
|
---|
36 | {$I GR32_Compiler.inc}
|
---|
37 |
|
---|
38 |
|
---|
39 | (* Symbol PUREPASCAL:
|
---|
40 | ------------------
|
---|
41 |
|
---|
42 | Forces GR32 into pure pascal mode. Should be used only for testing and
|
---|
43 | debugging purposes.
|
---|
44 |
|
---|
45 | (Defined by default for FPC and DARWIN targets in GR32_Compilers.INC.)
|
---|
46 |
|
---|
47 | *)
|
---|
48 |
|
---|
49 | {-$DEFINE PUREPASCAL}
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 | (* Symbol DEPRECATEDMODE :
|
---|
54 | -----------------------
|
---|
55 |
|
---|
56 | Defines if GR32 should behave like version 1.7.x and down.
|
---|
57 |
|
---|
58 | NOTE: Support for this will be dropped at some time and is only provided
|
---|
59 | for transition *)
|
---|
60 |
|
---|
61 | {-$DEFINE DEPRECATEDMODE}
|
---|
62 |
|
---|
63 |
|
---|
64 |
|
---|
65 | (* Symbol CHANGED_IN_PIXELS :
|
---|
66 | --------------------------
|
---|
67 |
|
---|
68 | Defines if the OnChange / OnAreaChange event should be fired with
|
---|
69 | safe pixel setters (PixelS, PixelTS, PixelFS etc.)
|
---|
70 |
|
---|
71 | NOTE: While enabling this feature is generally better for the repaint and
|
---|
72 | layer optimization, in "lazy code" it is also much slower. *)
|
---|
73 |
|
---|
74 | {-$DEFINE CHANGED_IN_PIXELS}
|
---|
75 |
|
---|
76 |
|
---|
77 |
|
---|
78 | (* Symbol USEINLINING :
|
---|
79 | --------------------
|
---|
80 |
|
---|
81 | Defines whether to use function inlining.
|
---|
82 |
|
---|
83 | NOTE: Enabling this symbol increases executable size but will probably
|
---|
84 | result in better performance in most cases. *)
|
---|
85 |
|
---|
86 | {$IFDEF INLININGSUPPORTED}
|
---|
87 | {$DEFINE USEINLINING}
|
---|
88 | {$ENDIF}
|
---|
89 |
|
---|
90 |
|
---|
91 |
|
---|
92 | (* Symbol USE_GUIDS_IN_MMF :
|
---|
93 | -------------------------
|
---|
94 |
|
---|
95 | Defines whether to use GUIDs for temporary MMFs filename instead of
|
---|
96 | using the GetTempFilename in WinAPI. *)
|
---|
97 |
|
---|
98 | {-$DEFINE USE_GUIDS_IN_MMF}
|
---|
99 |
|
---|
100 |
|
---|
101 |
|
---|
102 | (* Symbol USEMOVE :
|
---|
103 | ----------------
|
---|
104 |
|
---|
105 | Defines whether to use Move instead of MoveLongword. *)
|
---|
106 |
|
---|
107 | {-$DEFINE USEMOVE}
|
---|
108 |
|
---|
109 |
|
---|
110 |
|
---|
111 | (* Symbol XPTHEMES :
|
---|
112 | -----------------
|
---|
113 |
|
---|
114 | Enable support for windows xp themes. Eventually undefine if GR32 should
|
---|
115 | be used within a DLL *)
|
---|
116 |
|
---|
117 | {$DEFINE XPTHEMES}
|
---|
118 |
|
---|
119 |
|
---|
120 |
|
---|
121 | (* Symbol USEMULTITHREADING :
|
---|
122 | --------------------------
|
---|
123 |
|
---|
124 | Use multithreading by default if possible. *)
|
---|
125 |
|
---|
126 | {-$DEFINE USEMULTITHREADING}
|
---|
127 |
|
---|
128 |
|
---|
129 |
|
---|
130 | (* FastCode specific symbols:
|
---|
131 | Adding these symbols to your project's define list will force use of the
|
---|
132 | particular routine over the standard GR32 routine.
|
---|
133 |
|
---|
134 | GR32_FASTCODEMOVE - Uses the patched Move routine rather than MoveLongword.
|
---|
135 |
|
---|
136 | For more information on the FastCode project take a look at this URL:
|
---|
137 | http://fastcode.sourceforge.net/
|
---|
138 |
|
---|
139 | For FastMove make sure to download the CPU id based function, ie. runtime
|
---|
140 | RTL patching.
|
---|
141 | *)
|
---|
142 |
|
---|
143 | {-$DEFINE GR32_FASTCODEMOVE}
|
---|
144 | {$IFDEF GR32_FASTCODEMOVE}
|
---|
145 | {$DEFINE USEMOVE}
|
---|
146 | {$ENDIF}
|
---|
147 |
|
---|
148 |
|
---|
149 |
|
---|
150 | (*
|
---|
151 | Symbol OMIT_MMX:
|
---|
152 | ----------------
|
---|
153 |
|
---|
154 | If defined MMX optimizations are not used (omitted)
|
---|
155 |
|
---|
156 | For faster pixel/color processing, MMX can be used which results in a huge
|
---|
157 | performance boost over PUREPASCAL code or native assembler code.
|
---|
158 | However, there's a penalty (a call to EMMS) when switching between FPU and
|
---|
159 | MMX registers. This call is not necessary when SSE2 is available. Though,
|
---|
160 | for backward compatibility it is necessary to call EMMS even if SSE2 is used.
|
---|
161 |
|
---|
162 | NOTE: On every x64 system SSE2 is available and thus MMX support is not
|
---|
163 | necessary. In fact it is problematic in case the Delphi XE2 compiler is used.
|
---|
164 | *)
|
---|
165 |
|
---|
166 | {-$DEFINE OMIT_MMX}
|
---|
167 | {$IFDEF TARGET_x64}
|
---|
168 | {$DEFINE OMIT_MMX}
|
---|
169 | {$ENDIF}
|
---|
170 |
|
---|
171 |
|
---|
172 | (*
|
---|
173 | Symbol OMIT_SSE2:
|
---|
174 | ----------------
|
---|
175 |
|
---|
176 | If defined SSE2 optimizations are not used (omitted)
|
---|
177 |
|
---|
178 | For faster pixel/color processing, SSE2 can be used which results in a huge
|
---|
179 | performance boost over PUREPASCAL code or native assembler code.
|
---|
180 |
|
---|
181 | *)
|
---|
182 |
|
---|
183 | {-$DEFINE OMIT_SSE2}
|
---|
184 |
|
---|
185 |
|
---|
186 | (*
|
---|
187 | Symbol: USEGR32GAMMA
|
---|
188 | --------------------
|
---|
189 |
|
---|
190 | If defined the polygon rasterizer will use the GR32 gamma correction LUT.
|
---|
191 |
|
---|
192 | Disable for a slight performance increase.
|
---|
193 | *)
|
---|
194 |
|
---|
195 | {$DEFINE USEGR32GAMMA}
|
---|
196 |
|
---|
197 |
|
---|
198 |
|
---|
199 | (*
|
---|
200 | Symbol: CHANGENOTIFICATIONS
|
---|
201 | ---------------------------
|
---|
202 |
|
---|
203 | If defined the polygon rasterizer will trigger change notifications.
|
---|
204 |
|
---|
205 | Undefining this will avoid bounding box computations, which may
|
---|
206 | improve performance slightly.
|
---|
207 | *)
|
---|
208 |
|
---|
209 | {$DEFINE CHANGENOTIFICATIONS}
|
---|
210 |
|
---|
211 |
|
---|
212 |
|
---|
213 | (*
|
---|
214 | Symbol: USESTACKALLOC
|
---|
215 | ---------------------
|
---|
216 |
|
---|
217 | If defined stack allocation routines will be used in some functions.
|
---|
218 |
|
---|
219 | Allocating memory on the stack is usually more efficient than using the
|
---|
220 | memory manager. If a routine uses StackAllock/StackFree then it should
|
---|
221 | always be wrapped inside a {$W+}...{$W-} block in order to generate
|
---|
222 | a stack frame.
|
---|
223 |
|
---|
224 | NOTE: Undefine this symbol if you get stack overflow errors.
|
---|
225 | *)
|
---|
226 |
|
---|
227 | {-$DEFINE USESTACKALLOC}
|
---|
228 |
|
---|
229 | (*
|
---|
230 | Symbol: RGBA_FORMAT
|
---|
231 | -------------------
|
---|
232 |
|
---|
233 | Assume RGBA pixel format instead of BGRA (used by e.g. OpenGL.)
|
---|
234 | *)
|
---|
235 |
|
---|
236 | {-$DEFINE RGBA_FORMAT}
|
---|
237 |
|
---|
238 | (*
|
---|
239 | Symbol: NOHINTING
|
---|
240 | -----------------
|
---|
241 |
|
---|
242 | Disables font hinting by default when using TextToPath() method.
|
---|
243 |
|
---|
244 | It is usually preferrable to disable hinting when using a high quality
|
---|
245 | polygon renderer like VPR. However, hinting can sometimes improve
|
---|
246 | visual quality when rendering small text (text is adjusted to pixel
|
---|
247 | boundaries which makes it more crisp.)
|
---|
248 | *)
|
---|
249 |
|
---|
250 | {$DEFINE NOHINTING}
|
---|
251 |
|
---|
252 |
|
---|
253 | (*
|
---|
254 | Symbol: NOHORIZONTALHINTING
|
---|
255 | ---------------------------
|
---|
256 |
|
---|
257 | Disables horizontal font hinting when using TextToPath() method.
|
---|
258 |
|
---|
259 | The following should not be used in conjunction with NOHINTING.
|
---|
260 | It will attempt to address the problem of extreme font hinting in the
|
---|
261 | GDI by disabling horizontal, but keeping vertical hinting.
|
---|
262 | *)
|
---|
263 |
|
---|
264 | {-$DEFINE NOHORIZONTALHINTING}
|
---|
265 |
|
---|
266 |
|
---|
267 | (*
|
---|
268 | Symbol: USEKERNING
|
---|
269 | -----------------
|
---|
270 |
|
---|
271 | Enables font kerning when using TextToPath() method.
|
---|
272 |
|
---|
273 | Kerning is the process of adjusting the spacing between characters in a
|
---|
274 | proportional font, usually to achieve a visually pleasing result. However,
|
---|
275 | parsing for kerning pairs is quite expensive in terms of CPU usage while the
|
---|
276 | effect is often very little. Thus kerning is not enabled by default.
|
---|
277 | *)
|
---|
278 |
|
---|
279 | {-$DEFINE USEKERNING}
|
---|
280 |
|
---|
281 |
|
---|
282 | {-$DEFINE TEST_BLENDMEMRGB128SSE4}
|
---|