diff options
author | Silenio Quarti <silenio> | 2005-10-20 20:08:14 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2005-10-20 20:08:14 +0000 |
commit | ccd621274ed9e97d00a3d7cf47210de6e1daa05c (patch) | |
tree | fb2b506fc83d11f29990840bdab06d8aa9977ca4 | |
parent | 7f9dc8104b76a609a5e67f58367b8050b088975e (diff) | |
download | eclipse.platform.swt-ccd621274ed9e97d00a3d7cf47210de6e1daa05c.tar.gz eclipse.platform.swt-ccd621274ed9e97d00a3d7cf47210de6e1daa05c.tar.xz eclipse.platform.swt-ccd621274ed9e97d00a3d7cf47210de6e1daa05c.zip |
85539 - copyArea image area without compositing
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java index 5b30f87f59..1e74604607 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java @@ -310,8 +310,16 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d rect.y = destY; rect.width = width; rect.height = height; - //NOT DONE - transparency - OS.CGContextDrawImage(handle, rect, data.image.handle); + int h = OS.CGImageGetHeight(data.image.handle); + int bpr = OS.CGImageGetBytesPerRow(data.image.handle); + int provider = OS.CGDataProviderCreateWithData(0, data.image.data, bpr * h, 0); + if (provider != 0) { + int colorspace = device.colorspace; + int img = OS.CGImageCreate(width, height, 8, 32, bpr, colorspace, OS.kCGImageAlphaNoneSkipFirst, provider, null, true, 0); + OS.CGDataProviderRelease(provider); + OS.CGContextDrawImage(handle, rect, img); + OS.CGImageRelease(img); + } OS.CGContextRestoreGState(handle); return; } |