diff options
author | Sravan Kumar Lakkimsetti | 2019-10-16 08:30:11 +0000 |
---|---|---|
committer | Sravan Kumar Lakkimsetti | 2019-10-16 08:30:11 +0000 |
commit | d99c10172944ae97f07afc7bfdbeca6b3dfc1355 (patch) | |
tree | b318150c321224466ae447c0f11f1f8c87386c52 | |
parent | fde4082a50216a4b15c03a8f0f384b961bb953de (diff) | |
download | eclipse.platform.swt-d99c10172944ae97f07afc7bfdbeca6b3dfc1355.tar.gz eclipse.platform.swt-d99c10172944ae97f07afc7bfdbeca6b3dfc1355.tar.xz eclipse.platform.swt-d99c10172944ae97f07afc7bfdbeca6b3dfc1355.zip |
Revert "Bug 310387 - copying new Image(Device device, String filename) can result in black background (was: Black background for icons in Annotations Preference Page)"
This reverts commit fde4082a50216a4b15c03a8f0f384b961bb953de.
Change-Id: If628552b9aa5478ddd1c8ac7668363288f5c2200
4 files changed, 8 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java index 75a9397d1e..152d22434e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java @@ -215,7 +215,7 @@ public Cursor(Device device, int style) { size.height = height; nsImage = nsImage.initWithSize(size); nsImageRep = nsImageRep.initWithBitmapDataPlanes(0, width, height, 8, 4, true, false, OS.NSDeviceRGBColorSpace, - OS.NSAlphaFirstBitmapFormat, width*4, 32); + OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width*4, 32); NSPoint point = new NSPoint(); if (style == SWT.CURSOR_WAIT) { C.memmove(nsImageRep.bitmapData(), WAIT_SOURCE, WAIT_SOURCE.length); @@ -333,7 +333,7 @@ void createNSCursor(int hotspotX, int hotspotY, byte[] buffer, int width, int he nsImage = nsImage.initWithSize(size); nsImageRep = nsImageRep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, - OS.NSAlphaFirstBitmapFormat, width * 4, 32); + OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32); C.memmove(nsImageRep.bitmapData(), buffer, buffer.length); nsImage.addRepresentation(nsImageRep); NSPoint point = new NSPoint(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java index bf05fc53d5..cd4a279669 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java @@ -592,7 +592,7 @@ public void copyArea(Image image, int x, int y) { int width = (int) (size.width * scaling); int height = (int) (size.height * scaling); NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc(); - rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, width * 4, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32); C.memset(rep.bitmapData(), 0xFF, width * height * 4); imageHandle.addRepresentation(rep); rep.release(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java index 8b3f994cdf..478d9da876 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java @@ -1084,7 +1084,7 @@ private NSBitmapImageRep createRepresentation(ImageData imageData, AlphaInfo alp } } - rep = rep.initWithBitmapDataPlanes(0, imageData.width, imageData.height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, bpr, 32); + rep = rep.initWithBitmapDataPlanes(0, imageData.width, imageData.height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); C.memmove(rep.bitmapData(), buffer, dataSize); return rep; } @@ -1461,7 +1461,7 @@ void init(int width, int height) { size.height = height; handle = handle.initWithSize(size); NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc(); - rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, width * 4, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32); C.memset(rep.bitmapData(), 0xFF, width * height * 4); handle.addRepresentation(rep); rep.release(); @@ -1498,7 +1498,7 @@ void initAlpha_200(NSBitmapImageRep nativeRep) { boolean hasAlpha = nativeRep.hasAlpha(); int bpr = width * 4; NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc(); - rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, bpr, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); if (alphaInfo_200 == null) alphaInfo_200 = new AlphaInfo(); alphaInfo_200.init(nativeRep, rep); @@ -1543,7 +1543,7 @@ void initNative(String filename) { size.height = height; handle = handle.initWithSize(size); NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc(); - rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, bpr, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); handle.addRepresentation(rep); rep.release(); handle.setCacheMode(OS.NSImageCacheNever); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java index a8ca20f2ec..f3be9bf4ef 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java @@ -421,7 +421,7 @@ void updateImage () { NSImage newImage = (NSImage)new NSImage().alloc (); newImage = newImage.initWithSize (size); NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep ().alloc (); - rep = rep.initWithBitmapDataPlanes (0, (int)size.width, (int)size.height, 8, 4, true, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, (int)size.width * 4, 32); + rep = rep.initWithBitmapDataPlanes (0, (int)size.width, (int)size.height, 8, 4, true, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, (int)size.width * 4, 32); newImage.addRepresentation (rep); rep.release (); |