mirror of
https://github.com/servo/servo.git
synced 2025-10-15 16:00:28 +01:00
Add perfetto tracing events to fonts (#33436)
* trace fonts Co-authored-by: Delan Azabani <dazabani@igalia.com> Signed-off-by: atbrakhi <atbrakhi@igalia.com> * review fix Co-authored-by: Delan Azabani <dazabani@igalia.com> Signed-off-by: atbrakhi <atbrakhi@igalia.com> --------- Signed-off-by: atbrakhi <atbrakhi@igalia.com> Co-authored-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
parent
b12cebd1ac
commit
236cae9ce5
4 changed files with 24 additions and 1 deletions
|
@ -89,6 +89,7 @@ use surfman::platform::generic::multi::context::NativeContext as LinuxNativeCont
|
|||
use surfman::{GLApi, GLVersion};
|
||||
#[cfg(all(target_os = "linux", not(target_env = "ohos")))]
|
||||
use surfman::{NativeConnection, NativeContext};
|
||||
use tracing::{span, Level};
|
||||
use webgpu::swapchain::WGPUImageMap;
|
||||
use webrender::{RenderApiSender, ShaderPrecacheFlags, UploadMethod, ONE_TIME_USAGE_HINT};
|
||||
use webrender_api::{
|
||||
|
@ -1105,6 +1106,7 @@ impl WebRenderFontApi for WebRenderFontApiCompositorProxy {
|
|||
receiver.recv().unwrap()
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
fn add_font(&self, data: Arc<Vec<u8>>, index: u32) -> FontKey {
|
||||
let (sender, receiver) = unbounded();
|
||||
let (bytes_sender, bytes_receiver) =
|
||||
|
@ -1113,7 +1115,11 @@ impl WebRenderFontApi for WebRenderFontApiCompositorProxy {
|
|||
.send(CompositorMsg::Forwarded(ForwardedToCompositorMsg::Font(
|
||||
FontToCompositorMsg::AddFont(sender, index, bytes_receiver),
|
||||
)));
|
||||
let _ = bytes_sender.send(&data);
|
||||
{
|
||||
let span = span!(Level::TRACE, "add_font send", servo_profiling = true);
|
||||
let _span = span.enter();
|
||||
let _ = bytes_sender.send(&data);
|
||||
}
|
||||
receiver.recv().unwrap()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue