Home | History | Annotate | Download | only in config
      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 
     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.
     36 
     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).
     40 
     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.
     43 */
     44 
     45 ///////////////////////////////////////////////////////////////////////////////
     46 
     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     SK_CAN_USE_FLOAT must be too; 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 
    115 /*  To enable additional blitters (and fontscaler code) to support separate
    116     alpha channels for R G B channels, define SK_SUPPORT_LCDTEXT
    117  */
    118 //#define SK_SUPPORT_LCDTEXT
    119 
    120 /*  If zlib is available and you want to support the flate compression
    121     algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the
    122     include path.
    123  */
    124 //#define SK_ZLIB_INCLUDE <zlib.h>
    125 
    126 /*  Define this to allow PDF scalars above 32k.  The PDF/A spec doesn't allow
    127     them, but modern PDF interpreters should handle them just fine.
    128  */
    129 //#define SK_ALLOW_LARGE_PDF_SCALARS
    130 
    131 /*  Define this to remove dimension checks on bitmaps. Not all blits will be
    132     correct yet, so this is mostly for debugging the implementation.
    133  */
    134 //#define SK_ALLOW_OVER_32K_BITMAPS
    135 
    136 /*  If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST
    137     which will run additional self-tests at startup. These can take a long time,
    138     so this flag is optional.
    139  */
    140 #ifdef SK_DEBUG
    141 //#define SK_SUPPORT_UNITTEST
    142 #endif
    143 
    144 /*  Change the ordering to work in X windows.
    145  */
    146 #ifdef SK_SAMPLES_FOR_X
    147         #define SK_R32_SHIFT    16
    148         #define SK_G32_SHIFT    8
    149         #define SK_B32_SHIFT    0
    150         #define SK_A32_SHIFT    24
    151 #endif
    152 
    153 #endif
    154