OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #include "platform/fonts/SegmentedFontData.h" | 26 #include "platform/fonts/SegmentedFontData.h" |
27 | 27 |
28 #include "platform/fonts/SimpleFontData.h" | 28 #include "platform/fonts/SimpleFontData.h" |
29 #include "wtf/Assertions.h" | 29 #include "wtf/Assertions.h" |
30 #include "wtf/text/WTFString.h" | 30 #include "wtf/text/WTFString.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 SegmentedFontData::~SegmentedFontData() { | |
35 GlyphPageTreeNode::pruneTreeCustomFontData(this); | |
36 } | |
37 | |
38 const SimpleFontData* SegmentedFontData::fontDataForCharacter(UChar32 c) const { | 34 const SimpleFontData* SegmentedFontData::fontDataForCharacter(UChar32 c) const { |
39 auto end = m_faces.end(); | 35 auto end = m_faces.end(); |
40 for (auto it = m_faces.begin(); it != end; ++it) { | 36 for (auto it = m_faces.begin(); it != end; ++it) { |
41 if ((*it)->contains(c)) | 37 if ((*it)->contains(c)) |
42 return (*it)->fontData(); | 38 return (*it)->fontData(); |
43 } | 39 } |
44 return m_faces[0]->fontData(); | 40 return m_faces[0]->fontData(); |
45 } | 41 } |
46 | 42 |
47 bool SegmentedFontData::containsCharacter(UChar32 c) const { | 43 bool SegmentedFontData::containsCharacter(UChar32 c) const { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 bool SegmentedFontData::shouldSkipDrawing() const { | 80 bool SegmentedFontData::shouldSkipDrawing() const { |
85 auto end = m_faces.end(); | 81 auto end = m_faces.end(); |
86 for (auto it = m_faces.begin(); it != end; ++it) { | 82 for (auto it = m_faces.begin(); it != end; ++it) { |
87 if ((*it)->fontData()->shouldSkipDrawing()) | 83 if ((*it)->fontData()->shouldSkipDrawing()) |
88 return true; | 84 return true; |
89 } | 85 } |
90 return false; | 86 return false; |
91 } | 87 } |
92 | 88 |
93 } // namespace blink | 89 } // namespace blink |
OLD | NEW |