mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
fonts: Use FontInstanceFlags::EMBEDDED_BITMAPS
for color fonts on MacOS (#32203)
This flag ensures that these fonts are rendered full color in WebRender, allowing for full color emoji.
This commit is contained in:
parent
60613e77c5
commit
928214518c
12 changed files with 471 additions and 38 deletions
|
@ -47,9 +47,9 @@ use webrender_api::units::{
|
|||
};
|
||||
use webrender_api::{
|
||||
self, BuiltDisplayList, DirtyRect, DisplayListPayload, DocumentId, Epoch as WebRenderEpoch,
|
||||
ExternalScrollId, HitTestFlags, PipelineId as WebRenderPipelineId, PropertyBinding,
|
||||
ReferenceFrameKind, RenderReasons, SampledScrollOffset, ScrollLocation, SpaceAndClipInfo,
|
||||
SpatialId, SpatialTreeItemKey, TransformStyle,
|
||||
ExternalScrollId, FontInstanceOptions, HitTestFlags, PipelineId as WebRenderPipelineId,
|
||||
PropertyBinding, ReferenceFrameKind, RenderReasons, SampledScrollOffset, ScrollLocation,
|
||||
SpaceAndClipInfo, SpatialId, SpatialTreeItemKey, TransformStyle,
|
||||
};
|
||||
|
||||
use crate::gl::RenderTargetInfo;
|
||||
|
@ -871,13 +871,25 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
ForwardedToCompositorMsg::Font(FontToCompositorMsg::AddFontInstance(
|
||||
font_key,
|
||||
size,
|
||||
flags,
|
||||
sender,
|
||||
)) => {
|
||||
let key = self.webrender_api.generate_font_instance_key();
|
||||
let mut txn = Transaction::new();
|
||||
txn.add_font_instance(key, font_key, size, None, None, Vec::new());
|
||||
let mut transaction = Transaction::new();
|
||||
|
||||
let mut font_instance_options = FontInstanceOptions::default();
|
||||
font_instance_options.flags = flags;
|
||||
transaction.add_font_instance(
|
||||
key,
|
||||
font_key,
|
||||
size,
|
||||
Some(font_instance_options),
|
||||
None,
|
||||
Vec::new(),
|
||||
);
|
||||
|
||||
self.webrender_api
|
||||
.send_transaction(self.webrender_document, txn);
|
||||
.send_transaction(self.webrender_document, transaction);
|
||||
let _ = sender.send(key);
|
||||
},
|
||||
|
||||
|
@ -951,7 +963,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
let _ = sender.send(());
|
||||
},
|
||||
CompositorMsg::Forwarded(ForwardedToCompositorMsg::Font(
|
||||
FontToCompositorMsg::AddFontInstance(_, _, sender),
|
||||
FontToCompositorMsg::AddFontInstance(_, _, _, sender),
|
||||
)) => {
|
||||
let _ = sender.send(self.webrender_api.generate_font_instance_key());
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue