aboutsummaryrefslogtreecommitdiff
path: root/src/share/native/sun/java2d
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/native/sun/java2d')
-rw-r--r--src/share/native/sun/java2d/opengl/OGLSurfaceData.c12
-rw-r--r--src/share/native/sun/java2d/opengl/OGLSurfaceData.h6
2 files changed, 12 insertions, 6 deletions
diff --git a/src/share/native/sun/java2d/opengl/OGLSurfaceData.c b/src/share/native/sun/java2d/opengl/OGLSurfaceData.c
index 83c0b59f32..8bff4a89e4 100644
--- a/src/share/native/sun/java2d/opengl/OGLSurfaceData.c
+++ b/src/share/native/sun/java2d/opengl/OGLSurfaceData.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, 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;
- jlong pConfigInfo = OGLSD_GetNativeConfigInfo(oglsdo);
+ jobject 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;
}
/**
diff --git a/src/share/native/sun/java2d/opengl/OGLSurfaceData.h b/src/share/native/sun/java2d/opengl/OGLSurfaceData.h
index 0fc8b3b4da..62c48ee434 100644
--- a/src/share/native/sun/java2d/opengl/OGLSurfaceData.h
+++ b/src/share/native/sun/java2d/opengl/OGLSurfaceData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, 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;