提交 e3f35040 编写于 作者: L lana

Merge

......@@ -230,7 +230,8 @@ endif
# Compilers, SDK, and Visual Studio (MSDEV) [32bit is different from 64bit]
ifeq ($(ARCH_DATA_MODEL), 32)
# Try looking in MSVCDIR or MSVCDir area first (set by vcvars32.bat)
# Try looking in MSVCDIR or MSVCDir area first
# (set by vcvars32.bat for VC .NET, not defined in the VC 2008/2010)
ifdef MSVCDIR
xMSVCDIR :="$(subst \,/,$(MSVCDIR))"
_msvc_dir :=$(call FullPath,$(xMSVCDIR))
......@@ -238,11 +239,6 @@ ifeq ($(ARCH_DATA_MODEL), 32)
ifdef MSVCDir
xMSVCDIR :="$(subst \,/,$(MSVCDir))"
_msvc_dir :=$(call FullPath,$(xMSVCDIR))
else
ifneq ($(_program_files),)
xMSVCDIR :="$(_program_files)/Microsoft Visual Studio .NET 2003/Vc7"
_msvc_dir :=$(call FullPath,$(xMSVCDIR))
endif
endif
endif
# If we still don't have it, look for VSnnCOMNTOOLS (newest first),
......
......@@ -46,11 +46,11 @@ nbproject:
$(RM) -r $(DEMODIR)/nbproject
$(MKDIR) -p $(DEMODIR)
( $(CD) $(SHARE_SRC)/demo && $(TAR) -cf - \
`find nbproject $(SCM_DIRS_prune) -o -type f -print` ) | \
`$(FIND) nbproject $(SCM_DIRS_prune) -o -type f -print` ) | \
( $(CD) $(DEMODIR) && $(TAR) -xf - )
ifndef OPENJDK
( $(CD) $(CLOSED_SHARE_SRC)/demo && $(TAR) -cf - \
`find nbproject $(SCM_DIRS_prune) -o -type f -print` ) | \
`$(FIND) nbproject $(SCM_DIRS_prune) -o -type f -print` ) | \
( $(CD) $(DEMODIR) && $(TAR) -xf - )
endif
......
......@@ -25,10 +25,10 @@
package sun.awt;
import java.awt.GraphicsEnvironment;
import java.awt.peer.FontPeer;
import java.util.Locale;
import java.util.Vector;
import sun.font.SunFontManager;
import sun.java2d.FontSupport;
import java.nio.CharBuffer;
import java.nio.ByteBuffer;
......@@ -57,9 +57,9 @@ public abstract class PlatformFont implements FontPeer {
protected static String osVersion;
public PlatformFont(String name, int style){
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
if (ge instanceof FontSupport) {
fontConfig = ((FontSupport)ge).getFontConfiguration();
SunFontManager sfm = SunFontManager.getInstance();
if (sfm instanceof FontSupport) {
fontConfig = ((FontSupport)sfm).getFontConfiguration();
}
if (fontConfig == null) {
return;
......
......@@ -60,6 +60,10 @@ public final class FontUtilities {
static final String LUCIDA_FILE_NAME = "LucidaSansRegular.ttf";
private static boolean debugFonts = false;
private static PlatformLogger logger = null;
private static boolean logging;
// This static initializer block figures out the OS constants.
static {
......@@ -115,6 +119,25 @@ public final class FontUtilities {
File lucidaFile = new File(jreFontDirName + File.separator
+ LUCIDA_FILE_NAME);
isOpenJDK = !lucidaFile.exists();
String debugLevel =
System.getProperty("sun.java2d.debugfonts");
if (debugLevel != null && !debugLevel.equals("false")) {
debugFonts = true;
logger = PlatformLogger.getLogger("sun.java2d");
if (debugLevel.equals("warning")) {
logger.setLevel(PlatformLogger.WARNING);
} else if (debugLevel.equals("severe")) {
logger.setLevel(PlatformLogger.SEVERE);
}
}
if (debugFonts) {
logger = PlatformLogger.getLogger("sun.java2d");
logging = logger.isEnabled();
}
return null;
}
});
......@@ -140,32 +163,6 @@ public final class FontUtilities {
*/
public static final int MAX_LAYOUT_CHARCODE = 0x206F;
private static boolean debugFonts = false;
private static PlatformLogger logger = null;
private static boolean logging;
static {
String debugLevel =
System.getProperty("sun.java2d.debugfonts");
if (debugLevel != null && !debugLevel.equals("false")) {
debugFonts = true;
logger = PlatformLogger.getLogger("sun.java2d");
if (debugLevel.equals("warning")) {
logger.setLevel(PlatformLogger.WARNING);
} else if (debugLevel.equals("severe")) {
logger.setLevel(PlatformLogger.SEVERE);
}
}
if (debugFonts) {
logger = PlatformLogger.getLogger("sun.java2d");
logging = logger.isEnabled();
}
}
/**
* Calls the private getFont2D() method in java.awt.Font objects.
*
......
......@@ -59,17 +59,12 @@ import java.awt.Rectangle;
* Headless decorator implementation of a SunGraphicsEnvironment
*/
public class HeadlessGraphicsEnvironment extends GraphicsEnvironment
implements FontSupport {
public class HeadlessGraphicsEnvironment extends GraphicsEnvironment {
private GraphicsEnvironment ge;
private FontSupport fontSupport;
public HeadlessGraphicsEnvironment(GraphicsEnvironment ge) {
this.ge = ge;
if (ge instanceof FontSupport) {
fontSupport = (FontSupport)ge;
}
}
public GraphicsDevice[] getScreenDevices()
......@@ -101,13 +96,6 @@ public class HeadlessGraphicsEnvironment extends GraphicsEnvironment
public String[] getAvailableFontFamilyNames(Locale l) {
return ge.getAvailableFontFamilyNames(l); }
public FontConfiguration getFontConfiguration() {
if (fontSupport != null) {
return fontSupport.getFontConfiguration();
}
return null;
}
/* Used by FontManager : internal API */
public GraphicsEnvironment getSunGraphicsEnvironment() {
return ge;
......
......@@ -111,6 +111,10 @@ Java_sun_awt_image_BufImgSurfaceData_initRaster(JNIEnv *env, jobject bisd,
{
BufImgSDOps *bisdo =
(BufImgSDOps*)SurfaceData_InitOps(env, bisd, sizeof(BufImgSDOps));
if (bisdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
bisdo->sdOps.Lock = BufImg_Lock;
bisdo->sdOps.GetRasInfo = BufImg_GetRasInfo;
bisdo->sdOps.Release = BufImg_Release;
......
......@@ -65,6 +65,11 @@ Java_sun_java2d_opengl_GLXSurfaceData_initOps(JNIEnv *env, jobject glxsd,
J2dTraceLn(J2D_TRACE_INFO, "GLXSurfaceData_initOps");
if (oglsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
if (glxsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "creating native GLX ops");
return;
......
......@@ -253,6 +253,10 @@ Java_sun_java2d_x11_XSurfaceData_initOps(JNIEnv *env, jobject xsd,
{
#ifndef HEADLESS
X11SDOps *xsdo = (X11SDOps*)SurfaceData_InitOps(env, xsd, sizeof(X11SDOps));
if (xsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
xsdo->sdOps.Lock = X11SD_Lock;
xsdo->sdOps.GetRasInfo = X11SD_GetRasInfo;
xsdo->sdOps.Unlock = X11SD_Unlock;
......
......@@ -66,6 +66,10 @@ Java_sun_java2d_opengl_WGLSurfaceData_initOps(JNIEnv *env, jobject wglsd,
J2dTraceLn(J2D_TRACE_INFO, "WGLSurfaceData_initOps");
if (oglsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
if (wglsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "creating native wgl ops");
return;
......
......@@ -363,6 +363,10 @@ Java_sun_java2d_windows_GDIWindowSurfaceData_initOps(JNIEnv *env, jobject wsd,
{
J2dTraceLn(J2D_TRACE_INFO, "GDIWindowSurfaceData_initOps");
GDIWinSDOps *wsdo = (GDIWinSDOps *)SurfaceData_InitOps(env, wsd, sizeof(GDIWinSDOps));
if (wsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
}
wsdo->sdOps.Lock = GDIWinSD_Lock;
wsdo->sdOps.GetRasInfo = GDIWinSD_GetRasInfo;
wsdo->sdOps.Unlock = GDIWinSD_Unlock;
......
......@@ -23,7 +23,7 @@
/*
* @test
* @bug 5010310 6319835 6904882
* @bug 5010310 6319835 6904882 6968373
* @summary test fonts can be created in the presence of a security manager
* @run main/othervm/secure=java.lang.SecurityManager FontPrivilege
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册