OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 11 matching lines...) Expand all Loading... |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h" | 32 #include "platform/fonts/FontPlatformData.h" |
33 | 33 |
34 #include "SkTypeface.h" | 34 #include "SkTypeface.h" |
35 #include "platform/fonts/harfbuzz/HarfBuzzFace.h" | 35 #include "platform/fonts/harfbuzz/HarfBuzzFace.h" |
36 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType) | 40 FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType) |
41 : m_textSize(0) | 41 : m_textSize(0) |
42 , m_syntheticBold(false) | 42 , m_syntheticBold(false) |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 , m_useSubpixelPositioning(src.m_useSubpixelPositioning) | 135 , m_useSubpixelPositioning(src.m_useSubpixelPositioning) |
136 #endif | 136 #endif |
137 { | 137 { |
138 querySystemForRenderStyle(FontDescription::subpixelPositioning()); | 138 querySystemForRenderStyle(FontDescription::subpixelPositioning()); |
139 } | 139 } |
140 | 140 |
141 FontPlatformData::~FontPlatformData() | 141 FontPlatformData::~FontPlatformData() |
142 { | 142 { |
143 } | 143 } |
144 | 144 |
145 FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src) | 145 const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src) |
146 { | 146 { |
147 m_typeface = src.m_typeface; | 147 m_typeface = src.m_typeface; |
148 #if !OS(WIN) | 148 #if !OS(WIN) |
149 m_family = src.m_family; | 149 m_family = src.m_family; |
150 #endif | 150 #endif |
151 m_textSize = src.m_textSize; | 151 m_textSize = src.m_textSize; |
152 m_syntheticBold = src.m_syntheticBold; | 152 m_syntheticBold = src.m_syntheticBold; |
153 m_syntheticItalic = src.m_syntheticItalic; | 153 m_syntheticItalic = src.m_syntheticItalic; |
154 m_harfBuzzFace = nullptr; | 154 m_harfBuzzFace = nullptr; |
155 m_orientation = src.m_orientation; | 155 m_orientation = src.m_orientation; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 && m_orientation == a.m_orientation | 204 && m_orientation == a.m_orientation |
205 && m_style == a.m_style | 205 && m_style == a.m_style |
206 && m_isHashTableDeletedValue == a.m_isHashTableDeletedValue; | 206 && m_isHashTableDeletedValue == a.m_isHashTableDeletedValue; |
207 } | 207 } |
208 | 208 |
209 bool FontPlatformData::isFixedPitch() const | 209 bool FontPlatformData::isFixedPitch() const |
210 { | 210 { |
211 return typeface() && typeface()->isFixedPitch(); | 211 return typeface() && typeface()->isFixedPitch(); |
212 } | 212 } |
213 | 213 |
| 214 SkTypeface* FontPlatformData::typeface() const |
| 215 { |
| 216 return m_typeface.get(); |
| 217 } |
| 218 |
214 HarfBuzzFace* FontPlatformData::harfBuzzFace() const | 219 HarfBuzzFace* FontPlatformData::harfBuzzFace() const |
215 { | 220 { |
216 if (!m_harfBuzzFace) | 221 if (!m_harfBuzzFace) |
217 m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this
), uniqueID()); | 222 m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this
), uniqueID()); |
218 | 223 |
219 return m_harfBuzzFace.get(); | 224 return m_harfBuzzFace.get(); |
220 } | 225 } |
221 | 226 |
222 } // namespace blink | 227 } // namespace blink |
OLD | NEW |