| 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 | 9 |
| 10 #include "GrTemplates.h" | 10 #include "GrTemplates.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 SkGrDescKey::~SkGrDescKey() { | 45 SkGrDescKey::~SkGrDescKey() { |
| 46 if (fDesc != GrTCast<SkDescriptor*>(fStorage)) { | 46 if (fDesc != GrTCast<SkDescriptor*>(fStorage)) { |
| 47 SkDescriptor::Free(fDesc); | 47 SkDescriptor::Free(fDesc); |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool SkGrDescKey::lt(const GrKey& rh) const { | 51 bool SkGrDescKey::lt(const GrKey& rh) const { |
| 52 const SkDescriptor* srcDesc = ((const SkGrDescKey*)&rh)->fDesc; | 52 const SkDescriptor* srcDesc = ((const SkGrDescKey*)&rh)->fDesc; |
| 53 size_t lenLH = fDesc->getLength(); | 53 size_t lenLH = fDesc->getLength(); |
| 54 size_t lenRH = srcDesc->getLength(); | 54 size_t lenRH = srcDesc->getLength(); |
| 55 int cmp = memcmp(fDesc, srcDesc, SkMin32(lenLH, lenRH)); | 55 int cmp = memcmp(fDesc, srcDesc, SkTMin<size_t>(lenLH, lenRH)); |
| 56 if (0 == cmp) { | 56 if (0 == cmp) { |
| 57 return lenLH < lenRH; | 57 return lenLH < lenRH; |
| 58 } else { | 58 } else { |
| 59 return cmp < 0; | 59 return cmp < 0; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool SkGrDescKey::eq(const GrKey& rh) const { | 63 bool SkGrDescKey::eq(const GrKey& rh) const { |
| 64 const SkDescriptor* srcDesc = ((const SkGrDescKey*)&rh)->fDesc; | 64 const SkDescriptor* srcDesc = ((const SkGrDescKey*)&rh)->fDesc; |
| 65 return fDesc->equals(*srcDesc); | 65 return fDesc->equals(*srcDesc); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 bool SkGrFontScaler::getGlyphPath(uint16_t glyphID, SkPath* path) { | 192 bool SkGrFontScaler::getGlyphPath(uint16_t glyphID, SkPath* path) { |
| 193 | 193 |
| 194 const SkGlyph& glyph = fStrike->getGlyphIDMetrics(glyphID); | 194 const SkGlyph& glyph = fStrike->getGlyphIDMetrics(glyphID); |
| 195 const SkPath* skPath = fStrike->findPath(glyph); | 195 const SkPath* skPath = fStrike->findPath(glyph); |
| 196 if (skPath) { | 196 if (skPath) { |
| 197 *path = *skPath; | 197 *path = *skPath; |
| 198 return true; | 198 return true; |
| 199 } | 199 } |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| OLD | NEW |