screencast: Skip frames with no damage
Instead of issuing a full redraw. We'll be calling outputChanged when uploading to drm, there's no need to stream that as well.
This commit is contained in:
parent
f7bd6ef6c1
commit
d054b12123
1 changed files with 2 additions and 2 deletions
|
@ -141,13 +141,13 @@ void ScreencastManager::streamOutput(KWaylandServer::ScreencastStreamV1Interface
|
|||
auto bufferToStream = [streamOutput, stream] (const QRegion &damagedRegion) {
|
||||
auto scene = Compositor::self()->scene();
|
||||
auto texture = scene->textureForOutput(streamOutput);
|
||||
if (!texture) {
|
||||
if (!texture || damagedRegion.isEmpty()) {
|
||||
// Some backends will return no-op because textures aren't really supported there
|
||||
return;
|
||||
}
|
||||
|
||||
const QRect frame({}, streamOutput->modeSize());
|
||||
const QRegion region = damagedRegion.isEmpty() || streamOutput->pixelSize() != streamOutput->modeSize() ? frame : damagedRegion.translated(-streamOutput->geometry().topLeft()).intersected(frame);
|
||||
const QRegion region = streamOutput->pixelSize() != streamOutput->modeSize() ? frame : damagedRegion.translated(-streamOutput->geometry().topLeft()).intersected(frame);
|
||||
stream->recordFrame(texture.data(), region);
|
||||
};
|
||||
connect(stream, &PipeWireStream::startStreaming, waylandStream, [streamOutput, stream, bufferToStream] {
|
||||
|
|
Loading…
Reference in a new issue