OLD | NEW |
1 | 1 |
2 | 2 |
3 /* | 3 /* |
4 * Copyright 2006 The Android Open Source Project | 4 * Copyright 2006 The Android Open Source Project |
5 * | 5 * |
6 * Use of this source code is governed by a BSD-style license that can be | 6 * Use of this source code is governed by a BSD-style license that can be |
7 * found in the LICENSE file. | 7 * found in the LICENSE file. |
8 */ | 8 */ |
9 | 9 |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 */ | 49 */ |
50 | 50 |
51 class SK_API SkPaint { | 51 class SK_API SkPaint { |
52 public: | 52 public: |
53 SkPaint(); | 53 SkPaint(); |
54 SkPaint(const SkPaint& paint); | 54 SkPaint(const SkPaint& paint); |
55 ~SkPaint(); | 55 ~SkPaint(); |
56 | 56 |
57 SkPaint& operator=(const SkPaint&); | 57 SkPaint& operator=(const SkPaint&); |
58 | 58 |
| 59 /** operator== may give false negatives: two paints that draw equivalently |
| 60 may return false. It will never give false positives: two paints that |
| 61 are not equivalent always return false. |
| 62 */ |
59 SK_API friend bool operator==(const SkPaint& a, const SkPaint& b); | 63 SK_API friend bool operator==(const SkPaint& a, const SkPaint& b); |
60 friend bool operator!=(const SkPaint& a, const SkPaint& b) { | 64 friend bool operator!=(const SkPaint& a, const SkPaint& b) { |
61 return !(a == b); | 65 return !(a == b); |
62 } | 66 } |
63 | 67 |
64 void flatten(SkWriteBuffer&) const; | 68 void flatten(SkWriteBuffer&) const; |
65 void unflatten(SkReadBuffer&); | 69 void unflatten(SkReadBuffer&); |
66 | 70 |
67 /** Restores the paint to its initial settings. | 71 /** Restores the paint to its initial settings. |
68 */ | 72 */ |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 friend class SkCanonicalizePaint; | 1134 friend class SkCanonicalizePaint; |
1131 | 1135 |
1132 #ifdef SK_BUILD_FOR_ANDROID | 1136 #ifdef SK_BUILD_FOR_ANDROID |
1133 // In order for the == operator to work properly this must be the last field | 1137 // In order for the == operator to work properly this must be the last field |
1134 // in the struct so that we can do a memcmp to this field's offset. | 1138 // in the struct so that we can do a memcmp to this field's offset. |
1135 uint32_t fGenerationID; | 1139 uint32_t fGenerationID; |
1136 #endif | 1140 #endif |
1137 }; | 1141 }; |
1138 | 1142 |
1139 #endif | 1143 #endif |
OLD | NEW |