From f558115defb470c615ed6c17a9221b054ab8735a Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 29 Sep 2020 16:16:59 +0200 Subject: [PATCH] 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. --- scene.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene.cpp b/scene.cpp index 410372767..9197e8026 100644 --- a/scene.cpp +++ b/scene.cpp @@ -289,9 +289,9 @@ void Scene::paintSimpleScreen(int orig_mask, const QRegion ®ion) } else if (toplevel->hasAlpha() && toplevel->opacity() == 1.0) { const WindowPixmap *windowPixmap = window->windowPixmap(); if (windowPixmap) { - const QRegion shape = windowPixmap->mapToGlobal(windowPixmap->shape()); - const QRegion opaque = windowPixmap->mapToGlobal(windowPixmap->opaque()); - data.clip = shape & opaque; + const QRegion shape = windowPixmap->shape(); + const QRegion opaque = windowPixmap->opaque(); + data.clip = windowPixmap->mapToGlobal(shape & opaque); if (opaque == shape) { data.mask = orig_mask | PAINT_WINDOW_OPAQUE;