OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 #ifndef SkTDArray_Experimental_DEFINED | 10 #ifndef SkTDArray_Experimental_DEFINED |
11 #define SkTDArray_Experimental_DEFINED | 11 #define SkTDArray_Experimental_DEFINED |
12 | 12 |
13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
14 | 14 |
15 #ifdef SK_BUILD_FOR_UNIX | 15 #ifdef SK_BUILD_FOR_UNIX |
16 #define SK_BUILD_FOR_ADS_12 | 16 #define SK_BUILD_FOR_ADS_12 |
17 #endif | 17 #endif |
18 | 18 |
19 #ifndef SK_BUILD_FOR_ADS_12 | 19 #if !defined(SK_BUILD_FOR_ADS_12) && !defined(__x86_64__) |
20 #define SK_SMALLER_ARRAY_TEMPLATE_EXPERIMENT 1 | 20 #define SK_SMALLER_ARRAY_TEMPLATE_EXPERIMENT 1 |
21 #else | 21 #else |
22 #define SK_SMALLER_ARRAY_TEMPLATE_EXPERIMENT 0 | 22 #define SK_SMALLER_ARRAY_TEMPLATE_EXPERIMENT 0 |
23 #endif | 23 #endif |
24 | 24 |
25 #if SK_SMALLER_ARRAY_TEMPLATE_EXPERIMENT == 0 | 25 #if SK_SMALLER_ARRAY_TEMPLATE_EXPERIMENT == 0 |
26 #include "SkTDArray.h" | 26 #include "SkTDArray.h" |
27 #define SkIntArray(type) SkTDArray<type> | 27 #define SkIntArray(type) SkTDArray<type> |
28 #define SkLongArray(type) SkTDArray<type> | 28 #define SkLongArray(type) SkTDArray<type> |
29 #else | 29 #else |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 T& top() { return (*this)[fCount - 1]; } | 128 T& top() { return (*this)[fCount - 1]; } |
129 void pop(T* elem) { if (elem) *elem = (*this)[fCount - 1]; --fCount;
} | 129 void pop(T* elem) { if (elem) *elem = (*this)[fCount - 1]; --fCount;
} |
130 void pop() { --fCount; } | 130 void pop() { --fCount; } |
131 private: | 131 private: |
132 #ifdef SK_DEBUG | 132 #ifdef SK_DEBUG |
133 mutable T(* fTData)[kDebugArraySize]; | 133 mutable T(* fTData)[kDebugArraySize]; |
134 #endif | 134 #endif |
135 }; | 135 }; |
136 | 136 |
137 #define SkIntArray(type) SkTDS32Array<type> // holds 32 bit data types | 137 #define SkIntArray(type) SkTDS32Array<type> // holds 32 bit data types |
138 #define SkLongArray(type) SkTDS32Array<type> // holds 32/64 bit data types de
pending on pointer size | 138 #define SkLongArray(type) SkTDS32Array<type> |
139 | 139 |
140 #endif // SK_SMALLER_ARRAY_TEMPLATE_EXPERIMENT | 140 #endif // SK_SMALLER_ARRAY_TEMPLATE_EXPERIMENT |
141 | 141 |
142 #endif // SkTDArray_Experimental_DEFINED | 142 #endif // SkTDArray_Experimental_DEFINED |
OLD | NEW |