| 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 #ifndef GrTypes_DEFINED | 9 #ifndef GrTypes_DEFINED |
| 10 #define GrTypes_DEFINED | 10 #define GrTypes_DEFINED |
| 11 | 11 |
| 12 #include "SkTypes.h" | 12 #include "SkTypes.h" |
| 13 #include "GrConfig.h" | 13 #include "GrConfig.h" |
| 14 #include "SkMath.h" | 14 #include "SkMath.h" |
| 15 | 15 |
| 16 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * Defines overloaded bitwise operators to make it easier to use an enum as a | 19 * Defines overloaded bitwise operators to make it easier to use an enum as a |
| 20 * bitfield. | 20 * bitfield. |
| 21 */ | 21 */ |
| 22 #define GR_MAKE_BITFIELD_OPS(X) \ | 22 #define GR_MAKE_BITFIELD_OPS(X) \ |
| 23 inline X operator | (X a, X b) { \ | 23 inline X operator | (X a, X b) { \ |
| 24 return (X) (+a | +b); \ | 24 return (X) (+a | +b); \ |
| 25 } \ | 25 } \ |
| 26 inline X& operator |= (X& a, X b) { \ |
| 27 return (a = a | b); \ |
| 28 } \ |
| 26 \ | 29 \ |
| 27 inline X operator & (X a, X b) { \ | 30 inline X operator & (X a, X b) { \ |
| 28 return (X) (+a & +b); \ | 31 return (X) (+a & +b); \ |
| 29 } \ | 32 } \ |
| 30 template <typename T> \ | 33 template <typename T> \ |
| 31 inline X operator & (T a, X b) { \ | 34 inline X operator & (T a, X b) { \ |
| 32 return (X) (+a & +b); \ | 35 return (X) (+a & +b); \ |
| 33 } \ | 36 } \ |
| 34 template <typename T> \ | 37 template <typename T> \ |
| 35 inline X operator & (X a, T b) { \ | 38 inline X operator & (X a, T b) { \ |
| 36 return (X) (+a & +b); \ | 39 return (X) (+a & +b); \ |
| 37 } \ | 40 } \ |
| 38 | 41 |
| 39 #define GR_DECL_BITFIELD_OPS_FRIENDS(X) \ | 42 #define GR_DECL_BITFIELD_OPS_FRIENDS(X) \ |
| 40 friend X operator | (X a, X b); \ | 43 friend X operator | (X a, X b); \ |
| 44 friend X& operator |= (X& a, X b); \ |
| 41 \ | 45 \ |
| 42 friend X operator & (X a, X b); \ | 46 friend X operator & (X a, X b); \ |
| 43 \ | 47 \ |
| 44 template <typename T> \ | 48 template <typename T> \ |
| 45 friend X operator & (T a, X b); \ | 49 friend X operator & (T a, X b); \ |
| 46 \ | 50 \ |
| 47 template <typename T> \ | 51 template <typename T> \ |
| 48 friend X operator & (X a, T b); \ | 52 friend X operator & (X a, T b); \ |
| 49 //////////////////////////////////////////////////////////////////////////////// | 53 //////////////////////////////////////////////////////////////////////////////// |
| 50 | 54 |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 public: | 619 public: |
| 616 GrAutoMalloc() : INHERITED() {} | 620 GrAutoMalloc() : INHERITED() {} |
| 617 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} | 621 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
| 618 virtual ~GrAutoMalloc() {} | 622 virtual ~GrAutoMalloc() {} |
| 619 private: | 623 private: |
| 620 typedef GrAutoMallocBaseType INHERITED; | 624 typedef GrAutoMallocBaseType INHERITED; |
| 621 }; | 625 }; |
| 622 | 626 |
| 623 #undef GrAutoMallocBaseType | 627 #undef GrAutoMallocBaseType |
| 624 #endif | 628 #endif |
| OLD | NEW |