reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef SkUserConfig_DEFINED |
| 18 | #define SkUserConfig_DEFINED |
| 19 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 20 | /* SkTypes.h, the root of the public header files, does the following trick: |
| 21 | |
| 22 | #include "SkPreConfig.h" |
| 23 | #include "SkUserConfig.h" |
| 24 | #include "SkPostConfig.h" |
| 25 | |
| 26 | SkPreConfig.h runs first, and it is responsible for initializing certain |
| 27 | skia defines. |
| 28 | |
| 29 | SkPostConfig.h runs last, and its job is to just check that the final |
| 30 | defines are consistent (i.e. that we don't have mutually conflicting |
| 31 | defines). |
| 32 | |
| 33 | SkUserConfig.h (this file) runs in the middle. It gets to change or augment |
| 34 | the list of flags initially set in preconfig, and then postconfig checks |
| 35 | that everything still makes sense. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 36 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 37 | Below are optional defines that add, subtract, or change default behavior |
| 38 | in Skia. Your port can locally edit this file to enable/disable flags as |
| 39 | you choose, or these can be delared on your command line (i.e. -Dfoo). |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 40 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 41 | By default, this include file will always default to having all of the flags |
| 42 | commented out, so including it will have no effect. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 43 | */ |
| 44 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 45 | /////////////////////////////////////////////////////////////////////////////// |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 46 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 47 | /* Scalars (the fractional value type in skia) can be implemented either as |
| 48 | floats or 16.16 integers (fixed). Exactly one of these two symbols must be |
| 49 | defined. |
| 50 | */ |
| 51 | //#define SK_SCALAR_IS_FLOAT |
| 52 | //#define SK_SCALAR_IS_FIXED |
| 53 | |
| 54 | |
| 55 | /* Somewhat independent of how SkScalar is implemented, Skia also wants to know |
| 56 | if it can use floats at all. Naturally, if SK_SCALAR_IS_FLOAT is defined, |
| 57 | then so muse SK_CAN_USE_FLOAT, but if scalars are fixed, SK_CAN_USE_FLOAT |
| 58 | can go either way. |
| 59 | */ |
| 60 | //#define SK_CAN_USE_FLOAT |
| 61 | |
| 62 | /* For some performance-critical scalar operations, skia will optionally work |
| 63 | around the standard float operators if it knows that the CPU does not have |
| 64 | native support for floats. If your environment uses software floating point, |
| 65 | define this flag. |
| 66 | */ |
| 67 | //#define SK_SOFTWARE_FLOAT |
| 68 | |
| 69 | |
| 70 | /* Skia has lots of debug-only code. Often this is just null checks or other |
| 71 | parameter checking, but sometimes it can be quite intrusive (e.g. check that |
| 72 | each 32bit pixel is in premultiplied form). This code can be very useful |
| 73 | during development, but will slow things down in a shipping product. |
| 74 | |
| 75 | By default, these mutually exclusive flags are defined in SkPreConfig.h, |
| 76 | based on the presence or absence of NDEBUG, but that decision can be changed |
| 77 | here. |
| 78 | */ |
| 79 | //#define SK_DEBUG |
| 80 | //#define SK_RELEASE |
| 81 | |
| 82 | |
| 83 | /* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger) |
| 84 | it will call SK_CRASH(). If this is not defined it, it is defined in |
| 85 | SkPostConfig.h to write to an illegal address |
| 86 | */ |
| 87 | //#define SK_CRASH() *(int *)(uintptr_t)0 = 0 |
| 88 | |
| 89 | |
| 90 | /* preconfig will have attempted to determine the endianness of the system, |
| 91 | but you can change these mutually exclusive flags here. |
| 92 | */ |
| 93 | //#define SK_CPU_BENDIAN |
| 94 | //#define SK_CPU_LENDIAN |
| 95 | |
| 96 | |
| 97 | /* Some compilers don't support long long for 64bit integers. If yours does |
| 98 | not, define this to the appropriate type. |
| 99 | */ |
| 100 | //#define SkLONGLONG int64_t |
| 101 | |
| 102 | |
| 103 | /* Some envorinments do not suport writable globals (eek!). If yours does not, |
| 104 | define this flag. |
| 105 | */ |
| 106 | //#define SK_USE_RUNTIME_GLOBALS |
| 107 | |
| 108 | |
| 109 | /* To write debug messages to a console, skia will call SkDebugf(...) following |
| 110 | printf conventions (e.g. const char* format, ...). If you want to redirect |
| 111 | this to something other than printf, define yours here |
| 112 | */ |
| 113 | //#define SkDebugf(...) MyFunction(__VA_ARGS__) |
| 114 | |
reed@android.com | f549369 | 2009-07-22 19:21:01 +0000 | [diff] [blame] | 115 | /* To enable additional blitters (and fontscaler code) to support separate |
| 116 | alpha channels for R G B channels, define SK_SUPPORT_LCDTEXT |
| 117 | */ |
reed@android.com | 36a4c2a | 2009-07-22 19:52:11 +0000 | [diff] [blame] | 118 | //#define SK_SUPPORT_LCDTEXT |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 119 | |
| 120 | /* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST |
| 121 | which will run additional self-tests at startup. These can take a long time, |
| 122 | so this flag is optional. |
| 123 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 124 | #ifdef SK_DEBUG |
reed@android.com | 0f0cfae | 2009-10-13 13:33:16 +0000 | [diff] [blame^] | 125 | //#define SK_SUPPORT_UNITTEST |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 126 | #endif |
| 127 | |
| 128 | #endif |
| 129 | |