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>
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 152d224..75a9397 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 @@
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 @@
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 cd4a279..bf05fc5 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 @@
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 478d9da..8b3f994 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 @@
}
}
- 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 @@
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 @@
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 @@
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 f3be9bf..a8ca20f 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 @@
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 ();