United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 2224942 [macosx] DnD test failure in createCompatibleWritableRaster()
2224942 : [macosx] DnD test failure in createCompatibleWritableRaster()

Details
Type:
Backport
Submit Date:
2012-05-25
Status:
Closed
Updated Date:
2012-06-20
Project Name:
JDK
Resolved Date:
2012-06-20
Component:
client-libs
OS:
Sub-Component:
2d
CPU:
Priority:
P3
Resolution:
Fixed
Affected Versions:
Fixed Versions:
8

Related Reports
Backport:

Sub Tasks

Description
                                    

Comments
SUGGESTED FIX

http://cr.openjdk.java.net/~bae/7146550/webrev.01/
                                     
2012-05-25
EVALUATION

DnD code does not check whether a toolkit image is ready to be painted
 into a buffer. We have to do this check in order to get correct image
 dimension.

 Suggested fix just delegates the conversion of toolkit image into a
 CImage instance to a helper class CImage.Creator. This helper class
 provides two ways to convert a toolkit image int CImage:

   - immediate conversion: returns valid CImage only if toolkit image
      has valid dimension, and null otherwise.
     Immediate conversion works fine for toolkit images which are
     prepared in advance, or are based on memory image source.

   - normal conversion: a toolkit image is prepared for rendering using
      a media tracker.

 We can not use the normal conversion in case of DnD, because broken
 toolkit image (whose producer never updates the image state for any
 reasons) can cause a hang in the DnD the code (test in question
 implements such scenario).

 If supplied drag image can not be conversed to CImage (either an
 exception is thrown or it is not ready, i.e. a result of conversion
 is null for any reasons) the InvalidDnDOperationException is thrown
 in order to notify user about the problem with drag image.
 Note that such approach is already used on windows platform, so with
 this fix, macosx behaves in a uniform way with windows.

 Beside this, this fix pushes the drag image (an instance of CImage)
 down to native DnD machinery in order to be able to display drag
 images.
                                     
2012-05-25



Hardware and Software, Engineered to Work Together