зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #13322 - Make dummy font implementation conform to API changes (from jdm:msvc-build-fix); r=KiChjang
- [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13321 - [X] There are tests for these changes Source-Repo: https://github.com/servo/servo Source-Revision: 7d3c7beb215c18f10c03fb394eff9d152313dc59
This commit is contained in:
Родитель
00492ad634
Коммит
90b9f0fa80
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::io::Error;
|
||||
use string_cache::Atom;
|
||||
use webrender_traits::NativeFontHandle;
|
||||
|
||||
|
@ -12,7 +13,7 @@ pub struct FontTemplateData {
|
|||
}
|
||||
|
||||
impl FontTemplateData {
|
||||
pub fn new(identifier: Atom, font_data: Option<Vec<u8>>) -> FontTemplateData {
|
||||
pub fn new(identifier: Atom, font_data: Option<Vec<u8>>) -> Result<FontTemplateData, Error> {
|
||||
let bytes = match font_data {
|
||||
Some(bytes) => {
|
||||
bytes
|
||||
|
@ -22,10 +23,10 @@ impl FontTemplateData {
|
|||
}
|
||||
};
|
||||
|
||||
FontTemplateData {
|
||||
Ok(FontTemplateData {
|
||||
bytes: bytes,
|
||||
identifier: identifier,
|
||||
}
|
||||
})
|
||||
}
|
||||
pub fn bytes(&self) -> Vec<u8> {
|
||||
self.bytes.clone()
|
||||
|
|
Загрузка…
Ссылка в новой задаче