| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 FontDescription requestedFontDescription(fontDescription); | 118 FontDescription requestedFontDescription(fontDescription); |
| 119 requestedFontDescription.setTraits(m_traits); | 119 requestedFontDescription.setTraits(m_traits); |
| 120 requestedFontDescription.setSyntheticBold(m_traits.weight() < FontWeight600
&& desiredTraits.weight() >= FontWeight600); | 120 requestedFontDescription.setSyntheticBold(m_traits.weight() < FontWeight600
&& desiredTraits.weight() >= FontWeight600); |
| 121 requestedFontDescription.setSyntheticItalic(m_traits.style() == FontStyleNor
mal && desiredTraits.style() == FontStyleItalic); | 121 requestedFontDescription.setSyntheticItalic(m_traits.style() == FontStyleNor
mal && desiredTraits.style() == FontStyleItalic); |
| 122 | 122 |
| 123 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF
aces.rend(); ++it) { | 123 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF
aces.rend(); ++it) { |
| 124 if (!(*it)->cssFontFace()->isValid()) | 124 if (!(*it)->cssFontFace()->isValid()) |
| 125 continue; | 125 continue; |
| 126 if (RefPtr<SimpleFontData> faceFontData = (*it)->cssFontFace()->getFontD
ata(requestedFontDescription)) { | 126 if (RefPtr<SimpleFontData> faceFontData = (*it)->cssFontFace()->getFontD
ata(requestedFontDescription)) { |
| 127 ASSERT(!faceFontData->isSegmented()); | 127 ASSERT(!faceFontData->isSegmented()); |
| 128 fontData->appendFace(FontDataForRangeSet(faceFontData.release(), (*i
t)->cssFontFace()->ranges())); | 128 if (faceFontData->isCustomFont()) |
| 129 fontData->appendFace(adoptRef(new FontDataForRangeSet(faceFontDa
ta.release(), (*it)->cssFontFace()->ranges()))); |
| 130 else |
| 131 fontData->appendFace(adoptRef(new FontDataForRangeSetFromCache(f
aceFontData.release(), (*it)->cssFontFace()->ranges()))); |
| 129 } | 132 } |
| 130 } | 133 } |
| 131 if (fontData->numFaces()) | 134 if (fontData->numFaces()) |
| 132 return fontData; // No release, we have a reference to an object in the
cache which should retain the ref count it has. | 135 return fontData; // No release, we have a reference to an object in the
cache which should retain the ref count it has. |
| 133 | 136 |
| 134 return nullptr; | 137 return nullptr; |
| 135 } | 138 } |
| 136 | 139 |
| 137 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio
n, const String& text) | 140 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio
n, const String& text) |
| 138 { | 141 { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 177 } |
| 175 } | 178 } |
| 176 | 179 |
| 177 DEFINE_TRACE(CSSSegmentedFontFace) | 180 DEFINE_TRACE(CSSSegmentedFontFace) |
| 178 { | 181 { |
| 179 visitor->trace(m_fontSelector); | 182 visitor->trace(m_fontSelector); |
| 180 visitor->trace(m_fontFaces); | 183 visitor->trace(m_fontFaces); |
| 181 } | 184 } |
| 182 | 185 |
| 183 } // namespace blink | 186 } // namespace blink |
| OLD | NEW |