Skip to content

Commit 015d03f

Browse files
author
WR Updater Bot
committed
Bug 1515242 - Update webrender to commit aa73c6a188d2885892b55903d126639f3d748c53 (WR PR #3432). r=kats
servo/webrender#3432 Differential Revision: https://phabricator.services.mozilla.com/D14937
1 parent a64688a commit 015d03f

File tree

12 files changed

+17
-12
lines changed

12 files changed

+17
-12
lines changed

gfx/webrender_bindings/revision.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9b6c5347c03bd123e0704b7bbd823f3f9fdc9334
1+
aa73c6a188d2885892b55903d126639f3d748c53

gfx/wr/webrender/src/platform/unix/font.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,20 @@ impl FontContext {
369369
}
370370
}
371371

372+
fn pad_bounding_box(&self, font: &FontInstance, cbox: &mut FT_BBox) {
373+
// Apply extra pixel of padding for subpixel AA, due to the filter.
374+
if font.render_mode == FontRenderMode::Subpixel {
375+
let padding = (self.lcd_extra_pixels * 64) as FT_Pos;
376+
if font.flags.contains(FontInstanceFlags::LCD_VERTICAL) {
377+
cbox.yMin -= padding;
378+
cbox.yMax += padding;
379+
} else {
380+
cbox.xMin -= padding;
381+
cbox.xMax += padding;
382+
}
383+
}
384+
}
385+
372386
// Get the bounding box for a glyph, accounting for sub-pixel positioning.
373387
fn get_bounding_box(
374388
&self,
@@ -389,17 +403,7 @@ impl FontContext {
389403
}
390404
}
391405

392-
// Apply extra pixel of padding for subpixel AA, due to the filter.
393-
if font.render_mode == FontRenderMode::Subpixel {
394-
let padding = (self.lcd_extra_pixels * 64) as FT_Pos;
395-
if font.flags.contains(FontInstanceFlags::LCD_VERTICAL) {
396-
cbox.yMin -= padding;
397-
cbox.yMax += padding;
398-
} else {
399-
cbox.xMin -= padding;
400-
cbox.xMax += padding;
401-
}
402-
}
406+
self.pad_bounding_box(font, &mut cbox);
403407

404408
// Offset the bounding box by subpixel positioning.
405409
// Convert to 26.6 fixed point format for FT.
@@ -572,6 +576,7 @@ impl FontContext {
572576
let outline = &(*slot).outline;
573577
let mut cbox: FT_BBox = mem::uninitialized();
574578
FT_Outline_Get_CBox(outline, &mut cbox);
579+
self.pad_bounding_box(font, &mut cbox);
575580
FT_Outline_Translate(
576581
outline,
577582
dx - ((cbox.xMin + dx) & !63),
Loading
Loading
Loading
55.3 KB
Loading
-199 Bytes
Loading
53 Bytes
Loading
-1 Bytes
Loading
0 Bytes
Loading
0 Bytes
Loading
Loading

0 commit comments

Comments
 (0)