Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: include/gpu/GrTypes.h

Issue 216503004: SK_SUPPORT_LEGACY_GRTYPES to hide duplicate types from SkTypes.h (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {
« include/gpu/GrPoint.h ('K') | « include/gpu/GrTexture.h ('k') | include/gpu/GrTypesPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698