OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkPaint_DEFINED | 8 #ifndef SkPaint_DEFINED |
9 #define SkPaint_DEFINED | 9 #define SkPaint_DEFINED |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 /** operator== may give false negatives: two paints that draw equivalently | 56 /** operator== may give false negatives: two paints that draw equivalently |
57 may return false. It will never give false positives: two paints that | 57 may return false. It will never give false positives: two paints that |
58 are not equivalent always return false. | 58 are not equivalent always return false. |
59 */ | 59 */ |
60 SK_API friend bool operator==(const SkPaint& a, const SkPaint& b); | 60 SK_API friend bool operator==(const SkPaint& a, const SkPaint& b); |
61 friend bool operator!=(const SkPaint& a, const SkPaint& b) { | 61 friend bool operator!=(const SkPaint& a, const SkPaint& b) { |
62 return !(a == b); | 62 return !(a == b); |
63 } | 63 } |
64 | 64 |
| 65 /** getHash() is a shallow hash, with the same limitations as operator==. |
| 66 * If operator== returns true for two paints, getHash() returns the same va
lue for each. |
| 67 */ |
| 68 uint32_t getHash() const; |
| 69 |
65 void flatten(SkWriteBuffer&) const; | 70 void flatten(SkWriteBuffer&) const; |
66 void unflatten(SkReadBuffer&); | 71 void unflatten(SkReadBuffer&); |
67 | 72 |
68 /** Restores the paint to its initial settings. | 73 /** Restores the paint to its initial settings. |
69 */ | 74 */ |
70 void reset(); | 75 void reset(); |
71 | 76 |
72 /** Specifies the level of hinting to be performed. These names are taken | 77 /** Specifies the level of hinting to be performed. These names are taken |
73 from the Gnome/Cairo names for the same. They are translated into | 78 from the Gnome/Cairo names for the same. They are translated into |
74 Freetype concepts the same as in cairo-ft-font.c: | 79 Freetype concepts the same as in cairo-ft-font.c: |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 friend class SkCanonicalizePaint; | 1111 friend class SkCanonicalizePaint; |
1107 | 1112 |
1108 #ifdef SK_BUILD_FOR_ANDROID | 1113 #ifdef SK_BUILD_FOR_ANDROID |
1109 // In order for the == operator to work properly this must be the last field | 1114 // In order for the == operator to work properly this must be the last field |
1110 // in the struct so that we can do a memcmp to this field's offset. | 1115 // in the struct so that we can do a memcmp to this field's offset. |
1111 uint32_t fGenerationID; | 1116 uint32_t fGenerationID; |
1112 #endif | 1117 #endif |
1113 }; | 1118 }; |
1114 | 1119 |
1115 #endif | 1120 #endif |
OLD | NEW |