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

Side by Side Diff: src/core/SkDescriptor.h

Issue 1986253002: Rename SkDescriptor::equals to SkDescriptor::operator== (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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/SkGlyphCache.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 8
9 #ifndef SkDescriptor_DEFINED 9 #ifndef SkDescriptor_DEFINED
10 #define SkDescriptor_DEFINED 10 #define SkDescriptor_DEFINED
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 return nullptr; 79 return nullptr;
80 } 80 }
81 81
82 SkDescriptor* copy() const { 82 SkDescriptor* copy() const {
83 SkDescriptor* desc = SkDescriptor::Alloc(fLength); 83 SkDescriptor* desc = SkDescriptor::Alloc(fLength);
84 memcpy(desc, this, fLength); 84 memcpy(desc, this, fLength);
85 return desc; 85 return desc;
86 } 86 }
87 87
88 bool equals(const SkDescriptor& other) const { 88 bool operator==(const SkDescriptor& other) const {
89 // probe to see if we have a good checksum algo 89 // probe to see if we have a good checksum algo
90 // SkASSERT(a.fChecksum != b.fChecksum || memcmp(&a, &b, a.fLength) == 0) ; 90 // SkASSERT(a.fChecksum != b.fChecksum || memcmp(&a, &b, a.fLength) == 0) ;
91 91
92 // the first value we should look at is the checksum, so this loop 92 // the first value we should look at is the checksum, so this loop
93 // should terminate early if they descriptors are different. 93 // should terminate early if they descriptors are different.
94 // NOTE: if we wrote a sentinel value at the end of each, we chould 94 // NOTE: if we wrote a sentinel value at the end of each, we chould
95 // remove the aa < stop test in the loop... 95 // remove the aa < stop test in the loop...
96 const uint32_t* aa = (const uint32_t*)this; 96 const uint32_t* aa = (const uint32_t*)this;
97 const uint32_t* bb = (const uint32_t*)&other; 97 const uint32_t* bb = (const uint32_t*)&other;
98 const uint32_t* stop = (const uint32_t*)((const char*)aa + fLength); 98 const uint32_t* stop = (const uint32_t*)((const char*)aa + fLength);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 + sizeof(SkDescriptor::Entry) + sizeof(void*) // for typeface 166 + sizeof(SkDescriptor::Entry) + sizeof(void*) // for typeface
167 + 32 // slop for occational small extras 167 + 32 // slop for occational small extras
168 }; 168 };
169 SkDescriptor* fDesc; 169 SkDescriptor* fDesc;
170 uint32_t fStorage[(kStorageSize + 3) >> 2]; 170 uint32_t fStorage[(kStorageSize + 3) >> 2];
171 }; 171 };
172 #define SkAutoDescriptor(...) SK_REQUIRE_LOCAL_VAR(SkAutoDescriptor) 172 #define SkAutoDescriptor(...) SK_REQUIRE_LOCAL_VAR(SkAutoDescriptor)
173 173
174 174
175 #endif 175 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698