Bug 571242 - [GTK] Missing icons for p2 import wizards
Summary: [GTK] Missing icons for p2 import wizards
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.19   Edit
Hardware: PC Linux
: P3 blocker (vote)
Target Milestone: 4.19 M3   Edit
Assignee: Sravan Kumar Lakkimsetti CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: 569691
  Show dependency tree
 
Reported: 2021-02-17 03:58 EST by Andrey Loskutov CLA
Modified: 2021-02-18 04:27 EST (History)
2 users (show)

See Also:


Attachments
missing icons (37.44 KB, image/png)
2021-02-17 03:58 EST, Andrey Loskutov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2021-02-17 03:58:38 EST
Created attachment 285575 [details]
missing icons

File -> Import -> wizards don't have icons in I20210216-2020, see attachment.

Haven't checked if that is Linux only issue, if yes, bug 571166 could be the root cause.
Comment 1 Andrey Loskutov CLA 2021-02-17 04:15:55 EST
Ok, this is the regression on GTK only from bug 571166 that tried to fix regression from bug 569691.

The icons in rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui.importexport/icons/wizban/install_wiz.png are 75 x 65 pixel big but scaled to 16x16 in the wizard list, so most likely some new code doesn't do that right...
Comment 2 Andrey Loskutov CLA 2021-02-17 04:23:35 EST
Sravan, could you please check that? That one seem to be an opposite to bug 569691 - too big icons aren't shown anymore.
Comment 3 Christoph Laeubrich CLA 2021-02-17 04:31:32 EST
just curious could you try to change the icon from 75 x 65  to 75 x 75 if that fixes the issue?
Comment 4 Andrey Loskutov CLA 2021-02-17 05:11:29 EST
(In reply to Christoph Laeubrich from comment #3)
> just curious could you try to change the icon from 75 x 65  to 75 x 75 if
> that fixes the issue?

No, it doesn't. Note, I've created a bug 571246 for p2 to fix the icons, but that is unrelated to this one because p2 might be not the only client with "wrongly sized" icons.
Comment 5 Andrey Loskutov CLA 2021-02-17 05:51:31 EST
org.eclipse.swt.graphics.Image.Image(Device, ImageFileNameProvider) constructor is involved. It calls Image.createFromPixbuf(int, long).
I see that at least original image size is properly read from GDK.
After all, it goes through TreeItem.setImage(int, Image) and calls ImageList.createPixbuf(Image).
Also here I see that image dimensions are still OK.

After that in ImageList.set(int, Image) we call ImageList.scaleSurface(Image, int, int) and here we are asked to re-scale the image to 16x16. I assume this is where things go wrong, and this code is also new for bug 569691.

I assume that the code below in ImageList.scaleSurface() has an issue:

// scaleX/ scaleY seem to be righ tin debugger
Cairo.cairo_scale(cairo, scaleX, scaleY);
Cairo.cairo_set_operator(cairo, Cairo.CAIRO_OPERATOR_SOURCE);
Cairo.cairo_set_source_surface(cairo, image.surface, 0, 0);
Cairo.cairo_paint(cairo);
Cairo.cairo_destroy(cairo);
Comment 6 Andrey Loskutov CLA 2021-02-17 06:15:39 EST
(In reply to Andrey Loskutov from comment #5)
> I assume that the code below in ImageList.scaleSurface() has an issue:
> 
> // scaleX/ scaleY seem to be righ tin debugger
> Cairo.cairo_scale(cairo, scaleX, scaleY);
> Cairo.cairo_set_operator(cairo, Cairo.CAIRO_OPERATOR_SOURCE);
> Cairo.cairo_set_source_surface(cairo, image.surface, 0, 0);
> Cairo.cairo_paint(cairo);
> Cairo.cairo_destroy(cairo);

But I see that other "scaled" icons are OK (both up/down scaled), using same code. So is that something special with p2 icons format?
Comment 7 Sravan Kumar Lakkimsetti CLA 2021-02-17 07:51:18 EST
We are still using pixbuf in case of tree and table. With earlier patches we are scaling surface and it is being used almost every where except for tree and table. 

The problem reported here is caused because of unscaled pixbufs in tree and table. 

Patch is coming shortly
Comment 8 Eclipse Genie CLA 2021-02-17 07:59:39 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176408
Comment 9 Sravan Kumar Lakkimsetti CLA 2021-02-17 08:21:08 EST
Merged to master now
Comment 11 Sravan Kumar Lakkimsetti CLA 2021-02-17 23:24:41 EST
Verified in
Eclipse SDK
Version: 2021-03 (4.19)
Build id: I20210217-1800
OS: Linux, v.5.4.0-65-generic, x86_64 / gtk 3.24.20
Java version: 11.0.10
Comment 12 Andrey Loskutov CLA 2021-02-18 04:26:40 EST
Thanks Sravan!!!