perf: optimize PipeWire DRM format negotiation and sharpen Gallery modal with drop shadows

This commit is contained in:
katR 2026-10-05 07:23:49 +05:30
parent 3753d0c6e5
commit 82b16caa2e
2 changed files with 11 additions and 3 deletions

View file

@ -77,10 +77,16 @@ impl PipeWireStream {
let stride = data.chunk().stride() as u32;
let offset = data.chunk().offset();
let frame = if fd > 0 {
let drm_fourcc = match user_data.format.format() {
spa::param::video::VideoFormat::BGRx | spa::param::video::VideoFormat::BGRA => 0x34325258, // DRM_FORMAT_XRGB8888
spa::param::video::VideoFormat::RGBx | spa::param::video::VideoFormat::RGBA => 0x34324258, // DRM_FORMAT_XBGR8888
spa::param::video::VideoFormat::NV12 => 0x3231564e, // DRM_FORMAT_NV12
_ => 0x34325241, // DRM_FORMAT_ARGB8888
};
Frame::DmaBuf {
width: user_data.format.size().width,
height: user_data.format.size().height,
format: 0x34325241, // DRM_FORMAT_ARGB8888
format: drm_fourcc,
modifier: user_data.format.modifier(),
fd,
stride,

View file

@ -2798,10 +2798,12 @@ impl ScytheOverlayApp {
let modal_rect = egui::Rect::from_min_size(egui::pos2(left_pad, top_pad), egui::vec2(modal_w, modal_h));
self.panel_rect = modal_rect;
draw_window_shadow(ui.painter(), modal_rect, 1.0);
ui.allocate_new_ui(egui::UiBuilder::new().max_rect(modal_rect), |ui| {
egui::Frame::NONE
.fill(Color32::from_rgba_unmultiplied(11, 12, 15, 252))
.stroke(Stroke::new(1.0_f32, Color32::from_rgba_unmultiplied(accent.r(), accent.g(), accent.b(), 140)))
.fill(Color32::from_rgb(21, 25, 30))
.stroke(Stroke::new(1.0_f32, Color32::from_rgb(42, 50, 62)))
.corner_radius(CornerRadius::ZERO)
.inner_margin(Margin::symmetric(20_i8, 16_i8))
.show(ui, |ui| {