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
|
@ -90,7 +90,8 @@ use surfman::{GLApi, GLVersion};
|
|||
use surfman::{NativeConnection, NativeContext};
|
||||
use webrender::{RenderApiSender, ShaderPrecacheFlags};
|
||||
use webrender_api::{
|
||||
ColorF, DocumentId, FontInstanceKey, FontKey, FramePublishId, ImageKey, NativeFontHandle,
|
||||
ColorF, DocumentId, FontInstanceFlags, FontInstanceKey, FontKey, FramePublishId, ImageKey,
|
||||
NativeFontHandle,
|
||||
};
|
||||
use webrender_traits::{
|
||||
WebrenderExternalImageHandlers, WebrenderExternalImageRegistry, WebrenderImageHandlerType,
|
||||
|
@ -1043,12 +1044,17 @@ fn create_constellation(
|
|||
struct FontCacheWR(CompositorProxy);
|
||||
|
||||
impl gfx_traits::WebrenderApi for FontCacheWR {
|
||||
fn add_font_instance(&self, font_key: FontKey, size: f32) -> FontInstanceKey {
|
||||
fn add_font_instance(
|
||||
&self,
|
||||
font_key: FontKey,
|
||||
size: f32,
|
||||
flags: FontInstanceFlags,
|
||||
) -> FontInstanceKey {
|
||||
let (sender, receiver) = unbounded();
|
||||
let _ = self
|
||||
.0
|
||||
.send(CompositorMsg::Forwarded(ForwardedToCompositorMsg::Font(
|
||||
FontToCompositorMsg::AddFontInstance(font_key, size, sender),
|
||||
FontToCompositorMsg::AddFontInstance(font_key, size, flags, sender),
|
||||
)));
|
||||
receiver.recv().unwrap()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue