platform: Use damage tracked by SurfaceItem

There is no need for both kwin and kwaylandserver track damage.
This commit is contained in:
Vlad Zahorodnii 2021-02-04 10:45:18 +02:00
parent 2ade92d69b
commit 326d211691
3 changed files with 1 additions and 19 deletions

View file

@ -424,9 +424,6 @@ bool AbstractEglTexture::loadTexture(WindowPixmap *pixmap)
return false;
}
// try Wayland loading
if (auto s = pixmap->surface()) {
s->resetTrackedDamage();
}
if (buffer->linuxDmabufBuffer()) {
return loadDmabufTexture(buffer);
} else if (buffer->shmBuffer()) {
@ -461,9 +458,6 @@ void AbstractEglTexture::updateTexture(WindowPixmap *pixmap, const QRegion &regi
// The origin in a dmabuf-buffer is at the upper-left corner, so the meaning
// of Y-inverted is the inverse of OpenGL.
q->setYInverted(!(dmabuf->flags() & KWaylandServer::LinuxDmabufUnstableV1Interface::YInverted));
if (s) {
s->resetTrackedDamage();
}
return;
}
if (!buffer->shmBuffer()) {
@ -476,9 +470,6 @@ void AbstractEglTexture::updateTexture(WindowPixmap *pixmap, const QRegion &regi
}
m_image = image;
}
if (s) {
s->resetTrackedDamage();
}
return;
}
// shm fallback
@ -487,8 +478,7 @@ void AbstractEglTexture::updateTexture(WindowPixmap *pixmap, const QRegion &regi
return;
}
Q_ASSERT(image.size() == m_size);
const QRegion damage = s->mapToBuffer(s->trackedDamage());
s->resetTrackedDamage();
const QRegion damage = s->mapToBuffer(region);
// TODO: this should be shared with GLTexture::update
createTextureSubImage(image, damage);

View file

@ -599,7 +599,6 @@ bool EglStreamTexture::loadTexture(WindowPixmap *pixmap)
attachBuffer(surface->buffer());
createFbo();
surface->resetTrackedDamage();
if (acquireStreamFrame(st->stream)) {
copyExternalTexture(st->texture);
@ -624,7 +623,6 @@ void EglStreamTexture::updateTexture(WindowPixmap *pixmap, const QRegion &region
if (attachBuffer(surface->buffer())) {
createFbo();
}
surface->resetTrackedDamage();
if (acquireStreamFrame(st->stream)) {
copyExternalTexture(st->texture);

View file

@ -370,9 +370,6 @@ void QPainterWindowPixmap::create()
}
// performing deep copy, this could probably be improved
m_image = buffer()->data().copy();
if (auto s = surface()) {
s->resetTrackedDamage();
}
}
void QPainterWindowPixmap::update()
@ -394,9 +391,6 @@ void QPainterWindowPixmap::update()
}
// perform deep copy
m_image = b->data().copy();
if (auto s = surface()) {
s->resetTrackedDamage();
}
}
bool QPainterWindowPixmap::isValid() const