Bug 575553 - [performance] cache CTabFolder backgroundImage bounds
Summary: [performance] cache CTabFolder backgroundImage bounds
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.21   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.21 RC1   Edit
Assignee: Jörg Kubitz CLA
QA Contact: Niraj Modi CLA
URL:
Whiteboard:
Keywords: performance
Depends on: 576287
Blocks: 575658 574015
  Show dependency tree
 
Reported: 2021-08-21 15:25 EDT by Jörg Kubitz CLA
Modified: 2021-12-31 10:16 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Kubitz CLA 2021-08-21 15:25:47 EDT
When i resize eclipse window the repaint feels rather slow.
As far as i see one reason is that the CTabFolder backgroundimages are disposed and recreated (involving drawing an image and the new costly disposetracking). Why would you do so? The background doesnt change.
There is already a check in setButtonBounds() if updateBkImages() needs to be called but it fails to detect that the background was only moved but did not realy change.

Well, lets cache the old size and only repaint if changed.
Comment 1 Eclipse Genie CLA 2021-08-21 15:32:51 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/184288
Comment 3 Niraj Modi CLA 2021-08-24 04:06:38 EDT
(In reply to Eclipse Genie from comment #2)
> Gerrit change
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/184288 was
> merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=584fc122be5067521f2ce395e5e0b049eefb8f55

Thanks Joerg for the fix, resolving now.
Comment 4 Jörg Kubitz CLA 2021-08-24 04:16:01 EDT
Thanks for review, Niraj!
Comment 5 Lars Vogel CLA 2021-08-24 05:43:41 EDT
Thanks, Jörg.
Comment 6 Rolf Theunissen CLA 2021-12-31 10:16:29 EST
This change causes a regression, see Bug 576287.

Furthermore, it creates regressions for horizontal gradients, i.e. the background should be updated when the width changes. However, the background images for horizontal gradients are broken anyhow. You can use the snippet in Bug 576287 with horizontal gradient to test.