Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2019-10-16 10:04:58 +0000
committerSravan Kumar Lakkimsetti2019-10-16 10:04:58 +0000
commit4d74459c50568ac931a45ce5e92361c7beed5b56 (patch)
treeb318150c321224466ae447c0f11f1f8c87386c52
parentb848e193393ba44c4b06930565e90ee00e00eaf1 (diff)
downloadeclipse.platform.swt-4d74459c50568ac931a45ce5e92361c7beed5b56.tar.gz
eclipse.platform.swt-4d74459c50568ac931a45ce5e92361c7beed5b56.tar.xz
eclipse.platform.swt-4d74459c50568ac931a45ce5e92361c7beed5b56.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)"
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TaskItem.java2
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 ();

Back to the top