[OpenJDK 2D-Dev]  Review request for 8163889: [macosx] Can't print from browser on Mac OS X
dmitry.markov at oracle.com
Sat Jan 14 14:52:09 UTC 2017
Could you review a fix for jdk9, please?
Several functions inside ImageSurfaceData.m, (e.g. customPixelsFromJava(), customPixelsToJava(), etc.) invoke getJNIEnv() from ThreadUtilities instead of usage corresponding input parameter. According to the design - getJNIEnv() should be executed on AppKit thread, but all code related to printing should NOT run on AppKit thread. So we get the following assert here - ‘CocoaAWT: Not running on AppKit thread 0 when expected.’
Also customPixelsFromJava() and customPixelsToJava() call OSXOffScreenSurfaceData.syncFromCustom() and OSXOffScreenSurfaceData.syncToCustom(), but these methods are absent at Java layer. So when we try to perform such JNI invocation we experience the crash.
It is necessary to eliminate negative effects such as crashes, native exceptions and assert errors during printing.
- Replaced invocation of getJNIEnv() with usage of corresponding input parameter.
- Added method stubs to OSXOffScreenSurfaceData.
More information about the 2d-dev