blob: d8662ae19cc3b0f157aa51ce5888a3f3edeac9e0 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Skia: /Volumes/disk/skia/trunk/include/config/SkUserConfig.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<h1>/Volumes/disk/skia/trunk/include/config/SkUserConfig.h</h1><a href="_sk_user_config_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2006 The Android Open Source Project</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment"> */</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef SkUserConfig_DEFINED</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define SkUserConfig_DEFINED</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="comment">/* SkTypes.h, the root of the public header files, does the following trick:</span>
<a name="l00021"></a>00021 <span class="comment"> </span>
<a name="l00022"></a>00022 <span class="comment"> #include &quot;SkPreConfig.h&quot;</span>
<a name="l00023"></a>00023 <span class="comment"> #include &quot;SkUserConfig.h&quot;</span>
<a name="l00024"></a>00024 <span class="comment"> #include &quot;SkPostConfig.h&quot;</span>
<a name="l00025"></a>00025 <span class="comment"> </span>
<a name="l00026"></a>00026 <span class="comment"> SkPreConfig.h runs first, and it is responsible for initializing certain</span>
<a name="l00027"></a>00027 <span class="comment"> skia defines.</span>
<a name="l00028"></a>00028 <span class="comment"> </span>
<a name="l00029"></a>00029 <span class="comment"> SkPostConfig.h runs last, and its job is to just check that the final</span>
<a name="l00030"></a>00030 <span class="comment"> defines are consistent (i.e. that we don&apos;t have mutually conflicting</span>
<a name="l00031"></a>00031 <span class="comment"> defines).</span>
<a name="l00032"></a>00032 <span class="comment"> </span>
<a name="l00033"></a>00033 <span class="comment"> SkUserConfig.h (this file) runs in the middle. It gets to change or augment</span>
<a name="l00034"></a>00034 <span class="comment"> the list of flags initially set in preconfig, and then postconfig checks</span>
<a name="l00035"></a>00035 <span class="comment"> that everything still makes sense.</span>
<a name="l00036"></a>00036 <span class="comment"></span>
<a name="l00037"></a>00037 <span class="comment"> Below are optional defines that add, subtract, or change default behavior</span>
<a name="l00038"></a>00038 <span class="comment"> in Skia. Your port can locally edit this file to enable/disable flags as</span>
<a name="l00039"></a>00039 <span class="comment"> you choose, or these can be delared on your command line (i.e. -Dfoo).</span>
<a name="l00040"></a>00040 <span class="comment"></span>
<a name="l00041"></a>00041 <span class="comment"> By default, this include file will always default to having all of the flags</span>
<a name="l00042"></a>00042 <span class="comment"> commented out, so including it will have no effect.</span>
<a name="l00043"></a>00043 <span class="comment">*/</span>
<a name="l00044"></a>00044
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="comment">/* Scalars (the fractional value type in skia) can be implemented either as</span>
<a name="l00048"></a>00048 <span class="comment"> floats or 16.16 integers (fixed). Exactly one of these two symbols must be</span>
<a name="l00049"></a>00049 <span class="comment"> defined.</span>
<a name="l00050"></a>00050 <span class="comment">*/</span>
<a name="l00051"></a>00051 <span class="comment">//#define SK_SCALAR_IS_FLOAT</span>
<a name="l00052"></a>00052 <span class="comment">//#define SK_SCALAR_IS_FIXED</span>
<a name="l00053"></a>00053
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="comment">/* Somewhat independent of how SkScalar is implemented, Skia also wants to know</span>
<a name="l00056"></a>00056 <span class="comment"> if it can use floats at all. Naturally, if SK_SCALAR_IS_FLOAT is defined,</span>
<a name="l00057"></a>00057 <span class="comment"> then so muse SK_CAN_USE_FLOAT, but if scalars are fixed, SK_CAN_USE_FLOAT</span>
<a name="l00058"></a>00058 <span class="comment"> can go either way.</span>
<a name="l00059"></a>00059 <span class="comment"> */</span>
<a name="l00060"></a>00060 <span class="comment">//#define SK_CAN_USE_FLOAT</span>
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <span class="comment">/* For some performance-critical scalar operations, skia will optionally work</span>
<a name="l00063"></a>00063 <span class="comment"> around the standard float operators if it knows that the CPU does not have</span>
<a name="l00064"></a>00064 <span class="comment"> native support for floats. If your environment uses software floating point,</span>
<a name="l00065"></a>00065 <span class="comment"> define this flag.</span>
<a name="l00066"></a>00066 <span class="comment"> */</span>
<a name="l00067"></a>00067 <span class="comment">//#define SK_SOFTWARE_FLOAT</span>
<a name="l00068"></a>00068
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="comment">/* Skia has lots of debug-only code. Often this is just null checks or other</span>
<a name="l00071"></a>00071 <span class="comment"> parameter checking, but sometimes it can be quite intrusive (e.g. check that</span>
<a name="l00072"></a>00072 <span class="comment"> each 32bit pixel is in premultiplied form). This code can be very useful</span>
<a name="l00073"></a>00073 <span class="comment"> during development, but will slow things down in a shipping product.</span>
<a name="l00074"></a>00074 <span class="comment"> </span>
<a name="l00075"></a>00075 <span class="comment"> By default, these mutually exclusive flags are defined in SkPreConfig.h,</span>
<a name="l00076"></a>00076 <span class="comment"> based on the presence or absence of NDEBUG, but that decision can be changed</span>
<a name="l00077"></a>00077 <span class="comment"> here.</span>
<a name="l00078"></a>00078 <span class="comment"> */</span>
<a name="l00079"></a>00079 <span class="comment">//#define SK_DEBUG</span>
<a name="l00080"></a>00080 <span class="comment">//#define SK_RELEASE</span>
<a name="l00081"></a>00081
<a name="l00082"></a>00082
<a name="l00083"></a>00083 <span class="comment">/* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)</span>
<a name="l00084"></a>00084 <span class="comment"> it will call SK_CRASH(). If this is not defined it, it is defined in</span>
<a name="l00085"></a>00085 <span class="comment"> SkPostConfig.h to write to an illegal address</span>
<a name="l00086"></a>00086 <span class="comment"> */</span>
<a name="l00087"></a>00087 <span class="comment">//#define SK_CRASH() *(int *)(uintptr_t)0 = 0</span>
<a name="l00088"></a>00088
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <span class="comment">/* preconfig will have attempted to determine the endianness of the system,</span>
<a name="l00091"></a>00091 <span class="comment"> but you can change these mutually exclusive flags here.</span>
<a name="l00092"></a>00092 <span class="comment"> */</span>
<a name="l00093"></a>00093 <span class="comment">//#define SK_CPU_BENDIAN</span>
<a name="l00094"></a>00094 <span class="comment">//#define SK_CPU_LENDIAN</span>
<a name="l00095"></a>00095
<a name="l00096"></a>00096
<a name="l00097"></a>00097 <span class="comment">/* Some compilers don&apos;t support long long for 64bit integers. If yours does</span>
<a name="l00098"></a>00098 <span class="comment"> not, define this to the appropriate type.</span>
<a name="l00099"></a>00099 <span class="comment"> */</span>
<a name="l00100"></a>00100 <span class="comment">//#define SkLONGLONG int64_t</span>
<a name="l00101"></a>00101
<a name="l00102"></a>00102
<a name="l00103"></a>00103 <span class="comment">/* Some envorinments do not suport writable globals (eek!). If yours does not,</span>
<a name="l00104"></a>00104 <span class="comment"> define this flag.</span>
<a name="l00105"></a>00105 <span class="comment"> */</span>
<a name="l00106"></a>00106 <span class="comment">//#define SK_USE_RUNTIME_GLOBALS</span>
<a name="l00107"></a>00107
<a name="l00108"></a>00108
<a name="l00109"></a>00109 <span class="comment">/* To write debug messages to a console, skia will call SkDebugf(...) following</span>
<a name="l00110"></a>00110 <span class="comment"> printf conventions (e.g. const char* format, ...). If you want to redirect</span>
<a name="l00111"></a>00111 <span class="comment"> this to something other than printf, define yours here</span>
<a name="l00112"></a>00112 <span class="comment"> */</span>
<a name="l00113"></a>00113 <span class="comment">//#define SkDebugf(...) MyFunction(__VA_ARGS__)</span>
<a name="l00114"></a>00114
<a name="l00115"></a>00115 <span class="comment">/* To enable additional blitters (and fontscaler code) to support separate</span>
<a name="l00116"></a>00116 <span class="comment"> alpha channels for R G B channels, define SK_SUPPORT_LCDTEXT</span>
<a name="l00117"></a>00117 <span class="comment"> */</span>
<a name="l00118"></a>00118 <span class="comment">//#define SK_SUPPORT_LCDTEXT</span>
<a name="l00119"></a>00119
<a name="l00120"></a>00120 <span class="comment">/* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST</span>
<a name="l00121"></a>00121 <span class="comment"> which will run additional self-tests at startup. These can take a long time,</span>
<a name="l00122"></a>00122 <span class="comment"> so this flag is optional.</span>
<a name="l00123"></a>00123 <span class="comment"> */</span>
<a name="l00124"></a>00124 <span class="preprocessor">#ifdef SK_DEBUG</span>
<a name="l00125"></a>00125 <span class="preprocessor"></span><span class="comment">//#define SK_SUPPORT_UNITTEST</span>
<a name="l00126"></a>00126 <span class="preprocessor">#endif</span>
<a name="l00127"></a>00127 <span class="preprocessor"></span>
<a name="l00128"></a>00128 <span class="preprocessor">#endif</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Oct 20 10:32:59 2009 for Skia by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>