summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Kovatch <skovatch>2010-11-05 21:30:31 +0000
committerScott Kovatch <skovatch>2010-11-05 21:30:31 +0000
commit475e439e4759a6c2dcfaf3351506dbb3f18de1a4 (patch)
tree2832dd537ac72a18facd6ecc83fb6581269df5a6
parent856b7bca73d8f00eddc1ee12b39576510291716a (diff)
downloadeclipse.platform.swt-475e439e4759a6c2dcfaf3351506dbb3f18de1a4.tar.gz
eclipse.platform.swt-475e439e4759a6c2dcfaf3351506dbb3f18de1a4.tar.xz
eclipse.platform.swt-475e439e4759a6c2dcfaf3351506dbb3f18de1a4.zip
329569 - no need for conditional code in Image.
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java12
1 files changed, 4 insertions, 8 deletions
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 f06d8a8f61..2ccfd06cae 100755
--- 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
@@ -248,8 +248,7 @@ public Image(Device device, Image srcImage, int flag) {
handle = (NSImage)new NSImage().alloc();
handle = handle.initWithSize(size);
NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
- NSString colorspace = (OS.VERSION < 0x1060) ? OS.NSCalibratedRGBColorSpace : OS.NSDeviceRGBColorSpace;
- rep = rep.initWithBitmapDataPlanes(0, width, height, srcRep.bitsPerSample(), srcRep.samplesPerPixel(), srcRep.hasAlpha(), srcRep.isPlanar(), colorspace, format, srcRep.bytesPerRow(), bpp);
+ rep = rep.initWithBitmapDataPlanes(0, width, height, srcRep.bitsPerSample(), srcRep.samplesPerPixel(), srcRep.hasAlpha(), srcRep.isPlanar(), OS.NSCalibratedRGBColorSpace, format, srcRep.bytesPerRow(), bpp);
handle.addRepresentation(rep);
rep.release();
handle.setCacheMode(OS.NSImageCacheNever);
@@ -845,8 +844,7 @@ void init(int width, int height) {
size.height = height;
handle = handle.initWithSize(size);
NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
- NSString colorspace = (OS.VERSION < 0x1060) ? OS.NSCalibratedRGBColorSpace : OS.NSDeviceRGBColorSpace;
- rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, colorspace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32);
+ rep = rep.initWithBitmapDataPlanes(0, width, height, 8, 3, false, false, OS.NSCalibratedRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32);
OS.memset(rep.bitmapData(), 0xFF, width * height * 4);
handle.addRepresentation(rep);
rep.release();
@@ -960,8 +958,7 @@ void init(ImageData image) {
size.height = height;
handle = handle.initWithSize(size);
NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
- NSString colorspace = (OS.VERSION < 0x1060) ? OS.NSCalibratedRGBColorSpace : OS.NSDeviceRGBColorSpace;
- rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, colorspace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32);
+ rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSCalibratedRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32);
OS.memmove(rep.bitmapData(), buffer, dataSize);
handle.addRepresentation(rep);
rep.release();
@@ -1003,8 +1000,7 @@ void initNative(String filename) {
size.height = height;
handle = handle.initWithSize(size);
NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
- NSString nscolorspace = (OS.VERSION < 0x1060) ? OS.NSCalibratedRGBColorSpace : OS.NSDeviceRGBColorSpace;
- rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, nscolorspace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32);
+ rep = rep.initWithBitmapDataPlanes(0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSCalibratedRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32);
handle.addRepresentation(rep);
rep.release();
handle.setCacheMode(OS.NSImageCacheNever);