SkUserConfig.h 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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, includes SkPreConfig.h,
  10. then SkUserConfig.h, then SkPostConfig.h.
  11. SkPreConfig.h runs first, and it is responsible for initializing certain
  12. skia defines.
  13. SkPostConfig.h runs last, and its job is to just check that the final
  14. defines are consistent (i.e. that we don't have mutually conflicting
  15. defines).
  16. SkUserConfig.h (this file) runs in the middle. It gets to change or augment
  17. the list of flags initially set in preconfig, and then postconfig checks
  18. that everything still makes sense.
  19. Below are optional defines that add, subtract, or change default behavior
  20. in Skia. Your port can locally edit this file to enable/disable flags as
  21. you choose, or these can be delared on your command line (i.e. -Dfoo).
  22. By default, this include file will always default to having all of the flags
  23. commented out, so including it will have no effect.
  24. */
  25. ///////////////////////////////////////////////////////////////////////////////
  26. /* Skia has lots of debug-only code. Often this is just null checks or other
  27. parameter checking, but sometimes it can be quite intrusive (e.g. check that
  28. each 32bit pixel is in premultiplied form). This code can be very useful
  29. during development, but will slow things down in a shipping product.
  30. By default, these mutually exclusive flags are defined in SkPreConfig.h,
  31. based on the presence or absence of NDEBUG, but that decision can be changed
  32. here.
  33. */
  34. //#define SK_DEBUG
  35. //#define SK_RELEASE
  36. /* To write debug messages to a console, skia will call SkDebugf(...) following
  37. printf conventions (e.g. const char* format, ...). If you want to redirect
  38. this to something other than printf, define yours here
  39. */
  40. //#define SkDebugf(...) MyFunction(__VA_ARGS__)
  41. /*
  42. * To specify a different default font cache limit, define this. If this is
  43. * undefined, skia will use a built-in value.
  44. */
  45. //#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024)
  46. /*
  47. * To specify the default size of the image cache, undefine this and set it to
  48. * the desired value (in bytes). SkGraphics.h as a runtime API to set this
  49. * value as well. If this is undefined, a built-in value will be used.
  50. */
  51. //#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024)
  52. /* Define this to set the upper limit for text to support LCD. Values that
  53. are very large increase the cost in the font cache and draw slower, without
  54. improving readability. If this is undefined, Skia will use its default
  55. value (e.g. 48)
  56. */
  57. //#define SK_MAX_SIZE_FOR_LCDTEXT 48
  58. /* Change the kN32_SkColorType ordering to BGRA to work in X windows.
  59. */
  60. //#define SK_R32_SHIFT 16
  61. /* Determines whether to build code that supports the GPU backend. Some classes
  62. that are not GPU-specific, such as SkShader subclasses, have optional code
  63. that is used allows them to interact with the GPU backend. If you'd like to
  64. omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu
  65. directories from your include search path when you're not building the GPU
  66. backend. Defaults to 1 (build the GPU code).
  67. */
  68. //#define SK_SUPPORT_GPU 1
  69. /* Skia makes use of histogram logging macros to trace the frequency of
  70. * events. By default, Skia provides no-op versions of these macros.
  71. * Skia consumers can provide their own definitions of these macros to
  72. * integrate with their histogram collection backend.
  73. */
  74. //#define SK_HISTOGRAM_BOOLEAN(name, value)
  75. //#define SK_HISTOGRAM_ENUMERATION(name, value, boundary_value)
  76. #endif