OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 template <typename T> const T& GrMin(const T& a, const T& b) { | 64 template <typename T> const T& GrMin(const T& a, const T& b) { |
65 return (a < b) ? a : b; | 65 return (a < b) ? a : b; |
66 } | 66 } |
67 | 67 |
68 template <typename T> const T& GrMax(const T& a, const T& b) { | 68 template <typename T> const T& GrMax(const T& a, const T& b) { |
69 return (b < a) ? a : b; | 69 return (b < a) ? a : b; |
70 } | 70 } |
71 | 71 |
72 /** | 72 /** |
73 * Count elements in an array | |
74 */ | |
75 #define GR_ARRAY_COUNT(array) SK_ARRAY_COUNT(array) | |
76 | |
77 /** | |
78 * 16.16 fixed point type | 73 * 16.16 fixed point type |
79 */ | 74 */ |
80 typedef int32_t GrFixed; | 75 typedef int32_t GrFixed; |
81 | 76 |
82 #ifdef SK_DEBUG | 77 #ifdef SK_DEBUG |
83 | 78 |
84 static inline int16_t GrToS16(intptr_t x) { | 79 static inline int16_t GrToS16(intptr_t x) { |
85 SkASSERT((int16_t)x == x); | 80 SkASSERT((int16_t)x == x); |
86 return (int16_t)x; | 81 return (int16_t)x; |
87 } | 82 } |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 public: | 715 public: |
721 GrAutoMalloc() : INHERITED() {} | 716 GrAutoMalloc() : INHERITED() {} |
722 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} | 717 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
723 virtual ~GrAutoMalloc() {} | 718 virtual ~GrAutoMalloc() {} |
724 private: | 719 private: |
725 typedef GrAutoMallocBaseType INHERITED; | 720 typedef GrAutoMallocBaseType INHERITED; |
726 }; | 721 }; |
727 | 722 |
728 #undef GrAutoMallocBaseType | 723 #undef GrAutoMallocBaseType |
729 #endif | 724 #endif |
OLD | NEW |