Computation of shadows on shaped windows too slow for hidpi displays

Bug #1623702 reported by Harm van Bakel on 2016-09-14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unity (Ubuntu)

Bug Description

Unity 7.4.0+16.04.20160801.2-0ubuntu1 included a patch to add shadows to shaped windows (bug #1608418) such as chromium with default borders or certain wine/crossover office applications (e.g. office 2010). Unfortunately this patch makes window switching to and from shaped windows applications excruciatingly slow on a 4k hidipi display. For example, switching to a crossover office application window takes about 2 seconds and the rendering of the dropshadow is delayed by another two seconds.

Moving or resizing a shaped window is just as bad - when reducing the size of a shaped window, 'echos' of the shadow of the original window size will be progressively redrawn to match the smaller window size, with a significant delay to the actual window resize operation. The end result is that Unity starts to lag considerably when even one shaped window is open.

The performance impact is likely much less prominent on standard displays as I've noticed that reducing the window size also reduces the window switching delays - i.e. the computation time seems to scale with the pixel surface area of the shadow being displayed.

While the shadows are aesthetically pleasing, it would be much preferable to revert the patch until the performance issues on hidpi displays can be resolved.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: unity 7.4.0+16.04.20160906-0ubuntu1
Uname: Linux 4.8.0-040800rc6-generic x86_64

ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64

CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: compiz
CompositorUnredirectDriverBlacklist: '(nouveau|Intel).*Mesa 8.0'
CompositorUnredirectFSW: true
CurrentDesktop: Unity
Date: Wed Sep 14 18:28:55 2016
DistUpgraded: Fresh install
DistroCodename: xenial
DistroVariant: ubuntu
 virtualbox, 5.0.24, 4.4.0-38-generic, x86_64: installed
 virtualbox, 5.0.24, 4.8.0-040800rc6-generic, x86_64: installed
EcryptfsInUse: Yes
 Intel Corporation Sky Lake Integrated Graphics [8086:1926] (rev 0a) (prog-if 00 [VGA controller])
   Subsystem: Dell Skylake Integrated Graphics [1028:0704]
InstallationDate: Installed on 2016-09-09 (5 days ago)
InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
MachineType: Dell Inc. XPS 13 9350
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.8.0-040800rc6-generic root=UUID=9ea8050f-e2c0-45a1-97b4-b8991d475c6e ro quiet splash vt.handoff=7
SourcePackage: unity
UpgradeStatus: No upgrade log present (probably fresh install) 06/14/2016
dmi.bios.vendor: Dell Inc.
dmi.bios.version: 1.4.4 09JHRY
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 9
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvr1.4.4:bd06/14/2016:svnDellInc.:pnXPS139350:pvr:rvnDellInc.:rn09JHRY:rvrA00:cvnDellInc.:ct9:cvr: XPS 13 9350
dmi.sys.vendor: Dell Inc.
version.compiz: compiz 1:
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.67-1ubuntu0.16.04.2
version.libgl1-mesa-dri: libgl1-mesa-dri 11.2.0-1ubuntu2.2
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 11.2.0-1ubuntu2.2
version.xserver-xorg-core: xserver-xorg-core 2:1.18.4-0ubuntu0.1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.10.1-1ubuntu2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:7.7.0-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20160325-1ubuntu1.1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.12-1build2
xserver.bootTime: Wed Sep 14 18:14:31 2016
xserver.configfile: default

xserver.logfile: /var/log/Xorg.0.log
 product id 5194
 vendor SHP
xserver.version: 2:1.18.4-0ubuntu0.1

Harm van Bakel (hvbakel) wrote :
madbiologist (me-again) wrote :

You can disable this feature by installing CompizConfig and selecting "Unity Plugin", then select the Decorations tab and deselect "Override Theme Settings".

Harm van Bakel (hvbakel) wrote :

Thanks but the theme override doesn't prevent drop shadows being drawn for shaped windows and window drawing performance remains similarly affected.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity (Ubuntu):
status: New → Confirmed


1. Using the RecordMyDesktop application, record a demo of this bug.
2. Attach the video to this bug report.
3. Set status back to "confirmed".

Thank you.

Changed in unity (Ubuntu):
status: Confirmed → Incomplete
Harm van Bakel (hvbakel) wrote :

The attached video demonstrates the delay in drawing of shadows on shaped windows during resizes. The delay is worse when there are more windows open.

Harm van Bakel (hvbakel) wrote :

Here is another example demonstrating a small delay in drawing the focus shadow when switching windows. Switching between gedit windows is fast, but there is a noticeable delay in drawing the darker drop shadow when the crossover office window is selected.

Changed in unity (Ubuntu):
status: Incomplete → Confirmed
Changed in unity (Ubuntu):
importance: Undecided → High
Changed in unity (Ubuntu):
assignee: nobody → Eleni Maria Stea (hikiko)
Changed in unity (Ubuntu):
assignee: Eleni Maria Stea (hikiko) → nobody
Harm van Bakel (hvbakel) wrote :

As there was a recent round of bug-fixing for unity, any chance this issue could be addressed as well?

madbiologist (me-again) wrote :

It looks like this might have been fixed yesterday

To post a comment you must log in.