scene: prefer calling mapToGlobal just once

It's the same top mapToGlobal()+operator& than the other way around and
we get to skip 1 call.
This path is the most common so we better save it.
master
Aleix Pol 2020-09-29 16:16:59 +02:00 committed by Aleix Pol Gonzalez
parent db202f5c26
commit f558115def
1 changed files with 3 additions and 3 deletions

View File

@ -289,9 +289,9 @@ void Scene::paintSimpleScreen(int orig_mask, const QRegion &region)
} else if (toplevel->hasAlpha() && toplevel->opacity() == 1.0) { } else if (toplevel->hasAlpha() && toplevel->opacity() == 1.0) {
const WindowPixmap *windowPixmap = window->windowPixmap<WindowPixmap>(); const WindowPixmap *windowPixmap = window->windowPixmap<WindowPixmap>();
if (windowPixmap) { if (windowPixmap) {
const QRegion shape = windowPixmap->mapToGlobal(windowPixmap->shape()); const QRegion shape = windowPixmap->shape();
const QRegion opaque = windowPixmap->mapToGlobal(windowPixmap->opaque()); const QRegion opaque = windowPixmap->opaque();
data.clip = shape & opaque; data.clip = windowPixmap->mapToGlobal(shape & opaque);
if (opaque == shape) { if (opaque == shape) {
data.mask = orig_mask | PAINT_WINDOW_OPAQUE; data.mask = orig_mask | PAINT_WINDOW_OPAQUE;