Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: include/core/SkPaint.h

Issue 637583002: Add SkPaint::getHash(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkPaint.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698