Commit 326d2116 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

platform: Use damage tracked by SurfaceItem

There is no need for both kwin and kwaylandserver track damage.
parent 2ade92d6
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment