Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331388 - [Carbon][GC] gc.drawImage(Image, int , int , int , int , int , int , int , int ) do not work.
Summary: [Carbon][GC] gc.drawImage(Image, int , int , int , int , int , int , int , in...
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Silenio Quarti CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-29 20:55 EST by alf CLA
Modified: 2010-12-06 14:56 EST (History)
7 users (show)

See Also:


Attachments
Sample code (278.42 KB, application/zip)
2010-11-29 20:59 EST, alf CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description alf CLA 2010-11-29 20:55:41 EST
Build Identifier: 

This appears to be a bug in SWT on a Mac.  If you have an image that is being drawn on a Canvas, and the image changes, then calling the scaling gc.drawImage () call does not update the Canvas.  No SWTError or Exceptions are thrown.  
Here is an example of the call:
gc.drawImage (offscreenImage, 0, 0, imageSize.width, imageSize.height, 0, 0, smallerWidth, smallerHeight);

Attached is a small sample that illustrates the problem.  The sample is a little convoluted because whenever you draw into an Image object you have to be very careful not to read and write to the image at the same time, hence the MUTEX object.  
To demonstrate the problem, resize the canvas.  If the canvas is larger than 400x400, then the image will change every second.  If it gets smaller than the 400x400 then the image stops being updated. 

An additional note:  
if you change the source width and height slightly in the drawImage call, then this problem goes away.  i.e. add "-1" to imageSize.width in the drawImage call. 

I tested this in carbon 3.4 and 3.5 and cocoa 3.6, this sample work well. But in carbon 3.6.1, it does not work.


Reproducible: Always

Steps to Reproduce:
1. Download Attached sample depending on swt-3.6.1-carbon-macosx.
2. Run MainApp.java in Java application.
3. Change shell size. If the shell is larger than 400x400, then the image will change every second.  If it gets smaller than the 400x400 then the image stops being updated.
Comment 1 alf CLA 2010-11-29 20:59:09 EST
Created attachment 184089 [details]
Sample code
Comment 2 Scott Kovatch CLA 2010-12-06 14:56:27 EST
Carbon is not being updated for 3.7. As this works in Cocoa I'm closing as WONTFIX.