| Index: include/gpu/GrTypes.h
|
| diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
|
| index 0bb432d663c51eda8bfa7a91c2a2fa33e52f2827..c1b3554c6e008eb322d18838618a53cbeeb54495 100644
|
| --- a/include/gpu/GrTypes.h
|
| +++ b/include/gpu/GrTypes.h
|
| @@ -15,6 +15,8 @@
|
| #include "GrConfig.h"
|
| #include "SkMath.h"
|
|
|
| +//#define SK_SUPPORT_LEGACY_GRTYPES
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|
| /**
|
| @@ -50,6 +52,7 @@
|
| friend X operator & (X a, T b); \
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|
| +#ifdef SK_SUPPORT_LEGACY_GRTYPES
|
|
|
| /**
|
| * Macro to round n up to the next multiple of 4, or return it unchanged if
|
| @@ -66,6 +69,31 @@ template <typename T> const T& GrMax(const T& a, const T& b) {
|
| return (b < a) ? a : b;
|
| }
|
|
|
| +/**
|
| + * Count elements in an array
|
| + */
|
| +#define GR_ARRAY_COUNT(array) SK_ARRAY_COUNT(array)
|
| +
|
| +/**
|
| + * 16.16 fixed point type
|
| + */
|
| +typedef int32_t GrFixed;
|
| +
|
| +#ifdef SK_DEBUG
|
| +
|
| +static inline int16_t GrToS16(intptr_t x) {
|
| + SkASSERT((int16_t)x == x);
|
| + return (int16_t)x;
|
| +}
|
| +
|
| +#else
|
| +
|
| +#define GrToS16(x) x
|
| +
|
| +#endif
|
| +
|
| +#endif
|
| +
|
| // compile time versions of min/max
|
| #define GR_CT_MAX(a, b) (((b) < (a)) ? (a) : (b))
|
| #define GR_CT_MIN(a, b) (((b) < (a)) ? (b) : (a))
|
| @@ -120,11 +148,6 @@ static inline size_t GrSizeAlignDown(size_t x, uint32_t alignment) {
|
| return (x / alignment) * alignment;
|
| }
|
|
|
| -/**
|
| - * Count elements in an array
|
| - */
|
| -#define GR_ARRAY_COUNT(array) SK_ARRAY_COUNT(array)
|
| -
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| /**
|
| @@ -149,27 +172,6 @@ static inline int GrNextPow2(int n) {
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| /**
|
| - * 16.16 fixed point type
|
| - */
|
| -typedef int32_t GrFixed;
|
| -
|
| -#ifdef SK_DEBUG
|
| -
|
| -static inline int16_t GrToS16(intptr_t x) {
|
| - SkASSERT((int16_t)x == x);
|
| - return (int16_t)x;
|
| -}
|
| -
|
| -#else
|
| -
|
| -#define GrToS16(x) x
|
| -
|
| -#endif
|
| -
|
| -
|
| -///////////////////////////////////////////////////////////////////////////////
|
| -
|
| -/**
|
| * Possible 3D APIs that may be used by Ganesh.
|
| */
|
| enum GrBackend {
|
|
|