/cocos2dx/platform/third_party/blackberry/include/grskia/SkUserConfig.h

https://bitbucket.org/Tsiannian/cocos2d-x · C++ Header · 160 lines · 11 code · 28 blank · 121 comment · 0 complexity · ad04a8b7e3f0d2a5604601891c60fb02 MD5 · raw file

  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. #ifndef SkUserConfig_DEFINED
  17. #define SkUserConfig_DEFINED
  18. /* SkTypes.h, the root of the public header files, does the following trick:
  19. #include "SkPreConfig.h"
  20. #include "SkUserConfig.h"
  21. #include "SkPostConfig.h"
  22. SkPreConfig.h runs first, and it is responsible for initializing certain
  23. skia defines.
  24. SkPostConfig.h runs last, and its job is to just check that the final
  25. defines are consistent (i.e. that we don't have mutually conflicting
  26. defines).
  27. SkUserConfig.h (this file) runs in the middle. It gets to change or augment
  28. the list of flags initially set in preconfig, and then postconfig checks
  29. 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).
  33. By default, this include file will always default to having all of the flags
  34. commented out, so including it will have no effect.
  35. */
  36. ///////////////////////////////////////////////////////////////////////////////
  37. /* Scalars (the fractional value type in skia) can be implemented either as
  38. floats or 16.16 integers (fixed). Exactly one of these two symbols must be
  39. defined.
  40. */
  41. //#define SK_SCALAR_IS_FLOAT
  42. //#define SK_SCALAR_IS_FIXED
  43. /* Somewhat independent of how SkScalar is implemented, Skia also wants to know
  44. if it can use floats at all. Naturally, if SK_SCALAR_IS_FLOAT is defined,
  45. SK_CAN_USE_FLOAT must be too; but if scalars are fixed, SK_CAN_USE_FLOAT
  46. can go either way.
  47. */
  48. //#define SK_CAN_USE_FLOAT
  49. /* For some performance-critical scalar operations, skia will optionally work
  50. around the standard float operators if it knows that the CPU does not have
  51. native support for floats. If your environment uses software floating point,
  52. define this flag.
  53. */
  54. //#define SK_SOFTWARE_FLOAT
  55. /* Skia has lots of debug-only code. Often this is just null checks or other
  56. parameter checking, but sometimes it can be quite intrusive (e.g. check that
  57. each 32bit pixel is in premultiplied form). This code can be very useful
  58. during development, but will slow things down in a shipping product.
  59. By default, these mutually exclusive flags are defined in SkPreConfig.h,
  60. based on the presence or absence of NDEBUG, but that decision can be changed
  61. here.
  62. */
  63. //#define SK_DEBUG
  64. //#define SK_RELEASE
  65. /* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)
  66. it will call SK_CRASH(). If this is not defined it, it is defined in
  67. SkPostConfig.h to write to an illegal address
  68. */
  69. //#define SK_CRASH() *(int *)(uintptr_t)0 = 0
  70. /* preconfig will have attempted to determine the endianness of the system,
  71. but you can change these mutually exclusive flags here.
  72. */
  73. //#define SK_CPU_BENDIAN
  74. //#define SK_CPU_LENDIAN
  75. /* Some compilers don't support long long for 64bit integers. If yours does
  76. not, define this to the appropriate type.
  77. */
  78. //#define SkLONGLONG int64_t
  79. /* Some envorinments do not suport writable globals (eek!). If yours does not,
  80. define this flag.
  81. */
  82. //#define SK_USE_RUNTIME_GLOBALS
  83. /* To write debug messages to a console, skia will call SkDebugf(...) following
  84. printf conventions (e.g. const char* format, ...). If you want to redirect
  85. this to something other than printf, define yours here
  86. */
  87. //#define SkDebugf(...) MyFunction(__VA_ARGS__)
  88. /**
  89. * Used only for lcdtext, define this to pack glyphs using 8 bits per component
  90. * instead of 5-6-5. This can increase fidelity with the native font scaler,
  91. * but doubles the RAM used by the font cache.
  92. */
  93. //#define SK_SUPPORT_888_TEXT
  94. /* If defined, use CoreText instead of ATSUI on OS X.
  95. */
  96. //#define SK_USE_MAC_CORE_TEXT
  97. /* If zlib is available and you want to support the flate compression
  98. algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the
  99. include path.
  100. */
  101. //#define SK_ZLIB_INCLUDE <zlib.h>
  102. /* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow
  103. them, but modern PDF interpreters should handle them just fine.
  104. */
  105. //#define SK_ALLOW_LARGE_PDF_SCALARS
  106. /* Define this to remove dimension checks on bitmaps. Not all blits will be
  107. correct yet, so this is mostly for debugging the implementation.
  108. */
  109. //#define SK_ALLOW_OVER_32K_BITMAPS
  110. /* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST
  111. which will run additional self-tests at startup. These can take a long time,
  112. so this flag is optional.
  113. */
  114. #ifdef SK_DEBUG
  115. //#define SK_SUPPORT_UNITTEST
  116. #endif
  117. /* Change the ordering to work in X windows.
  118. */
  119. #ifdef SK_SAMPLES_FOR_X
  120. #define SK_R32_SHIFT 16
  121. #define SK_G32_SHIFT 8
  122. #define SK_B32_SHIFT 0
  123. #define SK_A32_SHIFT 24
  124. #endif
  125. #endif