servo: Merge #16551 - Update WR (improved double border quality, minor API changes) (from glennw:update-wr-mostly-borders); r=jdm
Source-Repo: https://github.com/servo/servo Source-Revision: 0f6c883658930006994b2738f059d050c037ffb9
This commit is contained in:
@@ -18,6 +18,7 @@ use std::fs::File;
|
||||
use std::io::{Read, Error as IoError};
|
||||
use std::ops::Deref;
|
||||
use std::sync::Mutex;
|
||||
use webrender_traits::NativeFontHandle;
|
||||
|
||||
/// Platform specific font representation for mac.
|
||||
/// The identifier is a PostScript font name. The
|
||||
@@ -106,8 +107,8 @@ impl FontTemplateData {
|
||||
}
|
||||
|
||||
/// Returns the native font that underlies this font template, if applicable.
|
||||
pub fn native_font(&self) -> Option<CGFont> {
|
||||
self.ctfont(0.0).map(|ctfont| ctfont.copy_to_CGFont())
|
||||
pub fn native_font(&self) -> Option<NativeFontHandle> {
|
||||
self.ctfont(0.0).map(|ctfont| NativeFontHandle(ctfont.copy_to_CGFont()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -258,10 +258,12 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||
};
|
||||
if !slice.glyphs.is_whitespace() {
|
||||
let glyph_offset = glyph.offset().unwrap_or(Point2D::zero());
|
||||
let x = (origin.x + glyph_offset.x).to_f32_px();
|
||||
let y = (origin.y + glyph_offset.y).to_f32_px();
|
||||
let point = webrender_traits::LayoutPoint::new(x, y);
|
||||
let glyph = webrender_traits::GlyphInstance {
|
||||
index: glyph.id(),
|
||||
point: Point2D::new((origin.x + glyph_offset.x).to_f32_px(),
|
||||
(origin.y + glyph_offset.y).to_f32_px()),
|
||||
point: point,
|
||||
};
|
||||
glyphs.push(glyph);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user