mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-24 07:46:42 +00:00
capture_session: detection of idle capture server
This patch enhances the Capture::Connection::Screen such that the bounding box of the affected pixels can be tracked by the caller, which can use this information to adjust its behavior to the activity/inactivity of the capture server. Issue #5344
This commit is contained in:
parent
6d68d3297d
commit
3f1759a4d1
@ -117,8 +117,10 @@ class Capture::Connection::Screen
|
|||||||
|
|
||||||
void with_texture(auto const &fn) const { fn(_texture); }
|
void with_texture(auto const &fn) const { fn(_texture); }
|
||||||
|
|
||||||
void apply_to_surface(Surface<Pixel> &surface)
|
Rect apply_to_surface(Surface<Pixel> &surface)
|
||||||
{
|
{
|
||||||
|
Rect bounding_box { };
|
||||||
|
|
||||||
using Affected_rects = Session::Affected_rects;
|
using Affected_rects = Session::Affected_rects;
|
||||||
|
|
||||||
Affected_rects const affected = _connection.capture_at(Capture::Point(0, 0));
|
Affected_rects const affected = _connection.capture_at(Capture::Point(0, 0));
|
||||||
@ -130,8 +132,13 @@ class Capture::Connection::Screen
|
|||||||
surface.clip(rect);
|
surface.clip(rect);
|
||||||
|
|
||||||
Blit_painter::paint(surface, texture, Capture::Point(0, 0));
|
Blit_painter::paint(surface, texture, Capture::Point(0, 0));
|
||||||
|
|
||||||
|
bounding_box = bounding_box.area.count()
|
||||||
|
? Rect::compound(bounding_box, rect)
|
||||||
|
: rect;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
return bounding_box;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user