Skip to content

Commit

Permalink
Merge pull request JetBrains#31 from bell-sw/update_8u242
Browse files Browse the repository at this point in the history
jdk8u242 update
  • Loading branch information
avu authored Jan 20, 2020
2 parents 9939e9d + 04084b6 commit 58d685e
Show file tree
Hide file tree
Showing 265 changed files with 9,914 additions and 4,035 deletions.
9 changes: 9 additions & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,12 @@ c7a97c9b7e5932d651eda37c8a907311818491d7 jdk8u222-b07
69c4f673b33e255599d2aa257fa50fd8b48b7b95 jdk8u232-b08
5456f24496f43f72b0cf4f0db3a73ea49c33f94f jdk8u232-b09
5456f24496f43f72b0cf4f0db3a73ea49c33f94f jdk8u232-ga
d32fc856e071ff49c8a4c94682caad57f6c6874f jdk8u242-b01
2b292ab0ed9af9aa8aab27b1a80daa3509a050ba jdk8u242-b02
2f564a16517d678f31a3fa7352e16702e48c417d jdk8u242-b03
8163e59959ed5462891f2b1db7bc0fa2af1de0a6 jdk8u242-b04
b2865f7f557fcaec84445b034b2de2b27456b6c5 jdk8u242-b05
0d27e60569f7cf85cbdb0a83436e772e9256b5b0 jdk8u242-b06
034a65a05bfbfb06e14d3d39efa0c9f27683573a jdk8u242-b07
c63c2923e1f99c1f350bd24b42daf885023f18b7 jdk8u242-b08
c63c2923e1f99c1f350bd24b42daf885023f18b7 jdk8u242-ga
4 changes: 3 additions & 1 deletion THIRD_PARTY_README
Original file line number Diff line number Diff line change
Expand Up @@ -1334,11 +1334,13 @@ SUCH DAMAGE.

--------------------------------------------------------------------------------

%% This notice is provided with respect to Joni v1.1.9, which may be
%% This notice is provided with respect to Joni v2.1.16, which may be
included with JRE 8, JDK 8, and OpenJDK 8.

--- begin of LICENSE ---

Copyright (c) 2017 JRuby Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Expand Down
4 changes: 3 additions & 1 deletion make/src/native/add_gnu_debuglink/add_gnu_debuglink.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Expand Down
34 changes: 2 additions & 32 deletions src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import java.awt.image.DirectColorModel;
import java.awt.image.VolatileImage;
import java.awt.image.WritableRaster;
import java.util.HashMap;
import java.util.concurrent.Callable;

import sun.awt.CGraphicsConfig;
Expand Down Expand Up @@ -89,8 +88,6 @@ private static native long getCGLConfigInfo(int displayID, int visualnum,
int swapInterval);
private static native int getOGLCapabilities(long configInfo);

private static final HashMap<Long, Integer> pGCRefCounts = new HashMap<>();

/**
* Returns GL_MAX_TEXTURE_SIZE from the shared opengl context. Must be
* called under OGLRQ lock, because this method change current context.
Expand All @@ -113,7 +110,7 @@ private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt,
this.oglCaps = oglCaps;
this.maxTextureSize = maxTextureSize;
context = new OGLContext(OGLRenderQueue.getInstance(), this);
refPConfigInfo(pConfigInfo);

// add a record to the Disposer so that we destroy the native
// CGLGraphicsConfigInfo data when this object goes away
Disposer.addRecord(disposerReferent,
Expand Down Expand Up @@ -193,33 +190,6 @@ public static CGLGraphicsConfig getConfig(CGraphicsDevice device,
});
}

static void refPConfigInfo(long pConfigInfo) {
synchronized (pGCRefCounts) {
Integer count = pGCRefCounts.get(pConfigInfo);
if (count == null) {
count = 1;
}
else {
count++;
}
pGCRefCounts.put(pConfigInfo, count);
}
}

static void deRefPConfigInfo(long pConfigInfo) {
synchronized (pGCRefCounts) {
Integer count = pGCRefCounts.get(pConfigInfo);
if (count != null) {
count--;
pGCRefCounts.put(pConfigInfo, count);
if (count == 0) {
OGLRenderQueue.disposeGraphicsConfig(pConfigInfo);
pGCRefCounts.remove(pConfigInfo);
}
}
}
}

public static boolean isCGLAvailable() {
return cglAvailable;
}
Expand Down Expand Up @@ -287,7 +257,7 @@ public CGLGCDisposerRecord(long pCfgInfo) {
}
public void dispose() {
if (pCfgInfo != 0) {
deRefPConfigInfo(pCfgInfo);
OGLRenderQueue.disposeGraphicsConfig(pCfgInfo);
pCfgInfo = 0;
}
}
Expand Down
18 changes: 6 additions & 12 deletions src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -77,8 +78,7 @@ protected CGLSurfaceData(CPlatformView pView, CGLGraphicsConfig gc,
pPeerData = pView.getAWTView();
isOpaque = pView.isOpaque();
}
CGLGraphicsConfig.refPConfigInfo(pConfigInfo);
initOps(pConfigInfo, pPeerData, 0, 0, 0, isOpaque);
initOps(gc, pConfigInfo, pPeerData, 0, 0, 0, isOpaque);
}

protected CGLSurfaceData(CGLLayer layer, CGLGraphicsConfig gc,
Expand All @@ -94,8 +94,7 @@ protected CGLSurfaceData(CGLLayer layer, CGLGraphicsConfig gc,
layerPtr = layer.getPointer();
isOpaque = layer.isOpaque();
}
CGLGraphicsConfig.refPConfigInfo(pConfigInfo);
initOps(pConfigInfo, 0, layerPtr, 0, 0, isOpaque);
initOps(gc, pConfigInfo, 0, layerPtr, 0, 0, isOpaque);
}

@Override //SurfaceData
Expand Down Expand Up @@ -385,9 +384,4 @@ public static void destroyOGLContext(long ctx) {
destroyCGLContext(ctx);
}
}

static void dispose(long pData, long pConfigInfo) {
OGLSurfaceData.dispose(pData, pConfigInfo);
CGLGraphicsConfig.deRefPConfigInfo(pConfigInfo);
}
}
4 changes: 3 additions & 1 deletion src/macosx/native/jobjc/JObjC.xcodeproj/default.pbxuser
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Expand Down
15 changes: 9 additions & 6 deletions src/macosx/native/sun/awt/CGraphicsDevice.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
Expand Down Expand Up @@ -94,16 +94,18 @@ static CFMutableArrayRef getAllValidDisplayModes(jint displayID){
static CGDisplayModeRef getBestModeForParameters(CFArrayRef allModes, int w, int h, int bpp, int refrate) {
CGDisplayModeRef bestGuess = NULL;
CFIndex numModes = CFArrayGetCount(allModes), n;
int thisBpp = 0;

for(n = 0; n < numModes; n++ ) {
CGDisplayModeRef cRef = (CGDisplayModeRef) CFArrayGetValueAtIndex(allModes, n);
if(cRef == NULL) {
continue;
}
CFStringRef modeString = CGDisplayModeCopyPixelEncoding(cRef);
thisBpp = getBPPFromModeString(modeString);
int thisBpp = getBPPFromModeString(modeString);
CFRelease(modeString);
if (thisBpp != bpp || (int)CGDisplayModeGetHeight(cRef) != h || (int)CGDisplayModeGetWidth(cRef) != w) {
int thisH = (int)CGDisplayModeGetHeight(cRef);
int thisW = (int)CGDisplayModeGetWidth(cRef);
if (thisBpp != bpp || thisH != h || thisW != w) {
// One of the key parameters does not match
continue;
}
Expand All @@ -114,11 +116,12 @@ static CGDisplayModeRef getBestModeForParameters(CFArrayRef allModes, int w, int

// Refresh rate might be 0 in display mode and we ask for specific display rate
// but if we do not find exact match then 0 refresh rate might be just Ok
if (CGDisplayModeGetRefreshRate(cRef) == refrate) {
int thisRefrate = (int)CGDisplayModeGetRefreshRate(cRef);
if (thisRefrate == refrate) {
// Exact match
return cRef;
}
if (CGDisplayModeGetRefreshRate(cRef) == 0) {
if (thisRefrate == 0) {
// Not exactly what was asked for, but may fit our needs if we don't find an exact match
bestGuess = cRef;
}
Expand Down
55 changes: 16 additions & 39 deletions src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,31 +144,6 @@ extern CGLError CGLTexImageIOSurface2D(
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,
Expand Down Expand Up @@ -409,30 +384,32 @@ extern CGLError CGLTexImageIOSurface2D(
extern UnlockFunc OGLSD_Unlock;
extern DisposeFunc OGLSD_Dispose;


void
CGLSD_Dispose(JNIEnv *env, SurfaceDataOps *ops)
{
OGLSDOps *oglsdo = (OGLSDOps *)ops;
jlong pConfigInfo = OGLSD_GetNativeConfigInfo(oglsdo);
JNU_CallStaticMethodByName(env, NULL, "sun/java2d/opengl/CGLSurfaceData",
"dispose", "(JJ)V",
ptr_to_jlong(ops), pConfigInfo);
}


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)
{
J2dTraceLn(J2D_TRACE_INFO, "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");
Expand All @@ -444,7 +421,7 @@ extern CGLError CGLTexImageIOSurface2D(
oglsdo->sdOps.Lock = OGLSD_Lock;
oglsdo->sdOps.GetRasInfo = OGLSD_GetRasInfo;
oglsdo->sdOps.Unlock = OGLSD_Unlock;
oglsdo->sdOps.Dispose = CGLSD_Dispose;
oglsdo->sdOps.Dispose = OGLSD_Dispose;

oglsdo->drawableType = OGLSD_UNDEFINED;
oglsdo->activeBuffer = GL_FRONT;
Expand Down
Loading

0 comments on commit 58d685e

Please sign in to comment.