video: render hardware cursor in screencasts
This commit is contained in:
parent
d4fc672fb3
commit
4d8e744c2f
4 changed files with 86 additions and 10 deletions
|
|
@ -149,7 +149,12 @@ impl JayScreencast {
|
|||
});
|
||||
}
|
||||
|
||||
pub fn copy_texture(&self, on: &OutputNode, texture: &Rc<dyn GfxTexture>) {
|
||||
pub fn copy_texture(
|
||||
&self,
|
||||
on: &OutputNode,
|
||||
texture: &Rc<dyn GfxTexture>,
|
||||
render_hardware_cursors: bool,
|
||||
) {
|
||||
if !self.running.get() {
|
||||
return;
|
||||
}
|
||||
|
|
@ -165,7 +170,15 @@ impl JayScreencast {
|
|||
let mut buffer = self.buffers.borrow_mut();
|
||||
for (idx, buffer) in buffer.deref_mut().iter_mut().enumerate() {
|
||||
if buffer.free {
|
||||
buffer.fb.copy_texture(texture, 0, 0);
|
||||
self.client.state.perform_screencopy(
|
||||
texture,
|
||||
&buffer.fb,
|
||||
on.global.preferred_scale.get(),
|
||||
on.global.pos.get(),
|
||||
render_hardware_cursors,
|
||||
0,
|
||||
0,
|
||||
);
|
||||
self.client.event(Ready {
|
||||
self_id: self.id,
|
||||
idx: idx as _,
|
||||
|
|
|
|||
|
|
@ -202,7 +202,12 @@ impl WlOutputGlobal {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn perform_screencopies(&self, fb: &dyn GfxFramebuffer, tex: &Rc<dyn GfxTexture>) {
|
||||
pub fn perform_screencopies(
|
||||
&self,
|
||||
fb: &dyn GfxFramebuffer,
|
||||
tex: &Rc<dyn GfxTexture>,
|
||||
render_hardware_cursors: bool,
|
||||
) {
|
||||
if self.pending_captures.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
|
@ -278,7 +283,15 @@ impl WlOutputGlobal {
|
|||
continue;
|
||||
}
|
||||
};
|
||||
fb.copy_texture(tex, -capture.rect.x1(), -capture.rect.y1());
|
||||
self.state.perform_screencopy(
|
||||
tex,
|
||||
&fb,
|
||||
self.preferred_scale.get(),
|
||||
self.pos.get(),
|
||||
render_hardware_cursors,
|
||||
-capture.rect.x1(),
|
||||
-capture.rect.y1(),
|
||||
);
|
||||
}
|
||||
if capture.with_damage.get() {
|
||||
capture.send_damage();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue