[OpenJDK 2D-Dev] [9] RFR JDK-8040635: [macosx] Printing a shape filled with a texture doesn't work under Mac OS X

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Thu Oct 20 08:10:59 UTC 2016

Hi All,

Please review a fix for osx printing where it is seen that TexturePaint 
pattern is not getting printed.

Bug: https://bugs.openjdk.java.net/browse/JDK-8040635
webrev: http://cr.openjdk.java.net/~psadhukhan/8040635/webrev.00/

The issue was because TexturePaint Evaluate function in native 
QuartzSurfaceData.m uses LockImage() function to access texture buffered 
In LockImage(), it accesses image data by checking 
javaImageInfo[sun_java2d_OSXOffScreenSurfaceData_kImageStolenIndex] and

and this variable "kImageStolenIndex" and 
"kNeedToSyncFromJavaPixelsIndex" are set in OSXOffScreenSurfaceData
but OSXSurfaceData uses BufImgSurfaceData.createData which does not set 
this variables
resulting in crash when it tries to access data buffer with wrong unset 

Proposed fix is to use OSXOffscreenSurfaceData where the variables, 
accessed by native,  are set properly.


More information about the 2d-dev mailing list