| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/BinaryDataFontFaceSource.h" | 5 #include "core/css/BinaryDataFontFaceSource.h" |
| 6 | 6 |
| 7 #include "platform/SharedBuffer.h" | 7 #include "platform/SharedBuffer.h" |
| 8 #include "platform/fonts/FontCustomPlatformData.h" | 8 #include "platform/fonts/FontCustomPlatformData.h" |
| 9 #include "platform/fonts/FontDescription.h" | 9 #include "platform/fonts/FontDescription.h" |
| 10 #include "platform/fonts/SimpleFontData.h" | 10 #include "platform/fonts/SimpleFontData.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 BinaryDataFontFaceSource::BinaryDataFontFaceSource(SharedBuffer* data, String& o
tsParseMessage) | 14 BinaryDataFontFaceSource::BinaryDataFontFaceSource(SharedBuffer* data, String& o
tsParseMessage) |
| 15 : m_customPlatformData(FontCustomPlatformData::create(data, otsParseMessage)
) | 15 : m_customPlatformData(FontCustomPlatformData::create(data, otsParseMessage)
) |
| 16 { | 16 { |
| 17 } | 17 } |
| 18 | 18 |
| 19 BinaryDataFontFaceSource::~BinaryDataFontFaceSource() | 19 BinaryDataFontFaceSource::~BinaryDataFontFaceSource() |
| 20 { | 20 { |
| 21 } | 21 } |
| 22 | 22 |
| 23 bool BinaryDataFontFaceSource::isValid() const | 23 bool BinaryDataFontFaceSource::isValid() const |
| 24 { | 24 { |
| 25 return m_customPlatformData; | 25 return m_customPlatformData.get(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 PassRefPtr<SimpleFontData> BinaryDataFontFaceSource::createFontData(const FontDe
scription& fontDescription) | 28 PassRefPtr<SimpleFontData> BinaryDataFontFaceSource::createFontData(const FontDe
scription& fontDescription) |
| 29 { | 29 { |
| 30 return SimpleFontData::create( | 30 return SimpleFontData::create( |
| 31 m_customPlatformData->fontPlatformData(fontDescription.effectiveFontSize
(), | 31 m_customPlatformData->fontPlatformData(fontDescription.effectiveFontSize
(), |
| 32 fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic
(), | 32 fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic
(), |
| 33 fontDescription.orientation()), CustomFontData::create()); | 33 fontDescription.orientation()), CustomFontData::create()); |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace blink | 36 } // namespace blink |
| OLD | NEW |