Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e26b7a57
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e26b7a57
编写于
8月 27, 2019
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8146238: [macosx] Java2D Queue Flusher crash on OSX after switching between user accounts
Reviewed-by: prr, avu
上级
05aca2da
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
80 addition
and
116 deletion
+80
-116
src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java
src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java
+6
-5
src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m
src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m
+15
-26
src/share/classes/sun/java2d/opengl/OGLSurfaceData.java
src/share/classes/sun/java2d/opengl/OGLSurfaceData.java
+5
-4
src/share/native/sun/java2d/opengl/OGLSurfaceData.c
src/share/native/sun/java2d/opengl/OGLSurfaceData.c
+7
-5
src/share/native/sun/java2d/opengl/OGLSurfaceData.h
src/share/native/sun/java2d/opengl/OGLSurfaceData.h
+5
-1
src/solaris/classes/sun/java2d/opengl/GLXSurfaceData.java
src/solaris/classes/sun/java2d/opengl/GLXSurfaceData.java
+3
-2
src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c
src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c
+15
-39
src/windows/classes/sun/java2d/opengl/WGLSurfaceData.java
src/windows/classes/sun/java2d/opengl/WGLSurfaceData.java
+3
-3
src/windows/native/sun/java2d/opengl/WGLSurfaceData.c
src/windows/native/sun/java2d/opengl/WGLSurfaceData.c
+21
-31
未找到文件。
src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java
浏览文件 @
e26b7a57
/*
* Copyright (c) 2011, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -48,8 +48,9 @@ public abstract class CGLSurfaceData extends OGLSurfaceData {
native
void
validate
(
int
xoff
,
int
yoff
,
int
width
,
int
height
,
boolean
isOpaque
);
private
native
void
initOps
(
long
pConfigInfo
,
long
pPeerData
,
long
layerPtr
,
int
xoff
,
int
yoff
,
boolean
isOpaque
);
private
native
void
initOps
(
OGLGraphicsConfig
gc
,
long
pConfigInfo
,
long
pPeerData
,
long
layerPtr
,
int
xoff
,
int
yoff
,
boolean
isOpaque
);
protected
native
boolean
initPbuffer
(
long
pData
,
long
pConfigInfo
,
boolean
isOpaque
,
int
width
,
int
height
);
...
...
@@ -77,7 +78,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData {
pPeerData
=
pView
.
getAWTView
();
isOpaque
=
pView
.
isOpaque
();
}
initOps
(
pConfigInfo
,
pPeerData
,
0
,
0
,
0
,
isOpaque
);
initOps
(
gc
,
pConfigInfo
,
pPeerData
,
0
,
0
,
0
,
isOpaque
);
}
protected
CGLSurfaceData
(
CGLLayer
layer
,
CGLGraphicsConfig
gc
,
...
...
@@ -93,7 +94,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData {
layerPtr
=
layer
.
getPointer
();
isOpaque
=
layer
.
isOpaque
();
}
initOps
(
pConfigInfo
,
0
,
layerPtr
,
0
,
0
,
isOpaque
);
initOps
(
gc
,
pConfigInfo
,
0
,
layerPtr
,
0
,
0
,
isOpaque
);
}
@Override
//SurfaceData
...
...
src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m
浏览文件 @
e26b7a57
...
...
@@ -144,31 +144,6 @@ JNF_COCOA_ENTER(env);
JNF
_
COCOA
_
EXIT
(
env
)
;
}
/**
* Returns a pointer (as a jlong) to the native CGLGraphicsConfigInfo
* associated with the given OGLSDOps. This method can be called from
* shared code to retrieve the native GraphicsConfig data in a platform-
* independent manner.
*/
jlong
OGLSD_GetNativeConfigInfo(OGLSDOps *oglsdo)
{
J2dTraceLn(J2D_TRACE_INFO, "OGLSD_GetNativeConfigInfo");
if (oglsdo == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR, "OGLSD_GetNativeConfigInfo: ops are null");
return 0L;
}
CGLSDOps *cglsdo = (CGLSDOps *)oglsdo->privOps;
if (cglsdo == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR, "OGLSD_GetNativeConfigInfo: cgl ops are null");
return 0L;
}
return ptr_to_jlong(cglsdo->configInfo);
}
/**
*
Makes
the
given
GraphicsConfig
'
s
context
current
to
its
associated
*
"scratch"
surface
.
If
there
is
a
problem
making
the
context
current
,
...
...
@@ -411,7 +386,7 @@ extern DisposeFunc OGLSD_Dispose;
JNIEXPORT
void
JNICALL
Java
_
sun
_
java2d
_
opengl
_
CGLSurfaceData
_
initOps
(JNIEnv *env, jobject cglsd,
(
JNIEnv
*
env
,
jobject
cglsd
,
jobject
gc
,
jlong
pConfigInfo
,
jlong
pPeerData
,
jlong
layerPtr
,
jint
xoff
,
jint
yoff
,
jboolean
isOpaque
)
{
...
...
@@ -419,8 +394,22 @@ Java_sun_java2d_opengl_CGLSurfaceData_initOps
J2dTraceLn1
(
J2D
_
TRACE
_
INFO
,
" pPeerData=%p"
,
jlong
_
to
_
ptr
(
pPeerData
))
;
J2dTraceLn2
(
J2D
_
TRACE
_
INFO
,
" xoff=%d, yoff=%d"
,
(
int
)
xoff
,
(
int
)
yoff
)
;
gc
=
(*env)->NewGlobalRef(env, gc);
if (gc == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
OGLSDOps *oglsdo = (OGLSDOps *)
SurfaceData
_
InitOps
(
env
,
cglsd
,
sizeof
(
OGLSDOps
))
;
if
(
oglsdo
==
NULL
)
{
(*env)->DeleteGlobalRef(env, gc);
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
// later the graphicsConfig will be used for deallocation of oglsdo
oglsdo->graphicsConfig = gc;
CGLSDOps *cglsdo = (CGLSDOps *)
malloc
(
sizeof
(
CGLSDOps
))
;
if
(
cglsdo
==
NULL
)
{
JNU
_
ThrowOutOfMemoryError
(
env
,
"creating native cgl ops"
)
;
...
...
src/share/classes/sun/java2d/opengl/OGLSurfaceData.java
浏览文件 @
e26b7a57
...
...
@@ -27,6 +27,7 @@ package sun.java2d.opengl;
import
java.awt.AlphaComposite
;
import
java.awt.Composite
;
import
java.awt.GraphicsConfiguration
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.Rectangle
;
import
java.awt.Transparency
;
...
...
@@ -598,16 +599,16 @@ public abstract class OGLSurfaceData extends SurfaceData
* (referenced by the pData parameter). This method is invoked from
* the native Dispose() method from the Disposer thread when the
* Java-level OGLSurfaceData object is about to go away. Note that we
* also pass a reference to the
native GLX/WGLGraphicsConfigInfo
*
(pConfigInfo)
for the purposes of making a context current.
* also pass a reference to the
OGLGraphicsConfig
* for the purposes of making a context current.
*/
static
void
dispose
(
long
pData
,
long
pConfigInfo
)
{
static
void
dispose
(
long
pData
,
OGLGraphicsConfig
gc
)
{
OGLRenderQueue
rq
=
OGLRenderQueue
.
getInstance
();
rq
.
lock
();
try
{
// make sure we have a current context before
// disposing the native resources (e.g. texture object)
OGLContext
.
setScratchSurface
(
pConfigInfo
);
OGLContext
.
setScratchSurface
(
gc
);
RenderBuffer
buf
=
rq
.
getBuffer
();
rq
.
ensureCapacityAndAlignment
(
12
,
4
);
...
...
src/share/native/sun/java2d/opengl/OGLSurfaceData.c
浏览文件 @
e26b7a57
/*
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -37,7 +37,6 @@
* The following methods are implemented in the windowing system (i.e. GLX
* and WGL) source files.
*/
extern
jlong
OGLSD_GetNativeConfigInfo
(
OGLSDOps
*
oglsdo
);
extern
jboolean
OGLSD_InitOGLWindow
(
JNIEnv
*
env
,
OGLSDOps
*
oglsdo
);
extern
void
OGLSD_DestroyOGLSurface
(
JNIEnv
*
env
,
OGLSDOps
*
oglsdo
);
...
...
@@ -593,11 +592,14 @@ void
OGLSD_Dispose
(
JNIEnv
*
env
,
SurfaceDataOps
*
ops
)
{
OGLSDOps
*
oglsdo
=
(
OGLSDOps
*
)
ops
;
j
long
pConfigInfo
=
OGLSD_GetNativeConfigInfo
(
oglsdo
)
;
j
object
graphicsConfig
=
oglsdo
->
graphicsConfig
;
JNU_CallStaticMethodByName
(
env
,
NULL
,
"sun/java2d/opengl/OGLSurfaceData"
,
"dispose"
,
"(JJ)V"
,
ptr_to_jlong
(
ops
),
pConfigInfo
);
"dispose"
,
"(JLsun/java2d/opengl/OGLGraphicsConfig;)V"
,
ptr_to_jlong
(
ops
),
graphicsConfig
);
(
*
env
)
->
DeleteGlobalRef
(
env
,
graphicsConfig
);
oglsdo
->
graphicsConfig
=
NULL
;
}
/**
...
...
src/share/native/sun/java2d/opengl/OGLSurfaceData.h
浏览文件 @
e26b7a57
/*
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -85,6 +85,9 @@ typedef struct {
* Pointer to native-specific (GLX, WGL, etc.) SurfaceData info, such as the
* native Drawable handle and GraphicsConfig data.
*
* jobject graphicsConfig;;
* Strong reference to the OGLGraphicsConfig used by this OGLSurfaceData.
*
* jint drawableType;
* The surface type; can be any one of the surface type constants defined
* below (OGLSD_WINDOW, OGLSD_TEXTURE, etc).
...
...
@@ -162,6 +165,7 @@ typedef struct {
struct
_OGLSDOps
{
SurfaceDataOps
sdOps
;
void
*
privOps
;
jobject
graphicsConfig
;
jint
drawableType
;
GLenum
activeBuffer
;
jboolean
isOpaque
;
...
...
src/solaris/classes/sun/java2d/opengl/GLXSurfaceData.java
浏览文件 @
e26b7a57
...
...
@@ -41,7 +41,8 @@ public abstract class GLXSurfaceData extends OGLSurfaceData {
protected
X11ComponentPeer
peer
;
private
GLXGraphicsConfig
graphicsConfig
;
private
native
void
initOps
(
X11ComponentPeer
peer
,
long
aData
);
private
native
void
initOps
(
OGLGraphicsConfig
gc
,
X11ComponentPeer
peer
,
long
aData
);
protected
native
boolean
initPbuffer
(
long
pData
,
long
pConfigInfo
,
boolean
isOpaque
,
int
width
,
int
height
);
...
...
@@ -52,7 +53,7 @@ public abstract class GLXSurfaceData extends OGLSurfaceData {
super
(
gc
,
cm
,
type
);
this
.
peer
=
peer
;
this
.
graphicsConfig
=
gc
;
initOps
(
peer
,
graphicsConfig
.
getAData
());
initOps
(
gc
,
peer
,
graphicsConfig
.
getAData
());
}
public
GraphicsConfiguration
getDeviceConfiguration
()
{
...
...
src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c
浏览文件 @
e26b7a57
/*
* Copyright (c) 2003, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -54,23 +54,32 @@ jboolean surfaceCreationFailed = JNI_FALSE;
JNIEXPORT
void
JNICALL
Java_sun_java2d_opengl_GLXSurfaceData_initOps
(
JNIEnv
*
env
,
jobject
glxsd
,
jobject
gc
,
jobject
peer
,
jlong
aData
)
{
#ifndef HEADLESS
GLXSDOps
*
glxsdo
=
(
GLXSDOps
*
)
malloc
(
sizeof
(
GLXSDOps
));
if
(
glxsdo
==
NULL
)
{
JNU_ThrowOutOfMemoryError
(
env
,
"creating native GLX ops"
);
gc
=
(
*
env
)
->
NewGlobalRef
(
env
,
gc
);
if
(
gc
==
NULL
)
{
JNU_ThrowOutOfMemoryError
(
env
,
"Initialization of SurfaceData failed."
);
return
;
}
OGLSDOps
*
oglsdo
=
(
OGLSDOps
*
)
SurfaceData_InitOps
(
env
,
glxsd
,
sizeof
(
OGLSDOps
));
if
(
oglsdo
==
NULL
)
{
free
(
glxsdo
);
(
*
env
)
->
DeleteGlobalRef
(
env
,
gc
);
JNU_ThrowOutOfMemoryError
(
env
,
"Initialization of SurfaceData failed."
);
return
;
}
// later the graphicsConfig will be used for deallocation of oglsdo
oglsdo
->
graphicsConfig
=
gc
;
GLXSDOps
*
glxsdo
=
(
GLXSDOps
*
)
malloc
(
sizeof
(
GLXSDOps
));
if
(
glxsdo
==
NULL
)
{
JNU_ThrowOutOfMemoryError
(
env
,
"creating native GLX ops"
);
return
;
}
J2dTraceLn
(
J2D_TRACE_INFO
,
"GLXSurfaceData_initOps"
);
...
...
@@ -164,39 +173,6 @@ GLXSD_MakeCurrentToScratch(JNIEnv *env, OGLContext *oglc)
return
JNI_TRUE
;
}
/**
* Returns a pointer (as a jlong) to the native GLXGraphicsConfigInfo
* associated with the given OGLSDOps. This method can be called from
* shared code to retrieve the native GraphicsConfig data in a platform-
* independent manner.
*/
jlong
OGLSD_GetNativeConfigInfo
(
OGLSDOps
*
oglsdo
)
{
GLXSDOps
*
glxsdo
;
if
(
oglsdo
==
NULL
)
{
J2dRlsTraceLn
(
J2D_TRACE_ERROR
,
"OGLSD_GetNativeConfigInfo: ops are null"
);
return
0L
;
}
glxsdo
=
(
GLXSDOps
*
)
oglsdo
->
privOps
;
if
(
glxsdo
==
NULL
)
{
J2dRlsTraceLn
(
J2D_TRACE_ERROR
,
"OGLSD_GetNativeConfigInfo: glx ops are null"
);
return
0L
;
}
if
(
glxsdo
->
configData
==
NULL
)
{
J2dRlsTraceLn
(
J2D_TRACE_ERROR
,
"OGLSD_GetNativeConfigInfo: config data is null"
);
return
0L
;
}
return
ptr_to_jlong
(
glxsdo
->
configData
->
glxInfo
);
}
/**
* Makes the given GraphicsConfig's context current to its associated
* "scratch" surface. If there is a problem making the context current,
...
...
src/windows/classes/sun/java2d/opengl/WGLSurfaceData.java
浏览文件 @
e26b7a57
...
...
@@ -41,8 +41,8 @@ public abstract class WGLSurfaceData extends OGLSurfaceData {
protected
WComponentPeer
peer
;
private
WGLGraphicsConfig
graphicsConfig
;
private
native
void
initOps
(
long
pConfigInfo
,
WComponentPeer
peer
,
long
hwnd
);
private
native
void
initOps
(
OGLGraphicsConfig
gc
,
long
pConfigInfo
,
WComponentPeer
peer
,
long
hwnd
);
protected
native
boolean
initPbuffer
(
long
pData
,
long
pConfigInfo
,
boolean
isOpaque
,
int
width
,
int
height
);
...
...
@@ -57,7 +57,7 @@ public abstract class WGLSurfaceData extends OGLSurfaceData {
long
pConfigInfo
=
gc
.
getNativeConfigInfo
();
long
hwnd
=
peer
!=
null
?
peer
.
getHWnd
()
:
0L
;
initOps
(
pConfigInfo
,
peer
,
hwnd
);
initOps
(
gc
,
pConfigInfo
,
peer
,
hwnd
);
}
public
GraphicsConfiguration
getDeviceConfiguration
()
{
...
...
src/windows/native/sun/java2d/opengl/WGLSurfaceData.c
浏览文件 @
e26b7a57
/*
* Copyright (c) 2004, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -58,12 +58,29 @@ extern void
JNIEXPORT
void
JNICALL
Java_sun_java2d_opengl_WGLSurfaceData_initOps
(
JNIEnv
*
env
,
jobject
wglsd
,
jlong
pConfigInfo
,
j
object
gc
,
j
long
pConfigInfo
,
jobject
peer
,
jlong
hwnd
)
{
OGLSDOps
*
oglsdo
=
(
OGLSDOps
*
)
SurfaceData_InitOps
(
env
,
wglsd
,
OGLSDOps
*
oglsdo
;
WGLSDOps
*
wglsdo
;
gc
=
(
*
env
)
->
NewGlobalRef
(
env
,
gc
);
if
(
gc
==
NULL
)
{
JNU_ThrowOutOfMemoryError
(
env
,
"Initialization of SurfaceData failed."
);
return
;
}
oglsdo
=
(
OGLSDOps
*
)
SurfaceData_InitOps
(
env
,
wglsd
,
sizeof
(
OGLSDOps
));
WGLSDOps
*
wglsdo
=
(
WGLSDOps
*
)
malloc
(
sizeof
(
WGLSDOps
));
if
(
oglsdo
==
NULL
)
{
(
*
env
)
->
DeleteGlobalRef
(
env
,
gc
);
JNU_ThrowOutOfMemoryError
(
env
,
"Initialization of SurfaceData failed."
);
return
;
}
// later the graphicsConfig will be used for deallocation of oglsdo
oglsdo
->
graphicsConfig
=
gc
;
wglsdo
=
(
WGLSDOps
*
)
malloc
(
sizeof
(
WGLSDOps
));
J2dTraceLn
(
J2D_TRACE_INFO
,
"WGLSurfaceData_initOps"
);
...
...
@@ -159,33 +176,6 @@ WGLSD_MakeCurrentToScratch(JNIEnv *env, OGLContext *oglc)
return
JNI_TRUE
;
}
/**
* Returns a pointer (as a jlong) to the native WGLGraphicsConfigInfo
* associated with the given OGLSDOps. This method can be called from
* shared code to retrieve the native GraphicsConfig data in a platform-
* independent manner.
*/
jlong
OGLSD_GetNativeConfigInfo
(
OGLSDOps
*
oglsdo
)
{
WGLSDOps
*
wglsdo
;
if
(
oglsdo
==
NULL
)
{
J2dRlsTraceLn
(
J2D_TRACE_ERROR
,
"OGLSD_GetNativeConfigInfo: ops are null"
);
return
0L
;
}
wglsdo
=
(
WGLSDOps
*
)
oglsdo
->
privOps
;
if
(
wglsdo
==
NULL
)
{
J2dRlsTraceLn
(
J2D_TRACE_ERROR
,
"OGLSD_GetNativeConfigInfo: wgl ops are null"
);
return
0L
;
}
return
ptr_to_jlong
(
wglsdo
->
configInfo
);
}
/**
* Makes the given GraphicsConfig's context current to its associated
* "scratch" surface. If there is a problem making the context current,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录