SkUserConfig.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * Copyright 2006 The Android Open Source Project
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef SkUserConfig_DEFINED
  8. #define SkUserConfig_DEFINED
  9. /* SkTypes.h, the root of the public header files, does the following trick:
  10. #include "SkPreConfig.h"
  11. #include "SkUserConfig.h"
  12. #include "SkPostConfig.h"
  13. SkPreConfig.h runs first, and it is responsible for initializing certain
  14. skia defines.
  15. SkPostConfig.h runs last, and its job is to just check that the final
  16. defines are consistent (i.e. that we don't have mutually conflicting
  17. defines).
  18. SkUserConfig.h (this file) runs in the middle. It gets to change or augment
  19. the list of flags initially set in preconfig, and then postconfig checks
  20. that everything still makes sense.
  21. Below are optional defines that add, subtract, or change default behavior
  22. in Skia. Your port can locally edit this file to enable/disable flags as
  23. you choose, or these can be delared on your command line (i.e. -Dfoo).
  24. By default, this include file will always default to having all of the flags
  25. commented out, so including it will have no effect.
  26. */
  27. ///////////////////////////////////////////////////////////////////////////////
  28. /* Skia has lots of debug-only code. Often this is just null checks or other
  29. parameter checking, but sometimes it can be quite intrusive (e.g. check that
  30. each 32bit pixel is in premultiplied form). This code can be very useful
  31. during development, but will slow things down in a shipping product.
  32. By default, these mutually exclusive flags are defined in SkPreConfig.h,
  33. based on the presence or absence of NDEBUG, but that decision can be changed
  34. here.
  35. */
  36. //#define SK_DEBUG
  37. //#define SK_RELEASE
  38. /* Skia has certain debug-only code that is extremely intensive even for debug
  39. builds. This code is useful for diagnosing specific issues, but is not
  40. generally applicable, therefore it must be explicitly enabled to avoid
  41. the performance impact. By default these flags are undefined, but can be
  42. enabled by uncommenting them below.
  43. */
  44. //#define SK_DEBUG_GLYPH_CACHE
  45. //#define SK_DEBUG_PATH
  46. /* preconfig will have attempted to determine the endianness of the system,
  47. but you can change these mutually exclusive flags here.
  48. */
  49. //#define SK_CPU_BENDIAN
  50. //#define SK_CPU_LENDIAN
  51. /* Most compilers use the same bit endianness for bit flags in a byte as the
  52. system byte endianness, and this is the default. If for some reason this
  53. needs to be overridden, specify which of the mutually exclusive flags to
  54. use. For example, some atom processors in certain configurations have big
  55. endian byte order but little endian bit orders.
  56. */
  57. //#define SK_UINT8_BITFIELD_BENDIAN
  58. //#define SK_UINT8_BITFIELD_LENDIAN
  59. /* To write debug messages to a console, skia will call SkDebugf(...) following
  60. printf conventions (e.g. const char* format, ...). If you want to redirect
  61. this to something other than printf, define yours here
  62. */
  63. //#define SkDebugf(...) MyFunction(__VA_ARGS__)
  64. /*
  65. * To specify a different default font cache limit, define this. If this is
  66. * undefined, skia will use a built-in value.
  67. */
  68. //#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024)
  69. /*
  70. * To specify the default size of the image cache, undefine this and set it to
  71. * the desired value (in bytes). SkGraphics.h as a runtime API to set this
  72. * value as well. If this is undefined, a built-in value will be used.
  73. */
  74. //#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024)
  75. /* Define this to set the upper limit for text to support LCD. Values that
  76. are very large increase the cost in the font cache and draw slower, without
  77. improving readability. If this is undefined, Skia will use its default
  78. value (e.g. 48)
  79. */
  80. //#define SK_MAX_SIZE_FOR_LCDTEXT 48
  81. /* Change the ordering to work in X windows.
  82. */
  83. #ifdef SK_SAMPLES_FOR_X
  84. #define SK_R32_SHIFT 16
  85. #define SK_G32_SHIFT 8
  86. #define SK_B32_SHIFT 0
  87. #define SK_A32_SHIFT 24
  88. #endif
  89. /* Determines whether to build code that supports the GPU backend. Some classes
  90. that are not GPU-specific, such as SkShader subclasses, have optional code
  91. that is used allows them to interact with the GPU backend. If you'd like to
  92. omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu
  93. directories from your include search path when you're not building the GPU
  94. backend. Defaults to 1 (build the GPU code).
  95. */
  96. //#define SK_SUPPORT_GPU 1
  97. /* Skia makes use of histogram logging macros to trace the frequency of
  98. * events. By default, Skia provides no-op versions of these macros.
  99. * Skia consumers can provide their own definitions of these macros to
  100. * integrate with their histogram collection backend.
  101. */
  102. //#define SK_HISTOGRAM_BOOLEAN(name, value)
  103. //#define SK_HISTOGRAM_ENUMERATION(name, value, boundary_value)
  104. #endif