scene: Work around some effects using optimized render path

Some effects (AnimationEffect) transform windows without setting
PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS flag. Make the scene disable
render optimizations if that's the case.

Whether AnimationEffect does a right thing is up to debate.
This commit is contained in:
Vlad Zahorodnii 2022-02-21 19:18:44 +02:00
parent c65523382d
commit 842e46f86f

View file

@ -401,7 +401,7 @@ void Scene::preparePaintSimpleScreen()
for (int i = m_paintContext.phase2Data.size() - 1; i >= 0; --i) {
const auto &paintData = m_paintContext.phase2Data.at(i);
surfaceDamage += paintData.region - opaque;
if (!(paintData.mask & PAINT_WINDOW_TRANSLUCENT)) {
if (!(paintData.mask & (PAINT_WINDOW_TRANSLUCENT | PAINT_WINDOW_TRANSFORMED))) {
opaque += paintData.opaque;
}
}
@ -547,11 +547,15 @@ void Scene::paintSimpleScreen(int, const QRegion &region)
QRegion visible = region;
for (int i = m_paintContext.phase2Data.size() - 1; i >= 0; --i) {
Phase2Data *data = &m_paintContext.phase2Data[i];
const Item *item = data->window->windowItem();
data->region = visible;
data->region = visible & item->mapToGlobal(item->boundingRect());
if (!(data->mask & PAINT_WINDOW_TRANSLUCENT)) {
visible -= data->opaque;
if (!(data->mask & PAINT_WINDOW_TRANSFORMED)) {
const Item *item = data->window->windowItem();
data->region &= item->mapToGlobal(item->boundingRect());
if (!(data->mask & PAINT_WINDOW_TRANSLUCENT)) {
visible -= data->opaque;
}
}
}