OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Computer, Inc. | 2 * Copyright (C) 2007 Apple Computer, Inc. |
3 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. | 3 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. |
4 * Copyright (C) 2010 Company 100, Inc. | 4 * Copyright (C) 2010 Company 100, Inc. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
8 * met: | 8 * met: |
9 * | 9 * |
10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 std::unique_ptr<FontCustomPlatformData> FontCustomPlatformData::create( | 63 std::unique_ptr<FontCustomPlatformData> FontCustomPlatformData::create( |
64 SharedBuffer* buffer, | 64 SharedBuffer* buffer, |
65 String& otsParseMessage) { | 65 String& otsParseMessage) { |
66 DCHECK(buffer); | 66 DCHECK(buffer); |
67 WebFontDecoder decoder; | 67 WebFontDecoder decoder; |
68 sk_sp<SkTypeface> typeface = decoder.decode(buffer); | 68 sk_sp<SkTypeface> typeface = decoder.decode(buffer); |
69 if (!typeface) { | 69 if (!typeface) { |
70 otsParseMessage = decoder.getErrorString(); | 70 otsParseMessage = decoder.getErrorString(); |
71 return nullptr; | 71 return nullptr; |
72 } | 72 } |
73 return wrapUnique( | 73 return WTF::wrapUnique( |
74 new FontCustomPlatformData(std::move(typeface), decoder.decodedSize())); | 74 new FontCustomPlatformData(std::move(typeface), decoder.decodedSize())); |
75 } | 75 } |
76 | 76 |
77 bool FontCustomPlatformData::supportsFormat(const String& format) { | 77 bool FontCustomPlatformData::supportsFormat(const String& format) { |
78 return equalIgnoringCase(format, "truetype") || | 78 return equalIgnoringCase(format, "truetype") || |
79 equalIgnoringCase(format, "opentype") || | 79 equalIgnoringCase(format, "opentype") || |
80 WebFontDecoder::supportsFormat(format); | 80 WebFontDecoder::supportsFormat(format); |
81 } | 81 } |
82 | 82 |
83 } // namespace blink | 83 } // namespace blink |
OLD | NEW |