--- old/common/autoconf/generated-configure.sh 2016-07-01 17:48:42.939851905 +0200 +++ new/common/autoconf/generated-configure.sh 2016-07-01 17:48:42.827847168 +0200 @@ -976,7 +976,6 @@ DEBUG_LEVEL HOTSPOT_DEBUG_LEVEL JDK_VARIANT -SET_OPENJDK USERNAME CANONICAL_TOPDIR ORIGINAL_TOPDIR @@ -5095,7 +5094,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1467223237 +DATE_WHEN_GENERATED=1467382439 ############################################################################### # @@ -16592,41 +16591,17 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for presence of closed sources" >&5 -$as_echo_n "checking for presence of closed sources... " >&6; } - if test -d "$SRC_ROOT/jdk/src/closed"; then - CLOSED_SOURCE_PRESENT=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if custom source is suppressed (openjdk-only)" >&5 +$as_echo_n "checking if custom source is suppressed (openjdk-only)... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_openjdk_only" >&5 +$as_echo "$enable_openjdk_only" >&6; } + if test "x$enable_openjdk_only" = "xyes"; then + SUPPRESS_CUSTOM_SOURCE="true" + elif test "x$enable_openjdk_only" = "xno"; then + SUPPRESS_CUSTOM_SOURCE="false" else - CLOSED_SOURCE_PRESENT=no + as_fn_error $? "Invalid value for --enable-openjdk-only: $enable_openjdk_only" "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLOSED_SOURCE_PRESENT" >&5 -$as_echo "$CLOSED_SOURCE_PRESENT" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closed source is suppressed (openjdk-only)" >&5 -$as_echo_n "checking if closed source is suppressed (openjdk-only)... " >&6; } - SUPPRESS_CLOSED_SOURCE="$enable_openjdk_only" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SUPPRESS_CLOSED_SOURCE" >&5 -$as_echo "$SUPPRESS_CLOSED_SOURCE" >&6; } - - if test "x$CLOSED_SOURCE_PRESENT" = xno; then - OPENJDK=true - if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No closed source present, --enable-openjdk-only makes no sense" >&5 -$as_echo "$as_me: WARNING: No closed source present, --enable-openjdk-only makes no sense" >&2;} - fi - else - if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then - OPENJDK=true - else - OPENJDK=false - fi - fi - - if test "x$OPENJDK" = "xtrue"; then - SET_OPENJDK="OPENJDK=true" - fi - - # custom-make-dir is deprecated. Please use your custom-hook.m4 to override # the IncludeCustomExtension macro. @@ -53313,11 +53288,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 $as_echo "no, forced" >&6; } elif test "x$enable_dtrace" = "xauto" || test "x$enable_dtrace" = "x"; then - if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK" != "xtrue"; then - INCLUDE_DTRACE=false - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, non-open linux build" >&5 -$as_echo "no, non-open linux build" >&6; } - elif test "x$DTRACE_DEP_MISSING" = "xtrue"; then + if test "x$DTRACE_DEP_MISSING" = "xtrue"; then INCLUDE_DTRACE=false { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing dependencies" >&5 $as_echo "no, missing dependencies" >&6; } @@ -53596,11 +53567,9 @@ NEEDS_LIB_CUPS=true fi - # Check if freetype is needed - if test "x$OPENJDK" = "xtrue"; then + # A custom hook may have set this already + if test "x$NEEDS_LIB_FREETYPE" = "x"; then NEEDS_LIB_FREETYPE=true - else - NEEDS_LIB_FREETYPE=false fi # Check if alsa is needed --- old/common/autoconf/hotspot.m4 2016-07-01 17:48:44.251907392 +0200 +++ new/common/autoconf/hotspot.m4 2016-07-01 17:48:44.171904009 +0200 @@ -161,10 +161,7 @@ INCLUDE_DTRACE=false AC_MSG_RESULT([no, forced]) elif test "x$enable_dtrace" = "xauto" || test "x$enable_dtrace" = "x"; then - if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK" != "xtrue"; then - INCLUDE_DTRACE=false - AC_MSG_RESULT([no, non-open linux build]) - elif test "x$DTRACE_DEP_MISSING" = "xtrue"; then + if test "x$DTRACE_DEP_MISSING" = "xtrue"; then INCLUDE_DTRACE=false AC_MSG_RESULT([no, missing dependencies]) else --- old/common/autoconf/jdk-options.m4 2016-07-01 17:48:44.607922448 +0200 +++ new/common/autoconf/jdk-options.m4 2016-07-01 17:48:44.527919065 +0200 @@ -117,36 +117,15 @@ AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only], [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"]) - AC_MSG_CHECKING([for presence of closed sources]) - if test -d "$SRC_ROOT/jdk/src/closed"; then - CLOSED_SOURCE_PRESENT=yes + AC_MSG_CHECKING([if custom source is suppressed (openjdk-only)]) + AC_MSG_RESULT([$enable_openjdk_only]) + if test "x$enable_openjdk_only" = "xyes"; then + SUPPRESS_CUSTOM_SOURCE="true" + elif test "x$enable_openjdk_only" = "xno"; then + SUPPRESS_CUSTOM_SOURCE="false" else - CLOSED_SOURCE_PRESENT=no + AC_MSG_ERROR([Invalid value for --enable-openjdk-only: $enable_openjdk_only]) fi - AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT]) - - AC_MSG_CHECKING([if closed source is suppressed (openjdk-only)]) - SUPPRESS_CLOSED_SOURCE="$enable_openjdk_only" - AC_MSG_RESULT([$SUPPRESS_CLOSED_SOURCE]) - - if test "x$CLOSED_SOURCE_PRESENT" = xno; then - OPENJDK=true - if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then - AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense]) - fi - else - if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then - OPENJDK=true - else - OPENJDK=false - fi - fi - - if test "x$OPENJDK" = "xtrue"; then - SET_OPENJDK="OPENJDK=true" - fi - - AC_SUBST(SET_OPENJDK) # custom-make-dir is deprecated. Please use your custom-hook.m4 to override # the IncludeCustomExtension macro. --- old/common/autoconf/libraries.m4 2016-07-01 17:48:44.975938012 +0200 +++ new/common/autoconf/libraries.m4 2016-07-01 17:48:44.895934628 +0200 @@ -59,11 +59,9 @@ NEEDS_LIB_CUPS=true fi - # Check if freetype is needed - if test "x$OPENJDK" = "xtrue"; then + # A custom hook may have set this already + if test "x$NEEDS_LIB_FREETYPE" = "x"; then NEEDS_LIB_FREETYPE=true - else - NEEDS_LIB_FREETYPE=false fi # Check if alsa is needed --- old/common/autoconf/spec.gmk.in 2016-07-01 17:48:45.339953406 +0200 +++ new/common/autoconf/spec.gmk.in 2016-07-01 17:48:45.259950023 +0200 @@ -108,7 +108,6 @@ REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@ REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@ -@SET_OPENJDK@ LIBM:=@LIBM@ LIBDL:=@LIBDL@ --- old/make/CompileJavaModules.gmk 2016-07-01 17:48:45.703968800 +0200 +++ new/make/CompileJavaModules.gmk 2016-07-01 17:48:45.623965417 +0200 @@ -209,11 +209,6 @@ java.desktop_EXCLUDES += sun/applet endif -# Why is this in the open source tree? -ifdef OPENJDK - java.desktop_EXCLUDES += sun/dc -endif - # Used on windows and macosx ifeq ($(filter $(OPENJDK_TARGET_OS), windows macosx), ) java.desktop_EXCLUDE_FILES += sun/awt/AWTCharset.java --- old/make/Images.gmk 2016-07-01 17:48:46.059983856 +0200 +++ new/make/Images.gmk 2016-07-01 17:48:45.983980642 +0200 @@ -207,12 +207,6 @@ tnameserv.1 \ unpack200.1 - ifndef OPENJDK - ifneq ($(OPENJDK_TARGET_OS), solaris) - JRE_MAN_PAGES += javaws.1 - endif - endif - JDK_MAN_PAGES += \ $(JRE_MAN_PAGES) \ appletviewer.1 \ --- old/make/Javadoc.gmk 2016-07-01 17:48:46.415998912 +0200 +++ new/make/Javadoc.gmk 2016-07-01 17:48:46.339995698 +0200 @@ -290,19 +290,15 @@ # Common javadoc options used by all bundles -ifdef OPENJDK - ADDITIONAL_JAVADOCFLAGS = \ - -Xdocrootparent $(DOCS_BASE_URL) -else - ADDITIONAL_JAVADOCFLAGS = -endif +# This flag may be overridden from a custom makefile +DOCROOTPARENT_FLAG = -Xdocrootparent $(DOCS_BASE_URL) define COMMON_JAVADOCFLAGS $(call OptionOnly,-XDignore.symbol.file=true) ; \ $(call OptionOnly,-quiet) ; \ $(call OptionOnly,-use) ; \ $(call OptionOnly,-keywords) ; \ - $(call OptionOnly,$(ADDITIONAL_JAVADOCFLAGS)) + $(call OptionOnly,$(DOCROOTPARENT_FLAG)) endef # Common javadoc tags used by all bundles @@ -1038,8 +1034,6 @@ MGMT_DOCDIR := $(JRE_API_DOCSDIR)/management/extension MGMT2COREAPI := ../../$(JDKJRE2COREAPI) -JVM_MIB_NAME := JVM-MANAGEMENT-MIB.mib -JVM_MIB_SRC := $(JDK_TOPDIR)/src/closed/jdk.snmp/share/classes/sun/management/snmp/$(JVM_MIB_NAME) MGMT_DOCTITLE := Monitoring and Management Interface for the Java$(TRADEMARK) Platform MGMT_WINDOWTITLE := Monitoring and Management Interface for the Java Platform MGMT_HEADER := Monitoring and Management Interface for the Java Platform @@ -1063,11 +1057,6 @@ # Run javadoc if the index file is out of date or missing $(MGMT_INDEX_FILE): $(MGMT_OPTIONS_FILE) $(MGMT_PACKAGES_FILE) $(COREAPI_INDEX_FILE) $(prep-javadoc) - @if [ -f $(JVM_MIB_SRC) ] ; then \ - $(CP) $(JVM_MIB_SRC) $(@D)/.. ; \ - else \ - $(ECHO) "WARNING: File $(JVM_MIB_NAME) not available."; \ - fi $(call JavadocSummary,$(MGMT_OPTIONS_FILE),$(MGMT_PACKAGES_FILE)) $(JAVADOC_CMD_SMALL) -d $(@D) \ @$(MGMT_OPTIONS_FILE) @$(MGMT_PACKAGES_FILE) @@ -1705,3 +1694,7 @@ ############################################################# .PHONY: all docs coredocs otherdocs \ $(ALL_OTHER_TARGETS) zip-docs + +################################################################################ + +$(eval $(call IncludeCustomExtension, , Javadoc-post.gmk)) --- old/jdk/make/gendata/GendataBlacklistedCerts.gmk 2016-07-01 17:48:46.904019551 +0200 +++ new/jdk/make/gendata/GendataBlacklistedCerts.gmk 2016-07-01 17:48:46.744012784 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2016, 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 @@ -23,16 +23,14 @@ # questions. # -GENDATA_BLACKLISTED_CERTS_SRC := $(JDK_TOPDIR)/make/data/blacklistedcertsconverter/blacklisted.certs.pem +$(eval $(call IncludeCustomExtension, jdk, gendata/GendataBlacklistedCerts.gmk)) + +GENDATA_BLACKLISTED_CERTS_SRC += $(JDK_TOPDIR)/make/data/blacklistedcertsconverter/blacklisted.certs.pem GENDATA_BLACKLISTED_CERTS := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/security/blacklisted.certs -ifndef OPENJDK - GENDATA_BLACKLISTED_CERTS_SRC += $(wildcard $(JDK_TOPDIR)/make/closed/data/blacklistedcertsconverter/blacklisted.certs.pem) -endif - $(GENDATA_BLACKLISTED_CERTS): $(BUILD_TOOLS) $(GENDATA_BLACKLISTED_CERTS_SRC) - $(ECHO) "Generating blacklisted certs" - $(MKDIR) -p $(@D) + $(call LogInfo, Generating blacklisted certs) + $(call MakeDir, $(@D)) ($(CAT) $(GENDATA_BLACKLISTED_CERTS_SRC) | $(TOOL_BLACKLISTED_CERTS) > $@) || exit 1 TARGETS += $(GENDATA_BLACKLISTED_CERTS) --- old/jdk/make/gendata/GendataFontConfig.gmk 2016-07-01 17:48:47.400040528 +0200 +++ new/jdk/make/gendata/GendataFontConfig.gmk 2016-07-01 17:48:47.248034099 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2016, 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 @@ -23,14 +23,11 @@ # questions. # +$(eval $(call IncludeCustomExtension, jdk, gendata/GendataFontConfig.gmk)) + GENDATA_FONT_CONFIG_DST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE) -GENDATA_FONT_CONFIG_DATA_DIR := $(JDK_TOPDIR)/make/data/fontconfig -ifndef OPENJDK - ifeq ($(OPENJDK_TARGET_OS), linux) - GENDATA_FONT_CONFIG_DATA_DIR := $(JDK_TOPDIR)/make/closed/data/fontconfig - endif -endif +GENDATA_FONT_CONFIG_DATA_DIR ?= $(JDK_TOPDIR)/make/data/fontconfig GENDATA_FONT_CONFIG_SRC_FILES := \ $(wildcard $(GENDATA_FONT_CONFIG_DATA_DIR)/$(OPENJDK_TARGET_OS).*) @@ -55,4 +52,3 @@ $(GENDATA_FONT_CONFIG_DST)/%.bfc, $(GENDATA_FONT_CONFIG_SRC_FILES)) TARGETS := $(GENDATA_FONT_CONFIGS) $(GENDATA_BFONT_CONFIGS) - --- old/jdk/make/gendata/GendataPolicyJars.gmk 2016-07-01 17:48:48.100070132 +0200 +++ new/jdk/make/gendata/GendataPolicyJars.gmk 2016-07-01 17:48:47.744055076 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2016, 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 @@ -40,22 +40,6 @@ US_EXPORT_POLICY_JAR_UNLIMITED := \ $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy.jar -ifndef OPENJDK - # - # In past releases, Oracle JDK has had a separately downloadable set of - # policy files which has been a nightmare for deployment. - # - # Now if we're closed and limited (default for Oracle JDK), create - # an "unlimited_policy" directory that contains the unlimited policy - # files. It will be up to the user/deployer to make an informed choice - # as to whether they are legally entitled to use the unlimited policy - # file in their environment. Users/deployers simply need to overwrite - # the files. Consult README.txt (below) for more info. - # - UNLIMITED_POLICY_DIR := \ - $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/unlimited_policy -endif - # # TODO fix so that SetupJarArchive does not write files into SRCS # then we don't need this extra copying @@ -100,15 +84,6 @@ $(install-file) endif -ifndef OPENJDK - ifneq ($(UNLIMITED_CRYPTO), true) - $(UNLIMITED_POLICY_DIR)/US_export_policy.jar: \ - $(US_EXPORT_POLICY_JAR_UNLIMITED) - $(install-file) - TARGETS += $(UNLIMITED_POLICY_DIR)/US_export_policy.jar - endif -endif - POLICY_JARS += $(US_EXPORT_POLICY_JAR_DST) ################################################################################ @@ -159,31 +134,12 @@ TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED) -ifndef OPENJDK - ifneq ($(UNLIMITED_CRYPTO), true) - $(UNLIMITED_POLICY_DIR)/README.txt: \ - $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt - $(install-file) - - TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt - endif -endif - ifeq ($(UNLIMITED_CRYPTO), true) $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNLIMITED) $(install-file) -else +else $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_LIMITED) $(install-file) -endif - -ifndef OPENJDK - ifneq ($(UNLIMITED_CRYPTO), true) - $(UNLIMITED_POLICY_DIR)/local_policy.jar: \ - $(LOCAL_POLICY_JAR_UNLIMITED) - $(install-file) - TARGETS += $(UNLIMITED_POLICY_DIR)/local_policy.jar - endif endif POLICY_JARS += $(LOCAL_POLICY_JAR_DST) @@ -191,3 +147,4 @@ ################################################################################ +$(eval $(call IncludeCustomExtension, jdk, gendata/GendataPolicyJars.gmk)) --- old/jdk/make/gensrc/GensrcIcons.gmk 2016-07-01 17:48:48.600091278 +0200 +++ new/jdk/make/gensrc/GensrcIcons.gmk 2016-07-01 17:48:48.448084850 +0200 @@ -23,16 +23,15 @@ # questions. # +$(eval $(call IncludeCustomExtension, jdk, gensrc/GensrcIcons.gmk)) + GENSRC_AWT_ICONS := GENSRC_AWT_ICONS_SRC := GENSRC_AWT_ICONS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/sun/awt/ -ifdef OPENJDK - X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE) -else - X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/java.desktop/$(OPENJDK_TARGET_OS_TYPE) -endif +# Allow this to be overridden from a custom makefile +X11_ICONS_PATH_PREFIX ?= $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE) GENSRC_AWT_ICONS_SRC += \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ @@ -114,11 +113,8 @@ GENSRC_OSX_ICONS_DST := $(SUPPORT_OUTPUTDIR)/headers/java.desktop GENSRC_OSX_ICONS := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h - ifdef OPENJDK - GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/make/data/macosxicons/JavaApp.icns - else - GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/make/closed/data/macosxicons/JavaApp.icns - endif + GENSRC_OSX_ICONS_SRC ?= $(JDK_TOPDIR)/make/data/macosxicons/JavaApp.icns + $(GENSRC_OSX_ICONS): $(GENSRC_OSX_ICONS_SRC) $(BUILD_TOOLS_JDK) $(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@)) --- old/jdk/make/launcher/Launcher-java.base.gmk 2016-07-01 17:48:49.088111917 +0200 +++ new/jdk/make/launcher/Launcher-java.base.gmk 2016-07-01 17:48:48.932105319 +0200 @@ -25,12 +25,10 @@ include LauncherCommon.gmk +$(eval $(call IncludeCustomExtension, jdk, launcher/Launcher-java.base.gmk)) + JAVA_RC_FLAGS += -I $(JDK_TOPDIR)/src/java.base/windows/native/common -ifdef OPENJDK - JAVA_RC_FLAGS += -I $(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons -else - JAVA_RC_FLAGS += -I $(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons -endif +JAVA_RC_FLAGS += -I $(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons ################################################################################ --- old/jdk/make/lib/Awt2dLibraries.gmk 2016-07-01 17:48:49.588133063 +0200 +++ new/jdk/make/lib/Awt2dLibraries.gmk 2016-07-01 17:48:49.432126465 +0200 @@ -23,6 +23,8 @@ # questions. # +$(eval $(call IncludeCustomExtension, jdk, lib/Awt2dLibraries-pre.gmk)) + WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib ################################################################################ @@ -212,11 +214,7 @@ LIBAWT_CFLAGS += -DMLIB_OS64BIT endif - ifdef OPENJDK - LIBAWT_RC_FLAGS := -I $(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons - else - LIBAWT_RC_FLAGS := -I $(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons - endif + LIBAWT_RC_FLAGS ?= -I $(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/java.desktop/windows/native/libawt/windows/awt.rc endif @@ -454,13 +452,6 @@ ################################################################################ -ifdef OPENJDK - BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers -else - BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed - LIBJAVAJPEG_SRC += $(JDK_TOPDIR)/src/closed/java.desktop/share/native/libjavajpeg -endif - LIBJAVAJPEG_SRC += $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg BUILD_LIBJAVAJPEG_REORDER := @@ -510,7 +501,7 @@ DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds, \ DISABLED_WARNINGS_clang := logical-op-parentheses, \ DISABLED_WARNINGS_microsoft := 4267, \ - MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \ + MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \ @@ -645,15 +636,10 @@ #### End harfbuzz configuration -ifndef OPENJDK - LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/closed/java.desktop/share/native/libt2k - BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers - LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c -else - LIBFONTMANAGER_CFLAGS += $(FREETYPE_CFLAGS) - BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers.openjdk - BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS) -endif +LIBFONTMANAGER_CFLAGS += $(FREETYPE_CFLAGS) +# This may be overridden in a custom makefile +BUILD_LIBFONTMANAGER_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers +BUILD_LIBFONTMANAGER_FONTLIB += $(FREETYPE_LIBS) LIBFONTMANAGER_OPTIMIZATION := HIGH --- old/jdk/make/mapfiles/libfontmanager/mapfile-vers 2016-07-01 17:48:50.100154717 +0200 +++ new/jdk/make/mapfiles/libfontmanager/mapfile-vers 2016-07-01 17:48:49.948148288 +0200 @@ -25,6 +25,8 @@ # Define public interface. +# In addition to regular symbols also include Freetype scaler + SUNWprivate_1.1 { global: getSunFontIDs; @@ -57,6 +59,23 @@ Java_sun_font_NativeFont_getGlyphImage; Java_sun_font_NativeFont_getGlyphImageNoDefault; Java_sun_font_NativeFont_getFontMetrics; + Java_sun_font_FreetypeFontScaler_initIDs; + Java_sun_font_FreetypeFontScaler_createScalerContextNative; + Java_sun_font_FreetypeFontScaler_disposeNativeScaler; + Java_sun_font_FreetypeFontScaler_getFontMetricsNative; + Java_sun_font_FreetypeFontScaler_getGlyphAdvanceNative; + Java_sun_font_FreetypeFontScaler_getGlyphCodeNative; + Java_sun_font_FreetypeFontScaler_getGlyphImageNative; + Java_sun_font_FreetypeFontScaler_getGlyphMetricsNative; + Java_sun_font_FreetypeFontScaler_getGlyphOutlineBoundsNative; + Java_sun_font_FreetypeFontScaler_getGlyphOutlineNative; + Java_sun_font_FreetypeFontScaler_getGlyphVectorOutlineNative; + Java_sun_font_FreetypeFontScaler_getLayoutTableCacheNative; + Java_sun_font_FreetypeFontScaler_getMissingGlyphCodeNative; + Java_sun_font_FreetypeFontScaler_getNumGlyphsNative; + Java_sun_font_FreetypeFontScaler_getUnitsPerEMNative; + Java_sun_font_FreetypeFontScaler_initNativeScaler; + Java_sun_font_FreetypeFontScaler_getGlyphPointNative; local: *; }; --- old/jdk/make/mapfiles/libdcpr/mapfile-vers 2016-07-01 17:48:50.600175863 +0200 +++ /dev/null 2016-02-18 10:58:42.502130963 +0100 @@ -1,93 +0,0 @@ -# -# Copyright (c) 1997, 2013, 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. 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 -# 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. -# - -# Define public interface. - -SUNWprivate_1.1 { - global: - Java_sun_dc_pr_PathDasher_beginPath; - Java_sun_dc_pr_PathFiller_getTileState; - Java_sun_dc_pr_PathStroker_setCaps; - Java_sun_dc_pr_PathStroker_setCorners; - Java_sun_dc_pr_PathFiller_writeAlpha16; - Java_sun_dc_pr_PathFiller_closedSubpath; - Java_sun_dc_pr_PathStroker_beginPath; - Java_sun_dc_pr_PathDasher_setDashT4; - Java_sun_dc_pr_PathFiller_dispose; - Java_sun_dc_pr_PathStroker_closedSubpath; - Java_sun_dc_pr_PathDasher_appendLine; - Java_sun_dc_pr_PathStroker_dispose; - Java_sun_dc_pr_PathDasher_setOutputConsumer; - Java_sun_dc_pr_PathStroker_reset; - Java_sun_dc_pr_PathFiller_beginSubpath; - Java_sun_dc_pr_PathFiller_writeAlpha8; - Java_sun_dc_pr_PathDasher_closedSubpath; - Java_sun_dc_pr_PathFiller_appendQuadratic; - Java_sun_dc_pr_PathDasher_setOutputT6; - Java_sun_dc_pr_PathStroker_setPenFitting; - Java_sun_dc_pr_PathStroker_endPath; - Java_sun_dc_pr_PathDasher_setDash; - Java_sun_dc_pr_PathFiller_nextTile; - Java_sun_dc_pr_PathStroker_setOutputConsumer; - Java_sun_dc_pr_PathFiller_setFillMode; - Java_sun_dc_pr_PathFiller_appendLine; - Java_sun_dc_pr_PathStroker_appendQuadratic; - Java_sun_dc_pr_PathFiller_endPath; - Java_sun_dc_pr_PathStroker_appendCubic; - Java_sun_dc_pr_PathDasher_appendCubic; - Java_sun_dc_pr_PathStroker_setPenDiameter; - Java_sun_dc_pr_PathFiller_setOutputArea; - Java_sun_dc_pr_PathFiller_getAlphaBox; - Java_sun_dc_pr_PathStroker_appendLine; - Java_sun_dc_pr_PathStroker_setOutputT6; - Java_sun_dc_pr_PathFiller_beginPath; - Java_sun_dc_pr_PathDasher_dispose; - Java_sun_dc_pr_PathDasher_reset; - Java_sun_dc_pr_PathFiller_reset; - Java_sun_dc_pr_PathDasher_endPath; - Java_sun_dc_pr_PathStroker_beginSubpath; - Java_sun_dc_pr_PathStroker_setPenT4; - Java_sun_dc_pr_PathDasher_appendQuadratic; - Java_sun_dc_pr_PathDasher_beginSubpath; - Java_sun_dc_pr_PathFiller_appendCubic; - - Java_sun_dc_pr_PathDasher_cClassFinalize; - Java_sun_dc_pr_PathDasher_cClassInitialize; - Java_sun_dc_pr_PathDasher_cInitialize; - Java_sun_dc_pr_PathFiller_cClassFinalize; - Java_sun_dc_pr_PathFiller_cClassInitialize; - Java_sun_dc_pr_PathFiller_cInitialize; - Java_sun_dc_pr_PathStroker_cClassFinalize; - Java_sun_dc_pr_PathStroker_cClassInitialize; - Java_sun_dc_pr_PathStroker_cInitialize; - Java_sun_dc_pr_PathStroker_cInitialize2D; - - Java_sun_dc_pr_PathDasher_getCPathConsumer; - Java_sun_dc_pr_PathFiller_getCPathConsumer; - Java_sun_dc_pr_PathStroker_getCPathConsumer; - - local: - *; -}; --- old/jdk/make/mapfiles/libfontmanager/mapfile-vers.openjdk 2016-07-01 17:48:50.932189904 +0200 +++ /dev/null 2016-02-18 10:58:42.502130963 +0100 @@ -1,81 +0,0 @@ -# -# Copyright (c) 1997, 2013, 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. 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 -# 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. -# - -# Define public interface. - -# In addition to regular symbols also include Freetype scaler - -SUNWprivate_1.1 { - global: - getSunFontIDs; - newLayoutTableCache; - freeLayoutTableCache; - isNullScalerContext; - Java_sun_font_NullFontScaler_getNullScalerContext; - Java_sun_font_NullFontScaler_getGlyphImage; - Java_sun_font_SunFontManager_initIDs; - Java_sun_font_StrikeCache_getGlyphCacheDescription; - Java_sun_font_StrikeCache_freeIntPointer; - Java_sun_font_StrikeCache_freeLongPointer; - Java_sun_font_StrikeCache_freeIntMemory; - Java_sun_font_StrikeCache_freeLongMemory; - Java_sun_font_SunLayoutEngine_initGVIDs; - Java_sun_font_SunLayoutEngine_nativeLayout; - Java_sun_font_SunLayoutEngine_shape; - Java_sun_font_X11TextRenderer_doDrawGlyphList; - Java_sun_java2d_loops_DrawGlyphListAA_DrawGlyphListAA; - Java_sun_java2d_loops_DrawGlyphListLCD_DrawGlyphListLCD; - Java_sun_java2d_loops_DrawGlyphList_DrawGlyphList; - Java_sun_font_NativeStrikeDisposer_freeNativeScalerContext; - Java_sun_font_NativeStrike_createNullScalerContext; - Java_sun_font_NativeStrike_createScalerContext; - Java_sun_font_NativeStrike_getMaxGlyph; - Java_sun_font_NativeFont_fontExists; - Java_sun_font_NativeFont_haveBitmapFonts; - Java_sun_font_NativeFont_countGlyphs; - Java_sun_font_NativeFont_getGlyphAdvance; - Java_sun_font_NativeFont_getGlyphImage; - Java_sun_font_NativeFont_getGlyphImageNoDefault; - Java_sun_font_NativeFont_getFontMetrics; - Java_sun_font_FreetypeFontScaler_initIDs; - Java_sun_font_FreetypeFontScaler_createScalerContextNative; - Java_sun_font_FreetypeFontScaler_disposeNativeScaler; - Java_sun_font_FreetypeFontScaler_getFontMetricsNative; - Java_sun_font_FreetypeFontScaler_getGlyphAdvanceNative; - Java_sun_font_FreetypeFontScaler_getGlyphCodeNative; - Java_sun_font_FreetypeFontScaler_getGlyphImageNative; - Java_sun_font_FreetypeFontScaler_getGlyphMetricsNative; - Java_sun_font_FreetypeFontScaler_getGlyphOutlineBoundsNative; - Java_sun_font_FreetypeFontScaler_getGlyphOutlineNative; - Java_sun_font_FreetypeFontScaler_getGlyphVectorOutlineNative; - Java_sun_font_FreetypeFontScaler_getLayoutTableCacheNative; - Java_sun_font_FreetypeFontScaler_getMissingGlyphCodeNative; - Java_sun_font_FreetypeFontScaler_getNumGlyphsNative; - Java_sun_font_FreetypeFontScaler_getUnitsPerEMNative; - Java_sun_font_FreetypeFontScaler_initNativeScaler; - Java_sun_font_FreetypeFontScaler_getGlyphPointNative; - local: - *; -}; --- old/jdk/make/mapfiles/libjdga/mapfile-vers 2016-07-01 17:48:51.276204453 +0200 +++ /dev/null 2016-02-18 10:58:42.502130963 +0100 @@ -1,33 +0,0 @@ -# -# Copyright (c) 2005, 2013, 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. 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 -# 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. -# - -# Define library interface. - -SUNWprivate_1.1 { - global: - JDgaLibInit; - local: - *; -}; --- old/jdk/make/mapfiles/libjpeg/mapfile-vers-closed 2016-07-01 17:48:51.612218662 +0200 +++ /dev/null 2016-02-18 10:58:42.502130963 +0100 @@ -1,55 +0,0 @@ -# -# Copyright (c) 2007, 2013, 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. 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 -# 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. -# - -# Define public interface. - -SUNWprivate_1.1 { - global: - JNI_OnLoad; - - Java_sun_awt_image_JPEGImageDecoder_initIDs; - Java_sun_awt_image_JPEGImageDecoder_readImage; - - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initReaderIDs; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setSource; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImageHeader; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setOutColorSpace; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_abortRead; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetReader; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_disposeReader; - Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetLibraryState; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initWriterIDs; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initJPEGImageWriter; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_setDest; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeTables; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_abortWrite; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_resetWriter; - Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_disposeWriter; - local: - *; -}; --- old/jdk/make/mapfiles/libkcms/mapfile-vers 2016-07-01 17:48:51.960233380 +0200 +++ /dev/null 2016-02-18 10:58:42.502130963 +0100 @@ -1,47 +0,0 @@ -# -# Copyright (c) 1997, 2013, 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. 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 -# 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. -# - -# Define public interface. - -SUNWprivate_1.1 { - global: - Java_sun_java2d_cmm_kcms_CMM_cmmGetTagSize; - Java_sun_java2d_cmm_kcms_CMM_cmmGetNumComponents; - Java_sun_java2d_cmm_kcms_CMM_cmmColorConvert; - Java_sun_java2d_cmm_kcms_CMM_cmmInit; - Java_sun_java2d_cmm_kcms_CMM_cmmCombineTransforms; - Java_sun_java2d_cmm_kcms_CMM_cmmGetTagData; - Java_sun_java2d_cmm_kcms_CMM_cmmSetTagData; - Java_sun_java2d_cmm_kcms_CMM_cmmGetProfileData; - Java_sun_java2d_cmm_kcms_CMM_cmmFreeProfile; - Java_sun_java2d_cmm_kcms_CMM_cmmTerminate; - Java_sun_java2d_cmm_kcms_CMM_cmmLoadProfile; - Java_sun_java2d_cmm_kcms_CMM_cmmGetTransform; - Java_sun_java2d_cmm_kcms_CMM_cmmFreeTransform; - Java_sun_java2d_cmm_kcms_CMM_cmmGetProfileSize; - - local: - *; -}; --- old/jdk/make/mapfiles/libt2k/mapfile-vers 2016-07-01 17:48:52.288247252 +0200 +++ /dev/null 2016-02-18 10:58:42.502130963 +0100 @@ -1,49 +0,0 @@ -# -# Copyright (c) 2007, 2013, 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. 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 -# 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. -# - -# Define public interface. - -SUNWprivate_1.1 { - global: - Java_sun_font_T2KFontScaler_createScalerContextNative; - Java_sun_font_T2KFontScaler_disposeNativeScaler; - Java_sun_font_T2KFontScaler_getFontMetricsNative; - Java_sun_font_T2KFontScaler_getGlyphAdvanceNative; - Java_sun_font_T2KFontScaler_getGlyphCodeNative; - Java_sun_font_T2KFontScaler_getGlyphImageNative; - Java_sun_font_T2KFontScaler_getGlyphMetricsNative; - Java_sun_font_T2KFontScaler_getGlyphOutlineBoundsNative; - Java_sun_font_T2KFontScaler_getGlyphOutlineNative; - Java_sun_font_T2KFontScaler_getGlyphVectorOutlineNative; - Java_sun_font_T2KFontScaler_getLayoutTableCacheNative; - Java_sun_font_T2KFontScaler_getMissingGlyphCodeNative; - Java_sun_font_T2KFontScaler_getNumGlyphsNative; - Java_sun_font_T2KFontScaler_getUnitsPerEMNative; - Java_sun_font_T2KFontScaler_initIDs; - Java_sun_font_T2KFontScaler_initNativeScaler; - Java_sun_font_T2KFontScaler_getGlyphPointNative; - local: - *; -}; --- old/jdk/src/java.desktop/share/classes/sun/dc/DuctusRenderingEngine.java 2016-07-01 17:48:52.624261462 +0200 +++ /dev/null 2016-02-18 10:58:42.502130963 +0100 @@ -1,836 +0,0 @@ -/* - * Copyright (c) 2007, 2013, 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. 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 - * 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. - */ - -package sun.dc; - -import java.awt.Shape; -import java.awt.BasicStroke; -import java.awt.geom.Path2D; -import java.awt.geom.PathIterator; -import java.awt.geom.AffineTransform; - -import sun.awt.geom.PathConsumer2D; -import sun.java2d.pipe.Region; -import sun.java2d.pipe.AATileGenerator; -import sun.java2d.pipe.RenderingEngine; - -import sun.dc.pr.Rasterizer; -import sun.dc.pr.PathStroker; -import sun.dc.pr.PathDasher; -import sun.dc.pr.PRException; -import sun.dc.path.PathConsumer; -import sun.dc.path.PathException; -import sun.dc.path.FastPathProducer; - -public class DuctusRenderingEngine extends RenderingEngine { - static final float PenUnits = 0.01f; - static final int MinPenUnits = 100; - static final int MinPenUnitsAA = 20; - static final float MinPenSizeAA = PenUnits * MinPenUnitsAA; - - static final float UPPER_BND = Float.MAX_VALUE / 2.0f; - static final float LOWER_BND = -UPPER_BND; - - private static final int RasterizerCaps[] = { - Rasterizer.BUTT, Rasterizer.ROUND, Rasterizer.SQUARE - }; - - private static final int RasterizerCorners[] = { - Rasterizer.MITER, Rasterizer.ROUND, Rasterizer.BEVEL - }; - - static float[] getTransformMatrix(AffineTransform transform) { - float matrix[] = new float[4]; - double dmatrix[] = new double[6]; - transform.getMatrix(dmatrix); - for (int i = 0; i < 4; i++) { - matrix[i] = (float) dmatrix[i]; - } - return matrix; - } - - /** - * {@inheritDoc} - */ - @Override - public Shape createStrokedShape(Shape src, - float width, - int caps, - int join, - float miterlimit, - float dashes[], - float dashphase) - { - FillAdapter filler = new FillAdapter(); - PathStroker stroker = new PathStroker(filler); - PathDasher dasher = null; - - try { - PathConsumer consumer; - - stroker.setPenDiameter(width); - stroker.setPenT4(null); - stroker.setCaps(RasterizerCaps[caps]); - stroker.setCorners(RasterizerCorners[join], miterlimit); - if (dashes != null) { - dasher = new PathDasher(stroker); - dasher.setDash(dashes, dashphase); - dasher.setDashT4(null); - consumer = dasher; - } else { - consumer = stroker; - } - - feedConsumer(consumer, src.getPathIterator(null)); - } finally { - stroker.dispose(); - if (dasher != null) { - dasher.dispose(); - } - } - - return filler.getShape(); - } - - /** - * {@inheritDoc} - */ - @Override - public void strokeTo(Shape src, - AffineTransform transform, - BasicStroke bs, - boolean thin, - boolean normalize, - boolean antialias, - PathConsumer2D sr) - { - PathStroker stroker = new PathStroker(sr); - PathConsumer consumer = stroker; - - float matrix[] = null; - if (!thin) { - stroker.setPenDiameter(bs.getLineWidth()); - if (transform != null) { - matrix = getTransformMatrix(transform); - } - stroker.setPenT4(matrix); - stroker.setPenFitting(PenUnits, MinPenUnits); - } - stroker.setCaps(RasterizerCaps[bs.getEndCap()]); - stroker.setCorners(RasterizerCorners[bs.getLineJoin()], - bs.getMiterLimit()); - float[] dashes = bs.getDashArray(); - if (dashes != null) { - PathDasher dasher = new PathDasher(stroker); - dasher.setDash(dashes, bs.getDashPhase()); - if (transform != null && matrix == null) { - matrix = getTransformMatrix(transform); - } - dasher.setDashT4(matrix); - consumer = dasher; - } - - try { - PathIterator pi = src.getPathIterator(transform); - - feedConsumer(pi, consumer, normalize, 0.25f); - } catch (PathException e) { - throw new InternalError("Unable to Stroke shape ("+ - e.getMessage()+")", e); - } finally { - while (consumer != null && consumer != sr) { - PathConsumer next = consumer.getConsumer(); - consumer.dispose(); - consumer = next; - } - } - } - - /* - * Feed a path from a PathIterator to a Ductus PathConsumer. - */ - public static void feedConsumer(PathIterator pi, PathConsumer consumer, - boolean normalize, float norm) - throws PathException - { - consumer.beginPath(); - boolean pathClosed = false; - boolean skip = false; - boolean subpathStarted = false; - float mx = 0.0f; - float my = 0.0f; - float point[] = new float[6]; - float rnd = (0.5f - norm); - float ax = 0.0f; - float ay = 0.0f; - - while (!pi.isDone()) { - int type = pi.currentSegment(point); - if (pathClosed == true) { - pathClosed = false; - if (type != PathIterator.SEG_MOVETO) { - // Force current point back to last moveto point - consumer.beginSubpath(mx, my); - subpathStarted = true; - } - } - if (normalize) { - int index; - switch (type) { - case PathIterator.SEG_CUBICTO: - index = 4; - break; - case PathIterator.SEG_QUADTO: - index = 2; - break; - case PathIterator.SEG_MOVETO: - case PathIterator.SEG_LINETO: - index = 0; - break; - case PathIterator.SEG_CLOSE: - default: - index = -1; - break; - } - if (index >= 0) { - float ox = point[index]; - float oy = point[index+1]; - float newax = (float) Math.floor(ox + rnd) + norm; - float neway = (float) Math.floor(oy + rnd) + norm; - point[index] = newax; - point[index+1] = neway; - newax -= ox; - neway -= oy; - switch (type) { - case PathIterator.SEG_CUBICTO: - point[0] += ax; - point[1] += ay; - point[2] += newax; - point[3] += neway; - break; - case PathIterator.SEG_QUADTO: - point[0] += (newax + ax) / 2; - point[1] += (neway + ay) / 2; - break; - case PathIterator.SEG_MOVETO: - case PathIterator.SEG_LINETO: - case PathIterator.SEG_CLOSE: - break; - } - ax = newax; - ay = neway; - } - } - switch (type) { - case PathIterator.SEG_MOVETO: - - /* Checking SEG_MOVETO coordinates if they are out of the - * [LOWER_BND, UPPER_BND] range. This check also handles NaN - * and Infinity values. Skipping next path segment in case of - * invalid data. - */ - if (point[0] < UPPER_BND && point[0] > LOWER_BND && - point[1] < UPPER_BND && point[1] > LOWER_BND) - { - mx = point[0]; - my = point[1]; - consumer.beginSubpath(mx, my); - subpathStarted = true; - skip = false; - } else { - skip = true; - } - break; - case PathIterator.SEG_LINETO: - /* Checking SEG_LINETO coordinates if they are out of the - * [LOWER_BND, UPPER_BND] range. This check also handles NaN - * and Infinity values. Ignoring current path segment in case - * of invalid data. If segment is skipped its endpoint - * (if valid) is used to begin new subpath. - */ - if (point[0] < UPPER_BND && point[0] > LOWER_BND && - point[1] < UPPER_BND && point[1] > LOWER_BND) - { - if (skip) { - consumer.beginSubpath(point[0], point[1]); - subpathStarted = true; - skip = false; - } else { - consumer.appendLine(point[0], point[1]); - } - } - break; - case PathIterator.SEG_QUADTO: - // Quadratic curves take two points - - /* Checking SEG_QUADTO coordinates if they are out of the - * [LOWER_BND, UPPER_BND] range. This check also handles NaN - * and Infinity values. Ignoring current path segment in case - * of invalid endpoints's data. Equivalent to the SEG_LINETO - * if endpoint coordinates are valid but there are invalid data - * among other coordinates - */ - if (point[2] < UPPER_BND && point[2] > LOWER_BND && - point[3] < UPPER_BND && point[3] > LOWER_BND) - { - if (skip) { - consumer.beginSubpath(point[2], point[3]); - subpathStarted = true; - skip = false; - } else { - if (point[0] < UPPER_BND && point[0] > LOWER_BND && - point[1] < UPPER_BND && point[1] > LOWER_BND) - { - consumer.appendQuadratic(point[0], point[1], - point[2], point[3]); - } else { - consumer.appendLine(point[2], point[3]); - } - } - } - break; - case PathIterator.SEG_CUBICTO: - // Cubic curves take three points - - /* Checking SEG_CUBICTO coordinates if they are out of the - * [LOWER_BND, UPPER_BND] range. This check also handles NaN - * and Infinity values. Ignoring current path segment in case - * of invalid endpoints's data. Equivalent to the SEG_LINETO - * if endpoint coordinates are valid but there are invalid data - * among other coordinates - */ - if (point[4] < UPPER_BND && point[4] > LOWER_BND && - point[5] < UPPER_BND && point[5] > LOWER_BND) - { - if (skip) { - consumer.beginSubpath(point[4], point[5]); - subpathStarted = true; - skip = false; - } else { - if (point[0] < UPPER_BND && point[0] > LOWER_BND && - point[1] < UPPER_BND && point[1] > LOWER_BND && - point[2] < UPPER_BND && point[2] > LOWER_BND && - point[3] < UPPER_BND && point[3] > LOWER_BND) - { - consumer.appendCubic(point[0], point[1], - point[2], point[3], - point[4], point[5]); - } else { - consumer.appendLine(point[4], point[5]); - } - } - } - break; - case PathIterator.SEG_CLOSE: - if (subpathStarted) { - consumer.closedSubpath(); - subpathStarted = false; - pathClosed = true; - } - break; - } - pi.next(); - } - - consumer.endPath(); - } - - private static Rasterizer theRasterizer; - - public static synchronized Rasterizer getRasterizer() { - Rasterizer r = theRasterizer; - if (r == null) { - r = new Rasterizer(); - } else { - theRasterizer = null; - } - return r; - } - - public static synchronized void dropRasterizer(Rasterizer r) { - r.reset(); - theRasterizer = r; - } - - /** - * {@inheritDoc} - */ - @Override - public float getMinimumAAPenSize() { - return MinPenSizeAA; - } - - /** - * {@inheritDoc} - */ - @Override - public AATileGenerator getAATileGenerator(Shape s, - AffineTransform at, - Region clip, - BasicStroke bs, - boolean thin, - boolean normalize, - int bbox[]) - { - Rasterizer r = getRasterizer(); - PathIterator pi = s.getPathIterator(at); - - if (bs != null) { - float matrix[] = null; - r.setUsage(Rasterizer.STROKE); - if (thin) { - r.setPenDiameter(MinPenSizeAA); - } else { - r.setPenDiameter(bs.getLineWidth()); - if (at != null) { - matrix = getTransformMatrix(at); - r.setPenT4(matrix); - } - r.setPenFitting(PenUnits, MinPenUnitsAA); - } - r.setCaps(RasterizerCaps[bs.getEndCap()]); - r.setCorners(RasterizerCorners[bs.getLineJoin()], - bs.getMiterLimit()); - float[] dashes = bs.getDashArray(); - if (dashes != null) { - r.setDash(dashes, bs.getDashPhase()); - if (at != null && matrix == null) { - matrix = getTransformMatrix(at); - } - r.setDashT4(matrix); - } - } else { - r.setUsage(pi.getWindingRule() == PathIterator.WIND_EVEN_ODD - ? Rasterizer.EOFILL - : Rasterizer.NZFILL); - } - - r.beginPath(); - { - boolean pathClosed = false; - boolean skip = false; - boolean subpathStarted = false; - float mx = 0.0f; - float my = 0.0f; - float point[] = new float[6]; - float ax = 0.0f; - float ay = 0.0f; - - while (!pi.isDone()) { - int type = pi.currentSegment(point); - if (pathClosed == true) { - pathClosed = false; - if (type != PathIterator.SEG_MOVETO) { - // Force current point back to last moveto point - r.beginSubpath(mx, my); - subpathStarted = true; - } - } - if (normalize) { - int index; - switch (type) { - case PathIterator.SEG_CUBICTO: - index = 4; - break; - case PathIterator.SEG_QUADTO: - index = 2; - break; - case PathIterator.SEG_MOVETO: - case PathIterator.SEG_LINETO: - index = 0; - break; - case PathIterator.SEG_CLOSE: - default: - index = -1; - break; - } - if (index >= 0) { - float ox = point[index]; - float oy = point[index+1]; - float newax = (float) Math.floor(ox) + 0.5f; - float neway = (float) Math.floor(oy) + 0.5f; - point[index] = newax; - point[index+1] = neway; - newax -= ox; - neway -= oy; - switch (type) { - case PathIterator.SEG_CUBICTO: - point[0] += ax; - point[1] += ay; - point[2] += newax; - point[3] += neway; - break; - case PathIterator.SEG_QUADTO: - point[0] += (newax + ax) / 2; - point[1] += (neway + ay) / 2; - break; - case PathIterator.SEG_MOVETO: - case PathIterator.SEG_LINETO: - case PathIterator.SEG_CLOSE: - break; - } - ax = newax; - ay = neway; - } - } - switch (type) { - case PathIterator.SEG_MOVETO: - - /* Checking SEG_MOVETO coordinates if they are out of the - * [LOWER_BND, UPPER_BND] range. This check also handles NaN - * and Infinity values. Skipping next path segment in case - * of invalid data. - */ - - if (point[0] < UPPER_BND && point[0] > LOWER_BND && - point[1] < UPPER_BND && point[1] > LOWER_BND) - { - mx = point[0]; - my = point[1]; - r.beginSubpath(mx, my); - subpathStarted = true; - skip = false; - } else { - skip = true; - } - break; - - case PathIterator.SEG_LINETO: - /* Checking SEG_LINETO coordinates if they are out of the - * [LOWER_BND, UPPER_BND] range. This check also handles - * NaN and Infinity values. Ignoring current path segment - * in case of invalid data. If segment is skipped its - * endpoint (if valid) is used to begin new subpath. - */ - if (point[0] < UPPER_BND && point[0] > LOWER_BND && - point[1] < UPPER_BND && point[1] > LOWER_BND) - { - if (skip) { - r.beginSubpath(point[0], point[1]); - subpathStarted = true; - skip = false; - } else { - r.appendLine(point[0], point[1]); - } - } - break; - - case PathIterator.SEG_QUADTO: - // Quadratic curves take two points - - /* Checking SEG_QUADTO coordinates if they are out of the - * [LOWER_BND, UPPER_BND] range. This check also handles - * NaN and Infinity values. Ignoring current path segment - * in case of invalid endpoints's data. Equivalent to the - * SEG_LINETO if endpoint coordinates are valid but there - * are invalid data among other coordinates - */ - if (point[2] < UPPER_BND && point[2] > LOWER_BND && - point[3] < UPPER_BND && point[3] > LOWER_BND) - { - if (skip) { - r.beginSubpath(point[2], point[3]); - subpathStarted = true; - skip = false; - } else { - if (point[0] < UPPER_BND && point[0] > LOWER_BND && - point[1] < UPPER_BND && point[1] > LOWER_BND) - { - r.appendQuadratic(point[0], point[1], - point[2], point[3]); - } else { - r.appendLine(point[2], point[3]); - } - } - } - break; - case PathIterator.SEG_CUBICTO: - // Cubic curves take three points - - /* Checking SEG_CUBICTO coordinates if they are out of the - * [LOWER_BND, UPPER_BND] range. This check also handles - * NaN and Infinity values. Ignoring current path segment - * in case of invalid endpoints's data. Equivalent to the - * SEG_LINETO if endpoint coordinates are valid but there - * are invalid data among other coordinates - */ - - if (point[4] < UPPER_BND && point[4] > LOWER_BND && - point[5] < UPPER_BND && point[5] > LOWER_BND) - { - if (skip) { - r.beginSubpath(point[4], point[5]); - subpathStarted = true; - skip = false; - } else { - if (point[0] < UPPER_BND && point[0] > LOWER_BND && - point[1] < UPPER_BND && point[1] > LOWER_BND && - point[2] < UPPER_BND && point[2] > LOWER_BND && - point[3] < UPPER_BND && point[3] > LOWER_BND) - { - r.appendCubic(point[0], point[1], - point[2], point[3], - point[4], point[5]); - } else { - r.appendLine(point[4], point[5]); - } - } - } - break; - case PathIterator.SEG_CLOSE: - if (subpathStarted) { - r.closedSubpath(); - subpathStarted = false; - pathClosed = true; - } - break; - } - pi.next(); - } - } - - try { - r.endPath(); - r.getAlphaBox(bbox); - clip.clipBoxToBounds(bbox); - if (bbox[0] >= bbox[2] || bbox[1] >= bbox[3]) { - dropRasterizer(r); - return null; - } - r.setOutputArea(bbox[0], bbox[1], - bbox[2] - bbox[0], - bbox[3] - bbox[1]); - } catch (PRException e) { - /* - * This exeption is thrown from the native part of the Ductus - * (only in case of a debug build) to indicate that some - * segments of the path have very large coordinates. - * See 4485298 for more info. - */ - System.err.println("DuctusRenderingEngine.getAATileGenerator: "+e); - } - - return r; - } - - /** - * {@inheritDoc} - */ - @Override - public AATileGenerator getAATileGenerator(double x, double y, - double dx1, double dy1, - double dx2, double dy2, - double lw1, double lw2, - Region clip, - int bbox[]) - { - // REMIND: Deal with large coordinates! - double ldx1, ldy1, ldx2, ldy2; - boolean innerpgram = (lw1 > 0 && lw2 > 0); - - if (innerpgram) { - ldx1 = dx1 * lw1; - ldy1 = dy1 * lw1; - ldx2 = dx2 * lw2; - ldy2 = dy2 * lw2; - x -= (ldx1 + ldx2) / 2.0; - y -= (ldy1 + ldy2) / 2.0; - dx1 += ldx1; - dy1 += ldy1; - dx2 += ldx2; - dy2 += ldy2; - if (lw1 > 1 && lw2 > 1) { - // Inner parallelogram was entirely consumed by stroke... - innerpgram = false; - } - } else { - ldx1 = ldy1 = ldx2 = ldy2 = 0; - } - - Rasterizer r = getRasterizer(); - - r.setUsage(Rasterizer.EOFILL); - - r.beginPath(); - r.beginSubpath((float) x, (float) y); - r.appendLine((float) (x+dx1), (float) (y+dy1)); - r.appendLine((float) (x+dx1+dx2), (float) (y+dy1+dy2)); - r.appendLine((float) (x+dx2), (float) (y+dy2)); - r.closedSubpath(); - if (innerpgram) { - x += ldx1 + ldx2; - y += ldy1 + ldy2; - dx1 -= 2.0 * ldx1; - dy1 -= 2.0 * ldy1; - dx2 -= 2.0 * ldx2; - dy2 -= 2.0 * ldy2; - r.beginSubpath((float) x, (float) y); - r.appendLine((float) (x+dx1), (float) (y+dy1)); - r.appendLine((float) (x+dx1+dx2), (float) (y+dy1+dy2)); - r.appendLine((float) (x+dx2), (float) (y+dy2)); - r.closedSubpath(); - } - - try { - r.endPath(); - r.getAlphaBox(bbox); - clip.clipBoxToBounds(bbox); - if (bbox[0] >= bbox[2] || bbox[1] >= bbox[3]) { - dropRasterizer(r); - return null; - } - r.setOutputArea(bbox[0], bbox[1], - bbox[2] - bbox[0], - bbox[3] - bbox[1]); - } catch (PRException e) { - /* - * This exeption is thrown from the native part of the Ductus - * (only in case of a debug build) to indicate that some - * segments of the path have very large coordinates. - * See 4485298 for more info. - */ - System.err.println("DuctusRenderingEngine.getAATileGenerator: "+e); - } - - return r; - } - - private void feedConsumer(PathConsumer consumer, PathIterator pi) { - try { - consumer.beginPath(); - boolean pathClosed = false; - float mx = 0.0f; - float my = 0.0f; - float point[] = new float[6]; - - while (!pi.isDone()) { - int type = pi.currentSegment(point); - if (pathClosed == true) { - pathClosed = false; - if (type != PathIterator.SEG_MOVETO) { - // Force current point back to last moveto point - consumer.beginSubpath(mx, my); - } - } - switch (type) { - case PathIterator.SEG_MOVETO: - mx = point[0]; - my = point[1]; - consumer.beginSubpath(point[0], point[1]); - break; - case PathIterator.SEG_LINETO: - consumer.appendLine(point[0], point[1]); - break; - case PathIterator.SEG_QUADTO: - consumer.appendQuadratic(point[0], point[1], - point[2], point[3]); - break; - case PathIterator.SEG_CUBICTO: - consumer.appendCubic(point[0], point[1], - point[2], point[3], - point[4], point[5]); - break; - case PathIterator.SEG_CLOSE: - consumer.closedSubpath(); - pathClosed = true; - break; - } - pi.next(); - } - - consumer.endPath(); - } catch (PathException e) { - throw new InternalError("Unable to Stroke shape ("+ - e.getMessage()+")", e); - } - } - - private class FillAdapter implements PathConsumer { - boolean closed; - Path2D.Float path; - - public FillAdapter() { - // Ductus only supplies float coordinates so - // Path2D.Double is not necessary here. - path = new Path2D.Float(Path2D.WIND_NON_ZERO); - } - - public Shape getShape() { - return path; - } - - public void dispose() { - } - - public PathConsumer getConsumer() { - return null; - } - - public void beginPath() {} - - public void beginSubpath(float x0, float y0) { - if (closed) { - path.closePath(); - closed = false; - } - path.moveTo(x0, y0); - } - - public void appendLine(float x1, float y1) { - path.lineTo(x1, y1); - } - - public void appendQuadratic(float xm, float ym, float x1, float y1) { - path.quadTo(xm, ym, x1, y1); - } - - public void appendCubic(float xm, float ym, - float xn, float yn, - float x1, float y1) { - path.curveTo(xm, ym, xn, yn, x1, y1); - } - - public void closedSubpath() { - closed = true; - } - - public void endPath() { - if (closed) { - path.closePath(); - closed = false; - } - } - - public void useProxy(FastPathProducer proxy) - throws PathException - { - proxy.sendTo(this); - } - - public long getCPathConsumer() { - return 0; - } - } -}