OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Computer, Inc. | 2 * Copyright (C) 2006, 2007 Apple Computer, Inc. |
3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. | 3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 14 matching lines...) Expand all Loading... |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "config.h" | 32 #include "config.h" |
33 #include "platform/fonts/FontPlatformData.h" | 33 #include "platform/fonts/FontPlatformData.h" |
34 | 34 |
| 35 #include "SkTypeface.h" |
35 #include "platform/LayoutTestSupport.h" | 36 #include "platform/LayoutTestSupport.h" |
36 #include "platform/fonts/FontCache.h" | 37 #include "platform/fonts/FontCache.h" |
37 #include "platform/fonts/harfbuzz/HarfBuzzFace.h" | 38 #include "platform/fonts/harfbuzz/HarfBuzzFace.h" |
38 #include "platform/graphics/GraphicsContext.h" | 39 #include "platform/graphics/GraphicsContext.h" |
39 #include "public/platform/Platform.h" | 40 #include "public/platform/Platform.h" |
40 #include "public/platform/win/WebSandboxSupport.h" | 41 #include "public/platform/win/WebSandboxSupport.h" |
41 #include "wtf/PassOwnPtr.h" | 42 #include "wtf/PassOwnPtr.h" |
42 #include "wtf/StdLibExtras.h" | 43 #include "wtf/StdLibExtras.h" |
43 #include <windows.h> | 44 #include <windows.h> |
44 | 45 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 , m_syntheticBold(syntheticBold) | 190 , m_syntheticBold(syntheticBold) |
190 , m_syntheticItalic(syntheticItalic) | 191 , m_syntheticItalic(syntheticItalic) |
191 , m_orientation(orientation) | 192 , m_orientation(orientation) |
192 , m_typeface(tf) | 193 , m_typeface(tf) |
193 , m_isHashTableDeletedValue(false) | 194 , m_isHashTableDeletedValue(false) |
194 , m_useSubpixelPositioning(useSubpixelPositioning) | 195 , m_useSubpixelPositioning(useSubpixelPositioning) |
195 { | 196 { |
196 m_paintTextFlags = computePaintTextFlags(fontFamilyName()); | 197 m_paintTextFlags = computePaintTextFlags(fontFamilyName()); |
197 } | 198 } |
198 | 199 |
| 200 FontPlatformData::~FontPlatformData() |
| 201 { |
| 202 } |
| 203 |
199 FontPlatformData& FontPlatformData::operator=(const FontPlatformData& data) | 204 FontPlatformData& FontPlatformData::operator=(const FontPlatformData& data) |
200 { | 205 { |
201 if (this != &data) { | 206 if (this != &data) { |
202 m_textSize = data.m_textSize; | 207 m_textSize = data.m_textSize; |
203 m_syntheticBold = data.m_syntheticBold; | 208 m_syntheticBold = data.m_syntheticBold; |
204 m_syntheticItalic = data.m_syntheticItalic; | 209 m_syntheticItalic = data.m_syntheticItalic; |
205 m_orientation = data.m_orientation; | 210 m_orientation = data.m_orientation; |
206 m_typeface = data.m_typeface; | 211 m_typeface = data.m_typeface; |
207 m_paintTextFlags = data.m_paintTextFlags; | 212 m_paintTextFlags = data.m_paintTextFlags; |
208 } | 213 } |
209 return *this; | 214 return *this; |
210 } | 215 } |
211 | 216 |
212 FontPlatformData::~FontPlatformData() | |
213 { | |
214 } | |
215 | |
216 String FontPlatformData::fontFamilyName() const | 217 String FontPlatformData::fontFamilyName() const |
217 { | 218 { |
218 // FIXME: This returns the requested name, perhaps a better solution would b
e to | 219 // FIXME: This returns the requested name, perhaps a better solution would b
e to |
219 // return the list of names provided by SkTypeface::createFamilyNameIterator
. | 220 // return the list of names provided by SkTypeface::createFamilyNameIterator
. |
220 ASSERT(typeface()); | 221 ASSERT(typeface()); |
221 SkString familyName; | 222 SkString familyName; |
222 typeface()->getFamilyName(&familyName); | 223 typeface()->getFamilyName(&familyName); |
223 return String::fromUTF8(familyName.c_str()); | 224 return String::fromUTF8(familyName.c_str()); |
224 } | 225 } |
225 | 226 |
(...skipping 13 matching lines...) Expand all Loading... |
239 } | 240 } |
240 | 241 |
241 HarfBuzzFace* FontPlatformData::harfBuzzFace() const | 242 HarfBuzzFace* FontPlatformData::harfBuzzFace() const |
242 { | 243 { |
243 if (!m_harfBuzzFace) | 244 if (!m_harfBuzzFace) |
244 m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this
), uniqueID()); | 245 m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this
), uniqueID()); |
245 | 246 |
246 return m_harfBuzzFace.get(); | 247 return m_harfBuzzFace.get(); |
247 } | 248 } |
248 | 249 |
| 250 SkFontID FontPlatformData::uniqueID() const |
| 251 { |
| 252 return m_typeface->uniqueID(); |
| 253 } |
| 254 |
249 bool FontPlatformData::defaultUseSubpixelPositioning() | 255 bool FontPlatformData::defaultUseSubpixelPositioning() |
250 { | 256 { |
251 return FontCache::fontCache()->useSubpixelPositioning(); | 257 return FontCache::fontCache()->useSubpixelPositioning(); |
252 } | 258 } |
253 | 259 |
254 #ifndef NDEBUG | 260 #ifndef NDEBUG |
255 String FontPlatformData::description() const | 261 String FontPlatformData::description() const |
256 { | 262 { |
257 return String(); | 263 return String(); |
258 } | 264 } |
259 #endif | 265 #endif |
260 | 266 |
261 } // namespace WebCore | 267 } // namespace WebCore |
OLD | NEW |