diff --git a/.hgtags b/.hgtags index 966c17a5710..cbaa3d31764 100644 --- a/.hgtags +++ b/.hgtags @@ -100,3 +100,5 @@ a4e6aa1f45ad23a6f083ed98d970b5006ea4d292 jdk7-b116 142129d8599d1f56b29387e7f9a5fad53b6d61df jdk7-b123 aa894c225b1a517b665ac2a58295217ea2245134 jdk7-b124 f658ec2730fa29323c36d23c27e54c7219ef5e16 jdk7-b125 +f1df068076986679ea1105532a65529d63a89060 jdk7-b126 +f83cd8bd35c678f94e526990e03dc838d0ec2717 jdk7-b127 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 5bdac4ada74..3e2de35b9c2 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -100,3 +100,5 @@ f1591eed71f64f6eba79fb7426f5616cc4dfea73 jdk7-b122 ed6950da30cf1e8904b4bdb034d471647942271f jdk7-b123 024a6755895bf91b5a3c98984c89ee018efbf538 jdk7-b124 5c4df7e992775c102f08e9f1c0a124b324641b70 jdk7-b125 +b566d490905691787f8931f69947a92c67c6d5e4 jdk7-b126 +bd70f76b0309068f157ae759c36eac8f2c6d098e jdk7-b127 diff --git a/Makefile b/Makefile index 7c5b2db01c0..2aec754e6f8 100644 --- a/Makefile +++ b/Makefile @@ -29,15 +29,6 @@ ifndef TOPDIR TOPDIR:=. endif -# Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true) -OPENJDK_SOURCETREE=$(TOPDIR)/openjdk -OPENJDK_BUILDDIR:=$(shell \ - if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \ - echo "$(OPENJDK_SOURCETREE)"; \ - else \ - echo "."; \ - fi) - ifndef JDK_TOPDIR JDK_TOPDIR=$(TOPDIR)/jdk endif @@ -70,7 +61,7 @@ include ./make/deploy-rules.gmk all:: @$(START_ECHO) -all:: openjdk_check sanity +all:: sanity ifeq ($(SKIP_FASTDEBUG_BUILD), false) all:: fastdebug_build @@ -80,10 +71,6 @@ ifeq ($(SKIP_DEBUG_BUILD), false) all:: debug_build endif -ifneq ($(SKIP_OPENJDK_BUILD), true) - all:: openjdk_build -endif - all:: all_product_build all:: @@ -267,81 +254,6 @@ product_build:: build_product_image debug_build:: build_debug_image fastdebug_build:: build_fastdebug_image -# Check on whether we really can build the openjdk, need source etc. -openjdk_check: FRC -ifneq ($(SKIP_OPENJDK_BUILD), true) - @$(ECHO) " " - @$(ECHO) "=================================================" - @if [ ! -r $(OPENJDK_BUILDDIR)/Makefile ] ; then \ - $(ECHO) "ERROR: No openjdk source tree available at: $(OPENJDK_BUILDDIR)"; \ - exit 1; \ - else \ - $(ECHO) "OpenJDK will be built after JDK is built"; \ - $(ECHO) " OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \ - fi - @$(ECHO) "=================================================" - @$(ECHO) " " -endif - -# If we have bundle rules, we have a chance here to do a complete cycle -# build, of production and open build. -# FIXUP: We should create the openjdk source bundle and build that? -# But how do we reliable create or get at a formal openjdk source tree? -# The one we have needs to be trimmed of built bits and closed dirs. -# The repositories might not be available. -# The openjdk source bundle is probably not available. - -ifneq ($(SKIP_OPENJDK_BUILD), true) - ifeq ($(BUILD_JDK), true) - ifeq ($(BUNDLE_RULES_AVAILABLE), true) - -OPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/open-output -OPENJDK_BUILD_NAME \ - = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE) -OPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip -BUILT_IMAGE=$(ABS_OUTPUTDIR)/j2sdk-image -ifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64) - OPENJDK_BOOTDIR=$(BOOTDIR) - OPENJDK_IMPORTJDK=$(JDK_IMPORT_PATH) -else - OPENJDK_BOOTDIR=$(BUILT_IMAGE) - OPENJDK_IMPORTJDK=$(BUILT_IMAGE) -endif - -openjdk_build: - @$(START_ECHO) - @$(ECHO) " " - @$(ECHO) "=================================================" - @$(ECHO) "Starting openjdk build" - @$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)" - @$(ECHO) "=================================================" - @$(ECHO) " " - $(RM) -r $(OPENJDK_OUTPUTDIR) - $(MKDIR) -p $(OPENJDK_OUTPUTDIR) - ($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \ - OPENJDK=true \ - GENERATE_DOCS=false \ - ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \ - ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \ - ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \ - ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \ - product_build ) - $(RM) $(OPENJDK_BUILD_BINARY_ZIP) - ( $(CD) $(OPENJDK_OUTPUTDIR)/j2sdk-image && \ - $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .) - $(RM) -r $(OPENJDK_OUTPUTDIR) - @$(ECHO) " " - @$(ECHO) "=================================================" - @$(ECHO) "Finished openjdk build" - @$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)" - @$(ECHO) "=================================================" - @$(ECHO) " " - @$(FINISH_ECHO) - - endif - endif -endif - clobber:: $(RM) -r $(OUTPUTDIR)/* $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/* @@ -448,7 +360,6 @@ CACERTS_FILE.desc = Location of certificates file DEVTOOLS_PATH.desc = Directory containing zip and gnumake CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files DXSDK_PATH.desc = Root directory of DirectX SDK -MSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll # Make variables to print out (description and value) VARIABLE_PRINTVAL_LIST += \ @@ -477,12 +388,10 @@ VARIABLE_CHECKFIL_LIST += \ ifeq ($(PLATFORM), windows) VARIABLE_PRINTVAL_LIST += \ - DXSDK_PATH \ - MSVCRT_DLL_PATH + DXSDK_PATH VARIABLE_CHECKDIR_LIST += \ - DXSDK_PATH \ - MSVCRT_DLL_PATH + DXSDK_PATH endif diff --git a/README-builds.html b/README-builds.html index e48aaff3612..f98260ceca4 100644 --- a/README-builds.html +++ b/README-builds.html @@ -1414,14 +1414,14 @@ but it's normally found via the DirectX environment variable DXSDK_DIR. - MSVCR100.DLL + MSVCR100.DLL
The OpenJDK build requires access to a redistributable MSVCR100.DLL. This is usually picked up automatically from the redist directories of Visual Studio 2010. If this cannot be found set the - ALT_MSVCRT_DLL_PATH + ALT_MSVCRNN_DLL_PATH variable to the location of this file.@@ -1671,15 +1671,10 @@ variable DXSDK_DIR, failing that, look in C:/DXSDK. -
insertEntries
or setSizes
.
*
* @see #insertEntries
- * @see #setSizes
+ * @see #setSizes(int[])
*/
public SizeSequence() {
a = emptyArray;
diff --git a/jdk/src/share/classes/javax/swing/TransferHandler.java b/jdk/src/share/classes/javax/swing/TransferHandler.java
index 4854fdc75bf..eb7f8d1a644 100644
--- a/jdk/src/share/classes/javax/swing/TransferHandler.java
+++ b/jdk/src/share/classes/javax/swing/TransferHandler.java
@@ -344,7 +344,7 @@ public class TransferHandler implements Serializable {
*
* @return the drop location
* @throws IllegalStateException if this is not a drop
- * @see #isDrop
+ * @see #isDrop()
*/
public DropLocation getDropLocation() {
assureIsDrop();
@@ -380,7 +380,7 @@ public class TransferHandler implements Serializable {
*
* @param showDropLocation whether or not to indicate the drop location
* @throws IllegalStateException if this is not a drop
- * @see #isDrop
+ * @see #isDrop()
*/
public void setShowDropLocation(boolean showDropLocation) {
assureIsDrop();
@@ -406,7 +406,7 @@ public class TransferHandler implements Serializable {
* @see #getDropAction
* @see #getUserDropAction
* @see #getSourceDropActions
- * @see #isDrop
+ * @see #isDrop()
*/
public void setDropAction(int dropAction) {
assureIsDrop();
@@ -440,7 +440,7 @@ public class TransferHandler implements Serializable {
* @throws IllegalStateException if this is not a drop
* @see #setDropAction
* @see #getUserDropAction
- * @see #isDrop
+ * @see #isDrop()
*/
public int getDropAction() {
return dropAction == -1 ? getUserDropAction() : dropAction;
@@ -468,7 +468,7 @@ public class TransferHandler implements Serializable {
* @throws IllegalStateException if this is not a drop
* @see #setDropAction
* @see #getDropAction
- * @see #isDrop
+ * @see #isDrop()
*/
public int getUserDropAction() {
assureIsDrop();
@@ -501,7 +501,7 @@ public class TransferHandler implements Serializable {
*
* @return the drag source's supported drop actions
* @throws IllegalStateException if this is not a drop
- * @see #isDrop
+ * @see #isDrop()
*/
public int getSourceDropActions() {
assureIsDrop();
diff --git a/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java b/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java
index 071942e8ca7..47ed2c69c95 100644
--- a/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java
+++ b/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java
@@ -32,8 +32,7 @@ package javax.swing.event;
* equivalent to the WindowAdapter class in the AWT.
* * See How to Write an Internal Frame Listener - * in The Java Tutorial and - * The Java Class Libraries (update) + * in The Java Tutorial * * @see InternalFrameEvent * @see InternalFrameListener diff --git a/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java b/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java index 22258be8b8b..c156767725f 100644 --- a/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java +++ b/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java @@ -33,9 +33,7 @@ import java.util.EventListener; * in the AWT. *
* See How to Write an Internal Frame Listener - * in The Java Tutorial and - * The Java Class Libraries (update) - * for further documentation. + * in The Java Tutorial for further documentation. * * @see java.awt.event.WindowListener * diff --git a/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html b/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html index c86476b19c4..5160494f750 100644 --- a/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html +++ b/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html @@ -66,7 +66,7 @@ This document has the following sections: Before reading further, you should be familiar with the concept of pluggable look and feels. For basic information, see -Choosing the Look and Feel, +How to Set the Look and Feel, a section in The Java Tutorial. For architectural details, you can read diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html index f5f66a2d2a1..dfb99f4ef50 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html +++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html @@ -91,7 +91,7 @@ div.example {
<!ELEMENT style (property | defaultsProperty | state | font | graphicsUtils | - insets | painter | imagePainter | opaque | (%beansPersistance;) | + insets | painter | imagePainter | opaque | (%beansPersistance;) | imageIcon)*> <!ATTLIST style id ID #IMPLIED @@ -250,8 +250,8 @@ div.example {Defines the font for the current state, or style. You must - specify either an idref or a - name and size. + specify either an idref or a + name and size.
The following example creates a style with a Font of @@ -797,7 +797,7 @@ div.example { path CDATA #REQUIRED sourceInsets CDATA #IMPLIED destinationInsets CDATA #IMPLIED - paintCenter (true|false) "true" + paintCenter (true|false) "true" stretch (true|false) "true" center (true|false) "false" > diff --git a/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java b/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java index 00cd059cc23..ab3f9c34d1e 100644 --- a/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java +++ b/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java @@ -384,7 +384,7 @@ public class AsyncBoxView extends View { /** * Loads all of the children to initialize the view. - * This is called by the setParent + * This is called by the {@link #setParent setParent} * method. Subclasses can reimplement this to initialize * their child views in a different manner. The default * implementation creates a child view for each diff --git a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java index 7a3a2807bbb..b51cd4012c8 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java @@ -70,7 +70,7 @@ import sun.swing.SwingUtilities2; * will render a solid color as specified in the associated text component * in the
SelectionColor
property. This can easily be changed * by reimplementing the - * getSelectionHighlighter + * {@link #getSelectionPainter getSelectionPainter} * method. ** A customized caret appearance can be achieved by reimplementing diff --git a/jdk/src/share/classes/javax/swing/text/TableView.java b/jdk/src/share/classes/javax/swing/text/TableView.java index 3c15ba0f41d..bab545c7af5 100644 --- a/jdk/src/share/classes/javax/swing/text/TableView.java +++ b/jdk/src/share/classes/javax/swing/text/TableView.java @@ -315,7 +315,7 @@ public abstract class TableView extends BoxView { * updated along the minor axis. *
* This is implemented to call the - * layoutColumns method, and then + * {@link #layoutColumns layoutColumns} method, and then * forward to the superclass to actually carry out the layout * of the tables rows. * diff --git a/jdk/src/share/classes/javax/swing/text/View.java b/jdk/src/share/classes/javax/swing/text/View.java index 369907d2e63..38573feba17 100644 --- a/jdk/src/share/classes/javax/swing/text/View.java +++ b/jdk/src/share/classes/javax/swing/text/View.java @@ -117,7 +117,7 @@ A view has the following responsibilities: what it is prepared to deal with.
Component
(i.e. the Component
returned by the
- getContainer method).
+ {@link #getContainer getContainer} method).
This means a child view lives in the same coordinate system as the parent
view unless the parent has explicitly changed the coordinate system.
To schedule itself to be repainted a view can call repaint on the hosting
@@ -180,9 +180,9 @@ A view has the following responsibilities:
starting from the root of the view hierarchy.
The methods for doing this are:
@@ -497,6 +497,10 @@ public abstract class View implements SwingConstants { public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException { + if (pos < -1) { + // -1 is a reserved value, see the code below + throw new BadLocationException("Invalid position", pos); + } biasRet[0] = Position.Bias.Forward; switch (direction) { @@ -670,15 +674,15 @@ public abstract class View implements SwingConstants { * spread out into the following calls that subclasses can * reimplement: *
insertUpdate
,
* removeUpdate
, or changedUpdate
depending
* upon the type of the event. This is called by
- * forwardUpdate to forward
+ * {@link #forwardUpdate forwardUpdate} to forward
* the event to children that need it.
*
* @param v the child view to forward the event to
diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
index f9642c7bdd7..1c5275e77a3 100644
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
@@ -123,7 +123,7 @@ import java.lang.ref.*;
* to load. By default, this kit produces documents that will be
* loaded asynchronously if loaded using JEditorPane.setPage
.
* This is controlled by a property on the document. The method
- * createDefaultDocument can
+ * {@link #createDefaultDocument createDefaultDocument} can
* be overriden to change this. The batching of work is done
* by the HTMLDocument.HTMLReader
class. The actual
* work is done by the DefaultStyledDocument
and
@@ -558,7 +558,7 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible {
* automatically or only FormSubmitEvent
is fired.
* By default it is set to true.
*
- * @see #isAutoFormSubmission
+ * @see #isAutoFormSubmission()
* @see FormSubmitEvent
* @since 1.5
*/
diff --git a/jdk/src/share/classes/javax/swing/text/html/ParagraphView.java b/jdk/src/share/classes/javax/swing/text/html/ParagraphView.java
index f0ee60ea700..e180e0e112e 100644
--- a/jdk/src/share/classes/javax/swing/text/html/ParagraphView.java
+++ b/jdk/src/share/classes/javax/swing/text/html/ParagraphView.java
@@ -61,7 +61,7 @@ public class ParagraphView extends javax.swing.text.ParagraphView {
* * This is implemented * to forward to the superclass as well as call the - * setPropertiesFromAttributes + * {@link #setPropertiesFromAttributes setPropertiesFromAttributes} * method to set the paragraph properties from the css * attributes. The call is made at this time to ensure * the ability to resolve upward through the parents diff --git a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java index 8d5bab21515..e82a5dc8ac9 100644 --- a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java +++ b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java @@ -51,7 +51,7 @@ import javax.swing.text.*; *
* The primary entry point for HTML View implementations
* to get their attributes is the
- * getViewAttributes
+ * {@link #getViewAttributes getViewAttributes}
* method. This should be implemented to establish the
* desired policy used to associate attributes with the view.
* Each HTMLEditorKit (i.e. and therefore each associated
diff --git a/jdk/src/share/classes/javax/swing/text/html/parser/ParserDelegator.java b/jdk/src/share/classes/javax/swing/text/html/parser/ParserDelegator.java
index 06b53483dc0..f8aa19f9b03 100644
--- a/jdk/src/share/classes/javax/swing/text/html/parser/ParserDelegator.java
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/ParserDelegator.java
@@ -48,7 +48,11 @@ public class ParserDelegator extends HTMLEditorKit.Parser implements Serializabl
private static final Object DTD_KEY = new Object();
- protected static synchronized void setDefaultDTD() {
+ protected static void setDefaultDTD() {
+ getDefaultDTD();
+ }
+
+ private static synchronized DTD getDefaultDTD() {
AppContext appContext = AppContext.getAppContext();
DTD dtd = (DTD) appContext.get(DTD_KEY);
@@ -67,6 +71,8 @@ public class ParserDelegator extends HTMLEditorKit.Parser implements Serializabl
appContext.put(DTD_KEY, dtd);
}
+
+ return dtd;
}
protected static DTD createDTD(DTD dtd, String name) {
@@ -92,7 +98,7 @@ public class ParserDelegator extends HTMLEditorKit.Parser implements Serializabl
}
public void parse(Reader r, HTMLEditorKit.ParserCallback cb, boolean ignoreCharSet) throws IOException {
- new DocumentParser((DTD) AppContext.getAppContext().get(DTD_KEY)).parse(r, cb, ignoreCharSet);
+ new DocumentParser(getDefaultDTD()).parse(r, cb, ignoreCharSet);
}
/**
diff --git a/jdk/src/share/classes/sun/applet/AppletClassLoader.java b/jdk/src/share/classes/sun/applet/AppletClassLoader.java
index 730134007b1..40fd6b28903 100644
--- a/jdk/src/share/classes/sun/applet/AppletClassLoader.java
+++ b/jdk/src/share/classes/sun/applet/AppletClassLoader.java
@@ -663,13 +663,15 @@ public class AppletClassLoader extends URLClassLoader {
// set the context class loader to the AppletClassLoader.
creatorThread.setContextClassLoader(AppletClassLoader.this);
- synchronized(creatorThread.syncObject) {
- creatorThread.start();
- try {
- creatorThread.syncObject.wait();
- } catch (InterruptedException e) { }
- appContext = creatorThread.appContext;
- }
+ creatorThread.start();
+ try {
+ synchronized(creatorThread.syncObject) {
+ while (!creatorThread.created) {
+ creatorThread.syncObject.wait();
+ }
+ }
+ } catch (InterruptedException e) { }
+ appContext = creatorThread.appContext;
return null;
}
});
@@ -854,14 +856,16 @@ public void grab() {
class AppContextCreator extends Thread {
Object syncObject = new Object();
AppContext appContext = null;
+ volatile boolean created = false;
AppContextCreator(ThreadGroup group) {
super(group, "AppContextCreator");
}
public void run() {
- synchronized(syncObject) {
- appContext = SunToolkit.createNewAppContext();
+ appContext = SunToolkit.createNewAppContext();
+ created = true;
+ synchronized(syncObject) {
syncObject.notifyAll();
}
} // run()
diff --git a/jdk/src/share/classes/sun/awt/SunToolkit.java b/jdk/src/share/classes/sun/awt/SunToolkit.java
index 0442aeeaba6..b3067aeba2e 100644
--- a/jdk/src/share/classes/sun/awt/SunToolkit.java
+++ b/jdk/src/share/classes/sun/awt/SunToolkit.java
@@ -696,7 +696,9 @@ public abstract class SunToolkit extends Toolkit
synchronized (lock) {
executeOnEventHandlerThread(event);
- lock.wait();
+ while(!event.isDispatched()) {
+ lock.wait();
+ }
}
Throwable eventThrowable = event.getThrowable();
diff --git a/jdk/src/share/classes/sun/font/FileFontStrike.java b/jdk/src/share/classes/sun/font/FileFontStrike.java
index ae6045f696c..3782c9ed3ba 100644
--- a/jdk/src/share/classes/sun/font/FileFontStrike.java
+++ b/jdk/src/share/classes/sun/font/FileFontStrike.java
@@ -151,6 +151,23 @@ public class FileFontStrike extends PhysicalStrike {
}
}
+ /* Amble fonts are better rendered unhinted although there's the
+ * inevitable fuzziness that accompanies this due to no longer
+ * snapping stems to the pixel grid. The exception is that in B&W
+ * mode they are worse without hinting. The down side to that is that
+ * B&W metrics will differ which normally isn't the case, although
+ * since AA mode is part of the measuring context that should be OK.
+ * We don't expect Amble to be installed in the Windows fonts folder.
+ * If we were to, then we'd also might want to disable using the
+ * native rasteriser path which is used for LCD mode for platform
+ * fonts. since we have no way to disable hinting by GDI.
+ * In the case of Amble, since its 'gasp' table says to disable
+ * hinting, I'd expect GDI to follow that, so likely it should
+ * all be consistent even if GDI used.
+ */
+ boolean disableHinting = desc.aaHint != INTVAL_TEXT_ANTIALIAS_OFF &&
+ fileFont.familyName.startsWith("Amble");
+
/* If any of the values is NaN then substitute the null scaler context.
* This will return null images, zero advance, and empty outlines
* as no rendering need take place in this case.
@@ -165,7 +182,7 @@ public class FileFontStrike extends PhysicalStrike {
pScalerContext = fileFont.getScaler().createScalerContext(matrix,
fileFont instanceof TrueTypeFont,
desc.aaHint, desc.fmHint,
- boldness, italic);
+ boldness, italic, disableHinting);
}
mapper = fileFont.getMapper();
@@ -566,10 +583,44 @@ public class FileFontStrike extends PhysicalStrike {
if (glyphCode >= INVISIBLE_GLYPHS) {
return 0f;
}
+
+ /* Notes on the (getUserAdv == false) case.
+ *
+ * Setting getUserAdv == false is internal to this class.
+ * If there's no graphics transform we can let
+ * getGlyphAdvance take its course, and potentially caching in
+ * advances arrays, except for signalling that
+ * getUserAdv == false means there is no need to create an image.
+ * It is possible that code already calculated the user advance,
+ * and it is desirable to take advantage of that work.
+ * But, if there's a transform and we want device advance, we
+ * can't use any values cached in the advances arrays - unless
+ * first re-transform them into device space using 'desc.devTx'.
+ * invertDevTx is null if the graphics transform is identity,
+ * a translate, or non-invertible. The latter case should
+ * not ever occur in the getUserAdv == false path.
+ * In other words its either null, or the inversion of a
+ * simple uniform scale. If its null, we can populate and
+ * use the advance caches as normal.
+ *
+ * If we don't find a cached value, obtain the device advance and
+ * return it. This will get stashed on the image by the caller and any
+ * subsequent metrics calls will be able to use it as is the case
+ * whenever an image is what is initially requested.
+ *
+ * Don't query if there's a value cached on the image, since this
+ * getUserAdv==false code path is entered solely when none exists.
+ */
if (horizontalAdvances != null) {
advance = horizontalAdvances[glyphCode];
if (advance != Float.MAX_VALUE) {
- return advance;
+ if (!getUserAdv && invertDevTx != null) {
+ Point2D.Float metrics = new Point2D.Float(advance, 0f);
+ desc.devTx.deltaTransform(metrics, metrics);
+ return metrics.x;
+ } else {
+ return advance;
+ }
}
} else if (segmentedCache && segHorizontalAdvances != null) {
int segIndex = glyphCode >> SEGSHIFT;
@@ -577,11 +628,23 @@ public class FileFontStrike extends PhysicalStrike {
if (subArray != null) {
advance = subArray[glyphCode % SEGSIZE];
if (advance != Float.MAX_VALUE) {
- return advance;
+ if (!getUserAdv && invertDevTx != null) {
+ Point2D.Float metrics = new Point2D.Float(advance, 0f);
+ desc.devTx.deltaTransform(metrics, metrics);
+ return metrics.x;
+ } else {
+ return advance;
+ }
}
}
}
+ if (!getUserAdv && invertDevTx != null) {
+ Point2D.Float metrics = new Point2D.Float();
+ fileFont.getGlyphMetrics(pScalerContext, glyphCode, metrics);
+ return metrics.x;
+ }
+
if (invertDevTx != null || !getUserAdv) {
/* If there is a device transform need x & y advance to
* transform back into user space.
@@ -725,7 +788,7 @@ public class FileFontStrike extends PhysicalStrike {
return getGlyphMetrics(glyphCode, true);
}
- private Point2D.Float getGlyphMetrics(int glyphCode, boolean getUserAdv) {
+ private Point2D.Float getGlyphMetrics(int glyphCode, boolean getImage) {
Point2D.Float metrics = new Point2D.Float();
// !!! or do we force sgv user glyphs?
@@ -733,7 +796,7 @@ public class FileFontStrike extends PhysicalStrike {
return metrics;
}
long glyphPtr;
- if (getImageWithAdvance && getUserAdv) {
+ if (getImageWithAdvance && getImage) {
/* A heuristic optimisation says that for most cases its
* worthwhile retrieving the image at the same time as the
* metrics. So here we get the image data even if its not
@@ -750,9 +813,9 @@ public class FileFontStrike extends PhysicalStrike {
metrics.y = StrikeCache.unsafe.getFloat
(glyphPtr + StrikeCache.yAdvanceOffset);
/* advance is currently in device space, need to convert back
- * into user space, unless getUserAdv == false.
+ * into user space.
* This must not include the translation component. */
- if (invertDevTx != null && getUserAdv) {
+ if (invertDevTx != null) {
invertDevTx.deltaTransform(metrics, metrics);
}
} else {
@@ -781,9 +844,9 @@ public class FileFontStrike extends PhysicalStrike {
if (value == null) {
fileFont.getGlyphMetrics(pScalerContext, glyphCode, metrics);
/* advance is currently in device space, need to convert back
- * into user space, unless getUserAdv == false.
+ * into user space.
*/
- if (invertDevTx != null && getUserAdv) {
+ if (invertDevTx != null) {
invertDevTx.deltaTransform(metrics, metrics);
}
value = new Point2D.Float(metrics.x, metrics.y);
diff --git a/jdk/src/share/classes/sun/font/FontScaler.java b/jdk/src/share/classes/sun/font/FontScaler.java
index eae9fb22ab5..a2c1c09ef7f 100644
--- a/jdk/src/share/classes/sun/font/FontScaler.java
+++ b/jdk/src/share/classes/sun/font/FontScaler.java
@@ -242,9 +242,10 @@ public abstract class FontScaler implements DisposerRecord {
freed when corresponding strike is being released.
*/
abstract long createScalerContext(double[] matrix,
- boolean fontType,
- int aa, int fm,
- float boldness, float italic);
+ boolean fontType,
+ int aa, int fm,
+ float boldness, float italic,
+ boolean disableHinting);
/* Marks context as invalid because native scaler is invalid.
Notes:
diff --git a/jdk/src/share/classes/sun/font/FreetypeFontScaler.java b/jdk/src/share/classes/sun/font/FreetypeFontScaler.java
index bb4143c048d..69d0c53965e 100644
--- a/jdk/src/share/classes/sun/font/FreetypeFontScaler.java
+++ b/jdk/src/share/classes/sun/font/FreetypeFontScaler.java
@@ -211,7 +211,8 @@ class FreetypeFontScaler extends FontScaler {
}
long createScalerContext(double[] matrix, boolean fontType,
- int aa, int fm, float boldness, float italic) {
+ int aa, int fm, float boldness, float italic,
+ boolean disableHinting) {
if (nativeScaler != 0L) {
return createScalerContextNative(nativeScaler, matrix,
fontType, aa, fm, boldness, italic);
diff --git a/jdk/src/share/classes/sun/font/NullFontScaler.java b/jdk/src/share/classes/sun/font/NullFontScaler.java
index 1258243550b..857ec5a88c8 100644
--- a/jdk/src/share/classes/sun/font/NullFontScaler.java
+++ b/jdk/src/share/classes/sun/font/NullFontScaler.java
@@ -67,7 +67,7 @@ class NullFontScaler extends FontScaler {
long getLayoutTableCache() {return 0L;}
long createScalerContext(double[] matrix, boolean fontType, int aa,
- int fm, float boldness, float italic) {
+ int fm, float boldness, float italic, boolean disableHinting) {
return getNullScalerContext();
}
diff --git a/jdk/src/share/classes/sun/font/SunFontManager.java b/jdk/src/share/classes/sun/font/SunFontManager.java
index 991064e38ae..e9b3bf171d0 100644
--- a/jdk/src/share/classes/sun/font/SunFontManager.java
+++ b/jdk/src/share/classes/sun/font/SunFontManager.java
@@ -1576,7 +1576,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
.info("Trying to resolve file " + fullPath);
}
do {
- ttf = new TrueTypeFont(fullPath, null, fn++, true);
+ ttf = new TrueTypeFont(fullPath, null, fn++, false);
// prefer the font's locale name.
String fontName = ttf.getFontName(l).toLowerCase();
if (unmappedFonts.contains(fontName)) {
@@ -1595,6 +1595,207 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
}
}
+ /* Hardwire the English names and expected file names of fonts
+ * commonly used at start up. Avoiding until later even the small
+ * cost of calling platform APIs to locate these can help.
+ * The code that registers these fonts needs to "bail" if any
+ * of the files do not exist, so it will verify the existence of
+ * all non-null file names first.
+ * They are added in to a map with nominally the first
+ * word in the name of the family as the key. In all the cases
+ * we are using the the family name is a single word, and as is
+ * more or less required the family name is the initial sequence
+ * in a full name. So lookup first finds the matching description,
+ * then registers the whole family, returning the right font.
+ */
+ public static class FamilyDescription {
+ public String familyName;
+ public String plainFullName;
+ public String boldFullName;
+ public String italicFullName;
+ public String boldItalicFullName;
+ public String plainFileName;
+ public String boldFileName;
+ public String italicFileName;
+ public String boldItalicFileName;
+ }
+
+ static HashMap/opt:REF
when building the dll.
/MD /D _STATIC_CPPLIB
option.
-This causes your dll to become dependent on MSVCRT.DLL and/or
-the newer C++ runtime MSVCR71.DLL.
+This causes your dll to become dependent on just MSVCR*.DLL.
The option /D _STATIC_CPPLIB prevents you from becoming dependent on the
-C++ library MSVCP71.DLL.
+C++ library MSVCP*.DLL.
This is what we use in the JDK, but there are probably many combinations
that you could safely use, unfortunately there are many combinations
of runtimes that will not work.
diff --git a/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h b/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h
index 95e5f33c394..be20d886c00 100644
--- a/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h
+++ b/jdk/src/share/native/sun/awt/image/jpeg/jmorecfg.h
@@ -161,11 +161,11 @@ typedef short INT16;
/* INT32 must hold at least signed 32-bit values. */
-#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
-#ifndef _LP64
-typedef long INT32;
-#else
+#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
+#if defined(_LP64) || defined(_WIN32) /* _WIN32 is on all windows platfroms (x86 and x64) */
typedef int INT32;
+#else
+typedef long INT32;
#endif
#endif
@@ -221,11 +221,14 @@ typedef unsigned int JDIMENSION;
* explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
*/
+
+#ifndef FAR
#ifdef NEED_FAR_POINTERS
#define FAR far
#else
#define FAR
#endif
+#endif
/*
diff --git a/jdk/src/share/native/sun/font/FontInstanceAdapter.cpp b/jdk/src/share/native/sun/font/FontInstanceAdapter.cpp
index 1db169a6dc3..952523105c1 100644
--- a/jdk/src/share/native/sun/font/FontInstanceAdapter.cpp
+++ b/jdk/src/share/native/sun/font/FontInstanceAdapter.cpp
@@ -224,6 +224,7 @@ void FontInstanceAdapter::getWideGlyphAdvance(le_uint32 glyph, LEPoint &advance)
if (pt != NULL) {
advance.fX = env->GetFloatField(pt, sunFontIDs.xFID);
advance.fY = env->GetFloatField(pt, sunFontIDs.yFID);
+ env->DeleteLocalRef(pt);
}
}
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c
index 7493c837cb8..bd2c03c1ac6 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c
@@ -137,7 +137,7 @@ void errorHandler(cmsContext ContextID, cmsUInt32Number errorCode,
JNU_ThrowByName(env, "java/awt/color/CMMException", errMsg);
}
-JNIEXPORT int JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) {
+JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) {
javaVM = jvm;
cmsSetLogErrorHandler(errorHandler);
diff --git a/jdk/src/solaris/classes/sun/awt/X11FontManager.java b/jdk/src/solaris/classes/sun/awt/X11FontManager.java
index fea46ff56c3..573d250acba 100644
--- a/jdk/src/solaris/classes/sun/awt/X11FontManager.java
+++ b/jdk/src/solaris/classes/sun/awt/X11FontManager.java
@@ -718,25 +718,6 @@ public class X11FontManager extends SunFontManager {
fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}
- /* Called by MToolkit to set the X11 font path */
- public static void setNativeFontPath() {
- if (fontdirs == null) {
- return;
- }
-
- // need to register these individually rather than by one call
- // to ensure that one bad directory doesn't cause all to be rejected
- for (int i=0; i