gfx/skia/trunk/include/config/SkUserConfig.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     2 /*
     3  * Copyright 2006 The Android Open Source Project
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef SkUserConfig_DEFINED
    11 #define SkUserConfig_DEFINED
    13 /*  SkTypes.h, the root of the public header files, does the following trick:
    15     #include "SkPreConfig.h"
    16     #include "SkUserConfig.h"
    17     #include "SkPostConfig.h"
    19     SkPreConfig.h runs first, and it is responsible for initializing certain
    20     skia defines.
    22     SkPostConfig.h runs last, and its job is to just check that the final
    23     defines are consistent (i.e. that we don't have mutually conflicting
    24     defines).
    26     SkUserConfig.h (this file) runs in the middle. It gets to change or augment
    27     the list of flags initially set in preconfig, and then postconfig checks
    28     that everything still makes sense.
    30     Below are optional defines that add, subtract, or change default behavior
    31     in Skia. Your port can locally edit this file to enable/disable flags as
    32     you choose, or these can be delared on your command line (i.e. -Dfoo).
    34     By default, this include file will always default to having all of the flags
    35     commented out, so including it will have no effect.
    36 */
    38 ///////////////////////////////////////////////////////////////////////////////
    40 /*  Skia has lots of debug-only code. Often this is just null checks or other
    41     parameter checking, but sometimes it can be quite intrusive (e.g. check that
    42     each 32bit pixel is in premultiplied form). This code can be very useful
    43     during development, but will slow things down in a shipping product.
    45     By default, these mutually exclusive flags are defined in SkPreConfig.h,
    46     based on the presence or absence of NDEBUG, but that decision can be changed
    47     here.
    48  */
    49 //#define SK_DEBUG
    50 //#define SK_RELEASE
    52 /*  Skia has certain debug-only code that is extremely intensive even for debug
    53     builds.  This code is useful for diagnosing specific issues, but is not
    54     generally applicable, therefore it must be explicitly enabled to avoid
    55     the performance impact. By default these flags are undefined, but can be
    56     enabled by uncommenting them below.
    57  */
    58 //#define SK_DEBUG_GLYPH_CACHE
    59 //#define SK_DEBUG_PATH
    61 /*  To assist debugging, Skia provides an instance counting utility in
    62     include/core/SkInstCount.h. This flag turns on and off that utility to
    63     allow instance count tracking in either debug or release builds. By
    64     default it is enabled in debug but disabled in release.
    65  */
    66 #define SK_ENABLE_INST_COUNT 0
    68 /*  If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)
    69     it will call SK_CRASH(). If this is not defined it, it is defined in
    70     SkPostConfig.h to write to an illegal address
    71  */
    72 //#define SK_CRASH() *(int *)(uintptr_t)0 = 0
    75 /*  preconfig will have attempted to determine the endianness of the system,
    76     but you can change these mutually exclusive flags here.
    77  */
    78 //#define SK_CPU_BENDIAN
    79 //#define SK_CPU_LENDIAN
    81 /*  Most compilers use the same bit endianness for bit flags in a byte as the
    82     system byte endianness, and this is the default. If for some reason this
    83     needs to be overridden, specify which of the mutually exclusive flags to
    84     use. For example, some atom processors in certain configurations have big
    85     endian byte order but little endian bit orders.
    86 */
    87 //#define SK_UINT8_BITFIELD_BENDIAN
    88 //#define SK_UINT8_BITFIELD_LENDIAN
    91 /*  To write debug messages to a console, skia will call SkDebugf(...) following
    92     printf conventions (e.g. const char* format, ...). If you want to redirect
    93     this to something other than printf, define yours here
    94  */
    95 //#define SkDebugf(...)  MyFunction(__VA_ARGS__)
    97 /*
    98  *  To specify a different default font cache limit, define this. If this is
    99  *  undefined, skia will use a built-in value.
   100  */
   101 //#define SK_DEFAULT_FONT_CACHE_LIMIT   (1024 * 1024)
   103 /*
   104  *  To specify the default size of the image cache, undefine this and set it to
   105  *  the desired value (in bytes). SkGraphics.h as a runtime API to set this
   106  *  value as well. If this is undefined, a built-in value will be used.
   107  */
   108 //#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024)
   110 /*  If zlib is available and you want to support the flate compression
   111     algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the
   112     include path. Alternatively, define SK_SYSTEM_ZLIB to use the system zlib
   113     library specified as "#include <zlib.h>".
   114  */
   115 //#define SK_ZLIB_INCLUDE <zlib.h>
   116 //#define SK_SYSTEM_ZLIB
   118 /*  Define this to allow PDF scalars above 32k.  The PDF/A spec doesn't allow
   119     them, but modern PDF interpreters should handle them just fine.
   120  */
   121 //#define SK_ALLOW_LARGE_PDF_SCALARS
   123 /*  Define this to provide font subsetter in PDF generation.
   124  */
   125 //#define SK_SFNTLY_SUBSETTER "sfntly/subsetter/font_subsetter.h"
   127 /*  Define this to set the upper limit for text to support LCD. Values that
   128     are very large increase the cost in the font cache and draw slower, without
   129     improving readability. If this is undefined, Skia will use its default
   130     value (e.g. 48)
   131  */
   132 //#define SK_MAX_SIZE_FOR_LCDTEXT     48
   134 /*  If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST
   135     which will run additional self-tests at startup. These can take a long time,
   136     so this flag is optional.
   137  */
   138 #ifdef SK_DEBUG
   139 //#define SK_SUPPORT_UNITTEST
   140 #endif
   142 /* If your system embeds skia and has complex event logging, define this
   143    symbol to name a file that maps the following macros to your system's
   144    equivalents:
   145        SK_TRACE_EVENT0(event)
   146        SK_TRACE_EVENT1(event, name1, value1)
   147        SK_TRACE_EVENT2(event, name1, value1, name2, value2)
   148    src/utils/SkDebugTrace.h has a trivial implementation that writes to
   149    the debug output stream. If SK_USER_TRACE_INCLUDE_FILE is not defined,
   150    SkTrace.h will define the above three macros to do nothing.
   151 */
   152 //#undef SK_USER_TRACE_INCLUDE_FILE
   154 /*  Change the ordering to work in X windows.
   155  */
   156 #ifdef SK_SAMPLES_FOR_X
   157         #define SK_R32_SHIFT    16
   158         #define SK_G32_SHIFT    8
   159         #define SK_B32_SHIFT    0
   160         #define SK_A32_SHIFT    24
   161 #endif
   164 /* Determines whether to build code that supports the GPU backend. Some classes
   165    that are not GPU-specific, such as SkShader subclasses, have optional code
   166    that is used allows them to interact with the GPU backend. If you'd like to
   167    omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu
   168    directories from your include search path when you're not building the GPU
   169    backend. Defaults to 1 (build the GPU code).
   170  */
   171 //#define SK_SUPPORT_GPU 1
   174 /* The PDF generation code uses Path Ops to generate inverse fills and complex
   175  * clipping paths, but at this time, Path Ops is not release ready yet. So,
   176  * the code is hidden behind this #define guard. If you are feeling adventurous
   177  * and want the latest and greatest PDF generation code, uncomment the #define.
   178  * When Path Ops is release ready, the define guards and this user config
   179  * define should be removed entirely.
   180  */
   181 //#define SK_PDF_USE_PATHOPS
   183 /* Skia uses these defines as the target of include preprocessor directives.
   184  * The header files pointed to by these defines provide declarations and
   185  * possibly inline implementations of threading primitives.
   186  *
   187  * See SkThread.h for documentation on what these includes must contain.
   188  */
   189 //#define SK_ATOMICS_PLATFORM_H "SkAtomics_xxx.h"
   190 //#define SK_MUTEX_PLATFORM_H "SkMutex_xxx.h"
   191 #  if defined(_MSC_VER)
   192 #    define SK_ATOMICS_PLATFORM_H "skia/SkAtomics_win.h"
   193 #  elif defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
   194 #    define SK_ATOMICS_PLATFORM_H "skia/SkAtomics_android.h"
   195 #  else
   196 #    define SK_ATOMICS_PLATFORM_H "skia/SkAtomics_sync.h"
   197 #  endif
   199 #  if defined(SK_BUILD_FOR_WIN32)
   200 #    define SK_MUTEX_PLATFORM_H "skia/SkMutex_win.h"
   201 #  else
   202 #    define SK_MUTEX_PLATFORM_H "skia/SkMutex_pthread.h"
   203 #  endif
   204 #endif
   206 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0
   208 #define SK_SUPPORT_LEGACY_LAYERRASTERIZER_API 1
   209 #define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG 1
   210 #define SK_SUPPORT_LEGACY_GETTOTALCLIP 1

mercurial