00001 /* 00002 * Copyright (C) 2006 The Android Open Source Project 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef SkUserConfig_DEFINED 00018 #define SkUserConfig_DEFINED 00019 00020 /* SkTypes.h, the root of the public header files, does the following trick: 00021 00022 #include "SkPreConfig.h" 00023 #include "SkUserConfig.h" 00024 #include "SkPostConfig.h" 00025 00026 SkPreConfig.h runs first, and it is responsible for initializing certain 00027 skia defines. 00028 00029 SkPostConfig.h runs last, and its job is to just check that the final 00030 defines are consistent (i.e. that we don't have mutually conflicting 00031 defines). 00032 00033 SkUserConfig.h (this file) runs in the middle. It gets to change or augment 00034 the list of flags initially set in preconfig, and then postconfig checks 00035 that everything still makes sense. 00036 00037 Below are optional defines that add, subtract, or change default behavior 00038 in Skia. Your port can locally edit this file to enable/disable flags as 00039 you choose, or these can be delared on your command line (i.e. -Dfoo). 00040 00041 By default, this include file will always default to having all of the flags 00042 commented out, so including it will have no effect. 00043 */ 00044 00046 00047 /* Scalars (the fractional value type in skia) can be implemented either as 00048 floats or 16.16 integers (fixed). Exactly one of these two symbols must be 00049 defined. 00050 */ 00051 //#define SK_SCALAR_IS_FLOAT 00052 //#define SK_SCALAR_IS_FIXED 00053 00054 00055 /* Somewhat independent of how SkScalar is implemented, Skia also wants to know 00056 if it can use floats at all. Naturally, if SK_SCALAR_IS_FLOAT is defined, 00057 then so muse SK_CAN_USE_FLOAT, but if scalars are fixed, SK_CAN_USE_FLOAT 00058 can go either way. 00059 */ 00060 //#define SK_CAN_USE_FLOAT 00061 00062 /* For some performance-critical scalar operations, skia will optionally work 00063 around the standard float operators if it knows that the CPU does not have 00064 native support for floats. If your environment uses software floating point, 00065 define this flag. 00066 */ 00067 //#define SK_SOFTWARE_FLOAT 00068 00069 00070 /* Skia has lots of debug-only code. Often this is just null checks or other 00071 parameter checking, but sometimes it can be quite intrusive (e.g. check that 00072 each 32bit pixel is in premultiplied form). This code can be very useful 00073 during development, but will slow things down in a shipping product. 00074 00075 By default, these mutually exclusive flags are defined in SkPreConfig.h, 00076 based on the presence or absence of NDEBUG, but that decision can be changed 00077 here. 00078 */ 00079 //#define SK_DEBUG 00080 //#define SK_RELEASE 00081 00082 00083 /* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger) 00084 it will call SK_CRASH(). If this is not defined it, it is defined in 00085 SkPostConfig.h to write to an illegal address 00086 */ 00087 //#define SK_CRASH() *(int *)(uintptr_t)0 = 0 00088 00089 00090 /* preconfig will have attempted to determine the endianness of the system, 00091 but you can change these mutually exclusive flags here. 00092 */ 00093 //#define SK_CPU_BENDIAN 00094 //#define SK_CPU_LENDIAN 00095 00096 00097 /* Some compilers don't support long long for 64bit integers. If yours does 00098 not, define this to the appropriate type. 00099 */ 00100 //#define SkLONGLONG int64_t 00101 00102 00103 /* Some envorinments do not suport writable globals (eek!). If yours does not, 00104 define this flag. 00105 */ 00106 //#define SK_USE_RUNTIME_GLOBALS 00107 00108 00109 /* To write debug messages to a console, skia will call SkDebugf(...) following 00110 printf conventions (e.g. const char* format, ...). If you want to redirect 00111 this to something other than printf, define yours here 00112 */ 00113 //#define SkDebugf(...) MyFunction(__VA_ARGS__) 00114 00115 /* To enable additional blitters (and fontscaler code) to support separate 00116 alpha channels for R G B channels, define SK_SUPPORT_LCDTEXT 00117 */ 00118 //#define SK_SUPPORT_LCDTEXT 00119 00120 /* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST 00121 which will run additional self-tests at startup. These can take a long time, 00122 so this flag is optional. 00123 */ 00124 #ifdef SK_DEBUG 00125 //#define SK_SUPPORT_UNITTEST 00126 #endif 00127 00128 #endif 00129