diff options
author | Sravan Kumar Lakkimsetti | 2019-10-16 11:34:28 +0000 |
---|---|---|
committer | Sravan Kumar Lakkimsetti | 2019-10-16 11:35:15 +0000 |
commit | db32297c3480fbf7201ede7af40f434461edf35f (patch) | |
tree | 18a658c6325602e5fe28f7827f67e6d15f9c1dda | |
parent | 53d450854a768db924003aaead9d7df6e96f7fe8 (diff) | |
download | eclipse.platform.swt-db32297c3480fbf7201ede7af40f434461edf35f.tar.gz eclipse.platform.swt-db32297c3480fbf7201ede7af40f434461edf35f.tar.xz eclipse.platform.swt-db32297c3480fbf7201ede7af40f434461edf35f.zip |
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 4d74459c50568ac931a45ce5e92361c7beed5b56.
Change-Id: Ia67966d58c5ac22db6b0ee55587a5425cb1607f3
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
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 152d22434e..75a9397d1e 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 | OS.NSAlphaNonpremultipliedBitmapFormat, width*4, 32); + OS.NSAlphaFirstBitmapFormat, 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 | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32); + OS.NSAlphaFirstBitmapFormat, 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 cd4a279669..bf05fc53d5 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 | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, 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 478d9da876..8b3f994cdf 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 | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); + rep = rep.initWithBitmapDataPlanes(0, imageData.width, imageData.height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, 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 | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, 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 | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, 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 | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32); + rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, 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 f3be9bf4ef..a8ca20f2ec 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 | OS.NSAlphaNonpremultipliedBitmapFormat, (int)size.width * 4, 32); + rep = rep.initWithBitmapDataPlanes (0, (int)size.width, (int)size.height, 8, 4, true, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat, (int)size.width * 4, 32); newImage.addRepresentation (rep); rep.release (); |