Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 546096 - [GTK3] TextEditor toolbar icon wrong transparency
Summary: [GTK3] TextEditor toolbar icon wrong transparency
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.10   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.12 M1   Edit
Assignee: Xi Yan CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-03 15:50 EDT by Xi Yan CLA
Modified: 2019-04-04 10:27 EDT (History)
1 user (show)

See Also:


Attachments
texteditorbad.png (14.34 KB, image/png)
2019-04-03 17:04 EDT, Xi Yan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xi Yan CLA 2019-04-03 15:50:37 EDT
Creating new image via transparencyMask not working as expected. Replace following lines with loading image directly from source input works as before.


Image loadImage(Display display, String fileName) {
		Image image = null;
		try (InputStream sourceStream = getClass().getResourceAsStream(fileName + ".ico")) { //$NON-NLS-1$
			image = new Image(display, sourceStream);
//			ImageData source = new ImageData(sourceStream);
//			ImageData mask = source.getTransparencyMask();
//			image = new Image(display, source, mask);
		} catch (IOException e) {
			showError(getResourceString("Error"), e.getMessage()); //$NON-NLS-1$
		}
		return image;
Comment 1 Eclipse Genie CLA 2019-04-03 16:12:41 EDT
New Gerrit change created: https://git.eclipse.org/r/139987
Comment 2 Andrey Loskutov CLA 2019-04-03 16:47:06 EDT
Is this related to bug 345962? 4.10 as version is also correct? Can you attach a screen shot of the problem?
Comment 3 Andrey Loskutov CLA 2019-04-03 16:48:25 EDT
(In reply to Andrey Loskutov from comment #2)
> Is this related to bug 345962?

I meant bug 345972.
Comment 5 Xi Yan CLA 2019-04-03 17:04:01 EDT
(In reply to Andrey Loskutov from comment #3)
> (In reply to Andrey Loskutov from comment #2)
> > Is this related to bug 345962?
> 
> I meant bug 345972.

Sort of, the issue with bug 345972 is due to transparencyMask not handled correctly for areas of image where pixels are suppose to be transparent. 

There is a similar issue here where loading images natively does not build maskData, and builds an alphaData instead to account for transparency. (i.e. transparencyType is TRANSPARENCY_ALPHA instead of TRANSPARENCY_MASK). So the images are not being displayed correctly, areas are black where it is suppose to be transparent.
Comment 6 Xi Yan CLA 2019-04-03 17:04:58 EDT
Created attachment 278143 [details]
texteditorbad.png
Comment 7 Xi Yan CLA 2019-04-03 17:05:43 EDT
(In reply to Andrey Loskutov from comment #2)
> Is this related to bug 345962? 4.10 as version is also correct? Can you
> attach a screen shot of the problem?

Screenshot of problem attached in comment 6.
Comment 8 Andrey Loskutov CLA 2019-04-03 17:06:24 EDT
(In reply to Xi Yan from comment #6)
> Created attachment 278143 [details]
> texteditorbad.png

Is this an example SWT based editor? In which repo is it?
Comment 9 Xi Yan CLA 2019-04-03 17:12:33 EDT
(In reply to Andrey Loskutov from comment #8)
> (In reply to Xi Yan from comment #6)
> > Created attachment 278143 [details]
> > texteditorbad.png
> 
> Is this an example SWT based editor? In which repo is it?

This is in examples, the same project as ControlExample.
Comment 10 Andrey Loskutov CLA 2019-04-04 07:37:28 EDT
Fixed for me with I20190403-1800. Xi, do you plan to provide more patches on this bug, or can we close it?
Comment 11 Xi Yan CLA 2019-04-04 09:55:50 EDT
(In reply to Andrey Loskutov from comment #10)
> Fixed for me with I20190403-1800. Xi, do you plan to provide more patches on
> this bug, or can we close it?

Thanks for verifying! We can close it.