Merge
This commit is contained in:
commit
cc3d72b55f
@ -62,7 +62,7 @@ FILES_export = \
|
||||
java/text/Bidi.java \
|
||||
sun/font/FileFont.java \
|
||||
sun/font/FileFontStrike.java \
|
||||
sun/font/FontManager.java \
|
||||
sun/font/SunFontManager.java \
|
||||
sun/font/GlyphList.java \
|
||||
sun/font/NativeFont.java \
|
||||
sun/font/StrikeCache.java \
|
||||
|
@ -52,7 +52,6 @@ include FILES_c.gmk
|
||||
FILES_export = \
|
||||
java/awt/Font.java \
|
||||
sun/font/FileFont.java \
|
||||
sun/font/FontManager.java \
|
||||
sun/font/GlyphList.java \
|
||||
sun/font/NativeFont.java \
|
||||
sun/font/StrikeCache.java \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 2012, 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
|
||||
@ -143,6 +143,7 @@ public abstract class ImageWatched {
|
||||
if (iw != null && !isWatcher(iw)) {
|
||||
watcherList = new WeakLink(iw, watcherList);
|
||||
}
|
||||
watcherList = watcherList.removeWatcher(null);
|
||||
}
|
||||
|
||||
public synchronized boolean isWatcher(ImageObserver iw) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*com.sun.tools.attach.AttachNotSupportedException
|
||||
|
||||
@ -142,7 +142,9 @@ public class JCmd {
|
||||
// Cast to HotSpotVirtualMachine as this is an
|
||||
// implementation specific method.
|
||||
HotSpotVirtualMachine hvm = (HotSpotVirtualMachine) vm;
|
||||
try (InputStream in = hvm.executeJCmd(command);) {
|
||||
String lines[] = command .split("\\n");
|
||||
for (String line : lines) {
|
||||
try (InputStream in = hvm.executeJCmd(line);) {
|
||||
// read to EOF and just print output
|
||||
byte b[] = new byte[256];
|
||||
int n;
|
||||
@ -154,6 +156,7 @@ public class JCmd {
|
||||
}
|
||||
} while (n > 0);
|
||||
}
|
||||
}
|
||||
vm.detach();
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "jlong.h"
|
||||
#include "sunfontids.h"
|
||||
#include "fontscalerdefs.h"
|
||||
#include "sun_font_FontManager.h"
|
||||
#include "sun_font_SunFontManager.h"
|
||||
#include "sun_font_NullFontScaler.h"
|
||||
#include "sun_font_StrikeCache.h"
|
||||
|
||||
|
@ -69,21 +69,27 @@ public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe {
|
||||
}
|
||||
|
||||
public void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2) {
|
||||
Region compClip = sg2d.getCompClip();
|
||||
int transX1 = x1 + sg2d.transX;
|
||||
int transY1 = y1 + sg2d.transY;
|
||||
int transX2 = x2 + sg2d.transX;
|
||||
int transY2 = y2 + sg2d.transY;
|
||||
|
||||
// Non clipped fast path
|
||||
if (compClip.contains(transX1, transY1)
|
||||
&& compClip.contains(transX2, transY2)) {
|
||||
try {
|
||||
SunToolkit.awtLock();
|
||||
|
||||
validateSurface(sg2d);
|
||||
int transx = sg2d.transX;
|
||||
int transy = sg2d.transY;
|
||||
|
||||
XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
|
||||
|
||||
tileManager.addLine(x1 + transx, y1 + transy,
|
||||
x2 + transx, y2 + transy);
|
||||
tileManager.fillMask(xrsd);
|
||||
tileManager.addLine(transX1, transY1, transX2, transY2);
|
||||
tileManager.fillMask((XRSurfaceData) sg2d.surfaceData);
|
||||
} finally {
|
||||
SunToolkit.awtUnlock();
|
||||
}
|
||||
} else {
|
||||
draw(sg2d, new Line2D.Float(x1, y1, x2, y2));
|
||||
}
|
||||
}
|
||||
|
||||
public void drawRect(SunGraphics2D sg2d,
|
||||
|
@ -583,9 +583,6 @@ JNIEXPORT jstring JNICALL Java_sun_awt_X11FontManager_getFontPathNative
|
||||
}
|
||||
|
||||
#include <dlfcn.h>
|
||||
#if !(defined(__linux__) || defined(MACOSX))
|
||||
#include <link.h>
|
||||
#endif
|
||||
|
||||
#include "fontconfig.h"
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifndef MACOSX
|
||||
#include <link.h>
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
#include "jvm_md.h"
|
||||
#include "J2D_GL/glx.h"
|
||||
|
@ -70,7 +70,6 @@ typedef struct _XRadialGradient {
|
||||
|
||||
#ifdef __solaris__
|
||||
/* Solaris 10 will not have these symbols at runtime */
|
||||
#include <link.h>
|
||||
|
||||
typedef Picture (*XRenderCreateLinearGradientFuncType)
|
||||
(Display *dpy,
|
||||
|
59
jdk/test/sun/awt/image/ImageWatched/AddNoLeak.java
Normal file
59
jdk/test/sun/awt/image/ImageWatched/AddNoLeak.java
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.awt.image.ImageProducer;
|
||||
import java.awt.image.ImageConsumer;
|
||||
import java.awt.Image;
|
||||
import java.awt.Container;
|
||||
|
||||
/* @test 1.0 12/01/17
|
||||
@bug 7104151
|
||||
@summary Make sure that we don't leak image observers (or related objects)
|
||||
@run main/othervm AddNoLeak
|
||||
@author David Buck
|
||||
*/
|
||||
|
||||
public class AddNoLeak {
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("java.awt.headless", "true");
|
||||
Container cont = new Container();
|
||||
Image img = cont.createImage(new DummyImageSource());
|
||||
for(int i=0;i < 15000;i++) {
|
||||
img.getWidth(new ImageObserver() {
|
||||
public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {return false;}
|
||||
});
|
||||
if (i % 100 == 0) {
|
||||
System.gc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class DummyImageSource implements ImageProducer {
|
||||
public void addConsumer(ImageConsumer ic){}
|
||||
public boolean isConsumer(ImageConsumer ic){return false;}
|
||||
public void removeConsumer(ImageConsumer ic){}
|
||||
public void startProduction(ImageConsumer ic){}
|
||||
public void requestTopDownLeftRightResend(ImageConsumer ic){}
|
||||
}
|
||||
}
|
95
jdk/test/sun/tools/jcmd/dcmd-big-script.txt
Normal file
95
jdk/test/sun/tools/jcmd/dcmd-big-script.txt
Normal file
@ -0,0 +1,95 @@
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
||||
VM.version
|
70
jdk/test/sun/tools/jcmd/jcmd-big-script.sh
Normal file
70
jdk/test/sun/tools/jcmd/jcmd-big-script.sh
Normal file
@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright (c) 2012, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
|
||||
# @test
|
||||
# @bug 7154822
|
||||
# @summary test if we can send a file over 1024 bytes large via jcmd -f
|
||||
# @author David Buck
|
||||
#
|
||||
# @library ../common
|
||||
# @build SimpleApplication ShutdownSimpleApplication
|
||||
# @run shell jcmd-big-script.sh
|
||||
|
||||
. ${TESTSRC}/../common/CommonSetup.sh
|
||||
. ${TESTSRC}/../common/ApplicationSetup.sh
|
||||
|
||||
# Start application and use PORTFILE for coordination
|
||||
PORTFILE="${TESTCLASSES}"/shutdown.port
|
||||
startApplication SimpleApplication "${PORTFILE}"
|
||||
|
||||
failed=0;
|
||||
|
||||
# -f <script>
|
||||
rm -f jcmd.out 2>/dev/null
|
||||
set +e # even if jcmd fails, we do not want abort the script yet.
|
||||
${JCMD} -J-XX:+UsePerfData $appJavaPid -f ${TESTSRC}/dcmd-big-script.txt > jcmd.out 2>&1
|
||||
status="$?"
|
||||
set -e
|
||||
if [ "$status" != 0 ]; then
|
||||
echo "jcmd command returned non-zero exit code (status=$status). Failed."
|
||||
failed=1;
|
||||
fi
|
||||
cat jcmd.out
|
||||
set +e # if the test passes, grep will "fail" with an exit code of 1
|
||||
grep Exception jcmd.out > /dev/null 2>&1
|
||||
status="$?"
|
||||
set -e
|
||||
if [ "$status" = 0 ]; then
|
||||
echo "Output of \"jcmd [pid] -f dcmd-big-script.txt\" contains string \"Exception\". Failed."
|
||||
failed=1;
|
||||
fi
|
||||
|
||||
# clean up
|
||||
rm -f jcmd.out 2>/dev/null
|
||||
stopApplication "${PORTFILE}"
|
||||
waitForApplication
|
||||
|
||||
exit $failed
|
Loading…
x
Reference in New Issue
Block a user