提交 3f684aff 编写于 作者: S serb

8038765: [macosx] Toolkit.sync should be implemented

Reviewed-by: pchelko, anthony
上级 13ff7c3d
......@@ -44,6 +44,7 @@ import java.net.MalformedURLException;
import sun.awt.*;
import sun.awt.datatransfer.DataTransferer;
import sun.java2d.opengl.OGLRenderQueue;
import sun.lwawt.*;
import sun.lwawt.LWWindowPeer.PeerType;
import sun.security.action.GetBooleanAction;
......@@ -409,7 +410,11 @@ public final class LWCToolkit extends LWToolkit {
@Override
public void sync() {
// TODO Auto-generated method stub
// flush the OGL pipeline (this is a no-op if OGL is not enabled)
OGLRenderQueue.sync();
// setNeedsDisplay() selector was sent to the appropriate CALayer so now
// we have to flush the native selectors queue.
flushNativeSelectors();
}
@Override
......@@ -799,6 +804,11 @@ public final class LWCToolkit extends LWToolkit {
private native boolean nativeSyncQueue(long timeout);
/**
* Just spin a single empty block synchronously.
*/
private static native void flushNativeSelectors();
@Override
public Clipboard createPlatformClipboard() {
return new CClipboard("System");
......
......@@ -111,6 +111,18 @@ JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_LWCToolkit_nativeSyncQueue
return JNI_FALSE;
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: flushNativeSelectors
* Signature: ()J
*/
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_flushNativeSelectors
(JNIEnv *env, jclass clz)
{
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){}];
JNF_COCOA_EXIT(env);
}
static JNF_CLASS_CACHE(jc_Component, "java/awt/Component");
static JNF_MEMBER_CACHE(jf_Component_appContext, jc_Component, "appContext", "Lsun/awt/AppContext;");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册