8003593: build-infra: Paths to optional platform-specific files should not be hardwired to src/closed

Reviewed-by: dholmes, prr
This commit is contained in:
Erik Joelsson 2016-07-08 08:56:39 +02:00
parent 799cba3f11
commit f1e53d48e9
14 changed files with 49 additions and 1293 deletions

View File

@ -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)

View File

@ -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_BFONT_CONFIGS := $(patsubst $(GENDATA_FONT_CONFIG_DATA_DIR)/$(OPENJDK_TA
$(GENDATA_FONT_CONFIG_DST)/%.bfc, $(GENDATA_FONT_CONFIG_SRC_FILES))
TARGETS := $(GENDATA_FONT_CONFIGS) $(GENDATA_BFONT_CONFIGS)

View File

@ -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_LIMITED := \
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 @@ else
$(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,16 +134,6 @@ $(eval $(call SetupJarArchive, BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
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)
@ -177,17 +142,9 @@ else
$(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)
TARGETS += $(POLICY_JARS)
################################################################################
$(eval $(call IncludeCustomExtension, jdk, gendata/GendataPolicyJars.gmk))

View File

@ -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 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
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)/%, %, $@))

View File

@ -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
################################################################################

View File

@ -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 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
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 @@ $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
################################################################################
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 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \
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 @@ LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
#### 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

View File

@ -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:
*;
};

View File

@ -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 @@ SUNWprivate_1.1 {
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:
*;
};

View File

@ -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:
*;
};

View File

@ -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:
*;
};

View File

@ -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:
*;
};

View File

@ -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:
*;
};

View File

@ -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:
*;
};

View File

@ -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;
}
}
}