Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2019-07-22 05:06:44 +0000
committerSravan Kumar Lakkimsetti2019-10-16 09:58:08 +0000
commitb848e193393ba44c4b06930565e90ee00e00eaf1 (patch)
treeb5fac808dcee1ab5aaa0db33f06c7cbaa7cdbb6b
parentd99c10172944ae97f07afc7bfdbeca6b3dfc1355 (diff)
downloadeclipse.platform.swt-b848e193393ba44c4b06930565e90ee00e00eaf1.tar.gz
eclipse.platform.swt-b848e193393ba44c4b06930565e90ee00e00eaf1.tar.xz
eclipse.platform.swt-b848e193393ba44c4b06930565e90ee00e00eaf1.zip
Bug 310387 - copying new Image(Device device, String filename) can
result in black background (was: Black background for icons in Annotations Preference Page) Change-Id: I2e37d7c72ecd7f809a9efc33af3a25e5fe714cf1 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-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 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 ();

Back to the top