Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d3868580
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d3868580
编写于
2月 21, 2011
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
2a3c775b
6307d049
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
745 addition
and
201 deletion
+745
-201
make/sun/jpeg/Makefile
make/sun/jpeg/Makefile
+13
-0
make/sun/jpeg/reorder-i586
make/sun/jpeg/reorder-i586
+23
-23
make/sun/jpeg/reorder-sparc
make/sun/jpeg/reorder-sparc
+10
-10
make/sun/jpeg/reorder-sparcv9
make/sun/jpeg/reorder-sparcv9
+9
-9
src/share/classes/sun/awt/image/ImageFetcher.java
src/share/classes/sun/awt/image/ImageFetcher.java
+26
-6
src/share/classes/sun/awt/image/InputStreamImageSource.java
src/share/classes/sun/awt/image/InputStreamImageSource.java
+7
-2
src/share/classes/sun/font/FontUtilities.java
src/share/classes/sun/font/FontUtilities.java
+18
-2
src/share/native/sun/awt/image/jpeg/imageioJPEG.c
src/share/native/sun/awt/image/jpeg/imageioJPEG.c
+38
-30
src/share/native/sun/awt/image/jpeg/jdmarker.c
src/share/native/sun/awt/image/jpeg/jdmarker.c
+2
-2
src/share/native/sun/awt/image/jpeg/jmemmgr.c
src/share/native/sun/awt/image/jpeg/jmemmgr.c
+7
-5
src/share/native/sun/awt/image/jpeg/jmemnobs.c
src/share/native/sun/awt/image/jpeg/jmemnobs.c
+4
-4
src/share/native/sun/awt/image/jpeg/jmemsys.h
src/share/native/sun/awt/image/jpeg/jmemsys.h
+5
-5
src/share/native/sun/awt/image/jpeg/jpegdecoder.c
src/share/native/sun/awt/image/jpeg/jpegdecoder.c
+2
-2
src/share/native/sun/awt/image/jpeg/jpeglib.h
src/share/native/sun/awt/image/jpeg/jpeglib.h
+2
-2
src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
+1
-2
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
+39
-13
src/solaris/native/sun/java2d/x11/X11SurfaceData.h
src/solaris/native/sun/java2d/x11/X11SurfaceData.h
+8
-2
src/windows/classes/sun/awt/windows/WPathGraphics.java
src/windows/classes/sun/awt/windows/WPathGraphics.java
+24
-2
src/windows/classes/sun/awt/windows/WPrinterJob.java
src/windows/classes/sun/awt/windows/WPrinterJob.java
+3
-2
src/windows/classes/sun/print/Win32PrintService.java
src/windows/classes/sun/print/Win32PrintService.java
+119
-69
src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp
src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp
+8
-7
test/java/awt/PrintJob/Text/StringWidth.java
test/java/awt/PrintJob/Text/StringWidth.java
+2
-1
test/java/awt/font/StyledMetrics/BoldSpace.java
test/java/awt/font/StyledMetrics/BoldSpace.java
+102
-0
test/java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java
test/java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java
+272
-0
test/javax/print/attribute/ServiceDialogTest.java
test/javax/print/attribute/ServiceDialogTest.java
+1
-1
未找到文件。
make/sun/jpeg/Makefile
浏览文件 @
d3868580
...
...
@@ -65,6 +65,19 @@ ifeq ($(PLATFORM), solaris)
FILES_reorder
+=
reorder-
$(ARCH)
endif
endif
ifeq
($(PLATFORM), linux)
# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
# or 'vfork'": this warning indicates that some variable is placed to
# a register by optimized compiler and it's value might be lost on longjmp().
# Recommended way to avoid such warning is to declare the variable as
# volatile to prevent the optimization. However, this approach does not
# work because we have to declare all variables as volatile in result.
OTHER_CFLAGS
+=
-Wno-clobbered
endif
include
$(BUILDDIR)/common/Mapfile-vers.gmk
include
$(BUILDDIR)/common/Library.gmk
...
...
make/sun/jpeg/reorder-i586
浏览文件 @
d3868580
...
...
@@ -22,7 +22,7 @@ text: .text%jIMReader;
text: .text%alloc_small: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
text: .text%reset_marker_reader: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jIInCtlr;
text: .text%GET_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
#
text: .text%GET_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
text: .text%jReadHeader;
text: .text%jConsumeInput;
text: .text%reset_input_controller: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
...
...
@@ -30,36 +30,36 @@ text: .text%reset_error_mgr: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%sun_jpeg_init_source;
text: .text%consume_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%read_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%sun_jpeg_fill_input_buffer;
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
#
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%emit_message: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_interesting_appn: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%examine_app0: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%examine_app0: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%skip_variable: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%sun_jpeg_skip_input_data;
text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dqt: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jAlcQTable;
text: .text%get_sof: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dht: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jAlcHTable;
text: .text%get_sos: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%initial_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
#
text: .text%initial_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%jDivRound;
text: .text%default_decompress_parms: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapimin.o;
#
text: .text%default_decompress_parms: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapimin.o;
text: .text%jHasMultScn;
text: .text%jStrtDecompress;
text: .text%jIDMaster;
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%jCalcDimensions;
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%jIDColor;
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
#
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%jIUpsampler;
text: .text%jRound;
text: .text%alloc_sarray: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
...
...
@@ -70,16 +70,16 @@ text: .text%jIIDCT;
text: .text%jIHDecoder;
text: .text%jIDCoefC;
text: .text%jIDMainC;
text: .text%alloc_funny_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%alloc_funny_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%realize_virt_arrays: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%per_scan_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
#
text: .text%per_scan_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
#
text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%start_pass_huff_decoder: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%jMkDDerived;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapistd.o;
#
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
#
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapistd.o;
text: .text%prepare_for_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%start_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jddctmgr.o;
text: .text%start_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
...
...
@@ -87,7 +87,7 @@ text: .text%start_pass_dcolor: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%start_pass_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%start_pass_dpost: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdpostct.o;
text: .text%start_pass_main: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%make_funny_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%make_funny_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%jReadScanlines;
text: .text%process_data_context_main: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%decompress_onepass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
...
...
@@ -100,11 +100,11 @@ text: .text%sep_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%fullsize_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%h2v2_fancy_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%ycc_rgb_convert: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
#
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%read_restart_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%finish_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%jFinDecompress;
text: .text%finish_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%sun_jpeg_term_source;
...
...
make/sun/jpeg/reorder-sparc
浏览文件 @
d3868580
...
...
@@ -30,10 +30,10 @@ text: .text%reset_error_mgr: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%sun_jpeg_init_source;
text: .text%consume_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%read_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%sun_jpeg_fill_input_buffer;
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jpegdecoder.o;
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%emit_message: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jerror.o;
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_interesting_appn: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
...
...
@@ -44,7 +44,7 @@ text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dqt: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jAlcQTable;
text: .text%get_sof: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
#
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%get_dht: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%jAlcHTable;
text: .text%get_sos: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
...
...
@@ -56,10 +56,10 @@ text: .text%jStrtDecompress;
text: .text%jIDMaster;
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%jCalcDimensions;
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
#
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%jIDColor;
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
#
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%jIUpsampler;
text: .text%jRound;
text: .text%alloc_sarray: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jmemmgr.o;
...
...
@@ -78,7 +78,7 @@ text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%start_pass_huff_decoder: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%jMkDDerived;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
#
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcoefct.o;
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdapistd.o;
text: .text%prepare_for_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%start_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jddctmgr.o;
...
...
@@ -100,11 +100,11 @@ text: .text%sep_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%fullsize_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%h2v2_fancy_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdsample.o;
text: .text%ycc_rgb_convert: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdcolor.o;
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
#
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdhuff.o;
text: .text%read_restart_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmarker.o;
text: .text%finish_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdinput.o;
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
#
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmainct.o;
text: .text%jFinDecompress;
text: .text%finish_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj/jdmaster.o;
text: .text%sun_jpeg_term_source;
...
...
make/sun/jpeg/reorder-sparcv9
浏览文件 @
d3868580
...
...
@@ -30,10 +30,10 @@ text: .text%reset_error_mgr: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jerror.o;
text: .text%sun_jpeg_init_source;
text: .text%consume_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdinput.o;
text: .text%read_markers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
#
text: .text%first_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%sun_jpeg_fill_input_buffer;
text: .text%RELEASE_ARRAYS: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jpegdecoder.o;
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
#
text: .text%get_soi: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%emit_message: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jerror.o;
text: .text%next_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_interesting_appn: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
...
...
@@ -44,7 +44,7 @@ text: .text%examine_app14: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_dqt: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%jAlcQTable;
text: .text%get_sof: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
#
text: .text%get_dri: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%get_dht: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%jAlcHTable;
text: .text%get_sos: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
...
...
@@ -56,10 +56,10 @@ text: .text%jStrtDecompress;
text: .text%jIDMaster;
text: .text%master_selection: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%jCalcDimensions;
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
#
text: .text%use_merged_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
#
text: .text%prepare_range_limit_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%jIDColor;
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcolor.o;
#
text: .text%build_ycc_rgb_table: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcolor.o;
text: .text%jIUpsampler;
text: .text%jRound;
text: .text%alloc_sarray: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jmemmgr.o;
...
...
@@ -78,7 +78,7 @@ text: .text%latch_quant_tables: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdinput.o;
text: .text%start_pass_huff_decoder: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdhuff.o;
text: .text%jMkDDerived;
text: .text%start_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcoefct.o;
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcoefct.o;
#
text: .text%start_iMCU_row: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcoefct.o;
text: .text%output_pass_setup: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdapistd.o;
text: .text%prepare_for_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%start_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jddctmgr.o;
...
...
@@ -100,11 +100,11 @@ text: .text%sep_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdsample.o;
text: .text%fullsize_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdsample.o;
text: .text%h2v2_fancy_upsample: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdsample.o;
text: .text%ycc_rgb_convert: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdcolor.o;
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmainct.o;
#
text: .text%set_wraparound_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmainct.o;
text: .text%process_restart: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdhuff.o;
text: .text%read_restart_marker: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmarker.o;
text: .text%finish_input_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdinput.o;
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmainct.o;
#
text: .text%set_bottom_pointers: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmainct.o;
text: .text%jFinDecompress;
text: .text%finish_output_pass: OUTPUTDIR/tmp/sun/sun.awt/jpeg/obj64/jdmaster.o;
text: .text%sun_jpeg_term_source;
...
...
src/share/classes/sun/awt/image/ImageFetcher.java
浏览文件 @
d3868580
...
...
@@ -61,8 +61,10 @@ class ImageFetcher extends Thread {
/**
* Adds an ImageFetchable to the queue of items to fetch. Instantiates
* a new ImageFetcher if it's reasonable to do so.
* If there is no available fetcher to process an ImageFetchable, then
* reports failure to caller.
*/
public
static
void
add
(
ImageFetchable
src
)
{
public
static
boolean
add
(
ImageFetchable
src
)
{
final
FetcherInfo
info
=
FetcherInfo
.
getFetcherInfo
();
synchronized
(
info
.
waitList
)
{
if
(!
info
.
waitList
.
contains
(
src
))
{
...
...
@@ -71,9 +73,23 @@ class ImageFetcher extends Thread {
info
.
numFetchers
<
info
.
fetchers
.
length
)
{
createFetchers
(
info
);
}
info
.
waitList
.
notify
();
/* Creation of new fetcher may fail due to high vm load
* or some other reason.
* If there is already exist, but busy, fetcher, we leave
* the src in queue (it will be handled by existing
* fetcher later).
* Otherwise, we report failure: there is no fetcher
* to handle the src.
*/
if
(
info
.
numFetchers
>
0
)
{
info
.
waitList
.
notify
();
}
else
{
info
.
waitList
.
removeElement
(
src
);
return
false
;
}
}
}
return
true
;
}
/**
...
...
@@ -291,11 +307,15 @@ class ImageFetcher extends Thread {
public
Object
run
()
{
for
(
int
i
=
0
;
i
<
info
.
fetchers
.
length
;
i
++)
{
if
(
info
.
fetchers
[
i
]
==
null
)
{
info
.
fetchers
[
i
]
=
new
ImageFetcher
(
ImageFetcher
f
=
new
ImageFetcher
(
fetcherGroup
,
i
);
info
.
fetchers
[
i
].
start
();
info
.
numFetchers
++;
break
;
try
{
f
.
start
();
info
.
fetchers
[
i
]
=
f
;
info
.
numFetchers
++;
break
;
}
catch
(
Error
e
)
{
}
}
}
return
null
;
...
...
src/share/classes/sun/awt/image/InputStreamImageSource.java
浏览文件 @
d3868580
...
...
@@ -164,8 +164,13 @@ public abstract class InputStreamImageSource implements ImageProducer,
private
synchronized
void
startProduction
()
{
if
(!
awaitingFetch
)
{
ImageFetcher
.
add
(
this
);
awaitingFetch
=
true
;
if
(
ImageFetcher
.
add
(
this
))
{
awaitingFetch
=
true
;
}
else
{
ImageConsumerQueue
cq
=
consumers
;
consumers
=
null
;
errorAllConsumers
(
cq
,
false
);
}
}
}
...
...
src/share/classes/sun/font/FontUtilities.java
浏览文件 @
d3868580
...
...
@@ -30,6 +30,8 @@ import java.io.BufferedReader;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.InputStreamReader
;
import
java.lang.ref.SoftReference
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
...
...
@@ -383,6 +385,10 @@ public final class FontUtilities {
* }
* return fuir;
*/
private
static
volatile
SoftReference
<
ConcurrentHashMap
<
PhysicalFont
,
CompositeFont
>>
compMapRef
=
new
SoftReference
(
null
);
public
static
FontUIResource
getCompositeFontUIResource
(
Font
font
)
{
FontUIResource
fuir
=
new
FontUIResource
(
font
);
...
...
@@ -402,12 +408,22 @@ public final class FontUtilities {
FontManager
fm
=
FontManagerFactory
.
getInstance
();
CompositeFont
dialog2D
=
(
CompositeFont
)
fm
.
findFont2D
(
"dialog"
,
font
.
getStyle
(),
FontManager
.
NO_FALLBACK
);
(
CompositeFont
)
fm
.
findFont2D
(
"dialog"
,
font
.
getStyle
(),
FontManager
.
NO_FALLBACK
);
if
(
dialog2D
==
null
)
{
/* shouldn't happen */
return
fuir
;
}
PhysicalFont
physicalFont
=
(
PhysicalFont
)
font2D
;
CompositeFont
compFont
=
new
CompositeFont
(
physicalFont
,
dialog2D
);
ConcurrentHashMap
<
PhysicalFont
,
CompositeFont
>
compMap
=
compMapRef
.
get
();
if
(
compMap
==
null
)
{
// Its been collected.
compMap
=
new
ConcurrentHashMap
<
PhysicalFont
,
CompositeFont
>();
compMapRef
=
new
SoftReference
(
compMap
);
}
CompositeFont
compFont
=
compMap
.
get
(
physicalFont
);
if
(
compFont
==
null
)
{
compFont
=
new
CompositeFont
(
physicalFont
,
dialog2D
);
compMap
.
put
(
physicalFont
,
compFont
);
}
FontAccess
.
getFontAccess
().
setFont2D
(
fuir
,
compFont
.
handle
);
/* marking this as a created font is needed as only created fonts
* copy their creator's handles.
...
...
src/share/native/sun/awt/image/jpeg/imageioJPEG.c
浏览文件 @
d3868580
...
...
@@ -109,8 +109,8 @@ typedef struct streamBufferStruct {
jobject
stream
;
// ImageInputStream or ImageOutputStream
jbyteArray
hstreamBuffer
;
// Handle to a Java buffer for the stream
JOCTET
*
buf
;
// Pinned buffer pointer */
in
t
bufferOffset
;
// holds offset between unpin and the next pin
in
t
bufferLength
;
// Allocated, nut just used
size_
t
bufferOffset
;
// holds offset between unpin and the next pin
size_
t
bufferLength
;
// Allocated, nut just used
int
suspendable
;
// Set to true to suspend input
long
remaining_skip
;
// Used only on input
}
streamBuffer
,
*
streamBufferPtr
;
...
...
@@ -129,7 +129,7 @@ typedef struct streamBufferStruct {
* Used to signal that no data need be restored from an unpin to a pin.
* I.e. the buffer is empty.
*/
#define NO_DATA
-1
#define NO_DATA
((size_t)-1)
// Forward reference
static
void
resetStreamBuffer
(
JNIEnv
*
env
,
streamBufferPtr
sb
);
...
...
@@ -389,7 +389,6 @@ typedef struct imageIODataStruct {
static
imageIODataPtr
initImageioData
(
JNIEnv
*
env
,
j_common_ptr
cinfo
,
jobject
obj
)
{
int
i
,
j
;
imageIODataPtr
data
=
(
imageIODataPtr
)
malloc
(
sizeof
(
imageIOData
));
if
(
data
==
NULL
)
{
...
...
@@ -982,7 +981,7 @@ imageio_fill_suspended_buffer(j_decompress_ptr cinfo)
streamBufferPtr
sb
=
&
data
->
streamBuf
;
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
jint
ret
;
in
t
offset
,
buflen
;
size_
t
offset
,
buflen
;
/*
* The original (jpegdecoder.c) had code here that called
...
...
@@ -1520,7 +1519,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader
imageio_dispose
((
j_common_ptr
)
cinfo
);
return
0
;
}
return
(
jlong
)
ret
;
return
ptr_to_jlong
(
ret
)
;
}
/*
...
...
@@ -1535,7 +1534,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setSource
jlong
ptr
,
jobject
source
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_common_ptr
cinfo
;
if
(
data
==
NULL
)
{
...
...
@@ -1574,7 +1573,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImageHeader
int
h_samp0
,
h_samp1
,
h_samp2
;
int
v_samp0
,
v_samp1
,
v_samp2
;
jboolean
retval
=
JNI_FALSE
;
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
struct
jpeg_source_mgr
*
src
;
sun_jpeg_error_ptr
jerr
;
...
...
@@ -1772,7 +1771,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_setOutColorSpace
jlong
ptr
,
jint
code
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
if
(
data
==
NULL
)
{
...
...
@@ -1814,7 +1813,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
struct
jpeg_source_mgr
*
src
;
JSAMPROW
scanLinePtr
=
NULL
;
jint
bands
[
MAX_BANDS
];
int
i
,
j
;
int
i
;
jint
*
body
;
int
scanlineLimit
;
int
pixelStride
;
...
...
@@ -1824,14 +1823,12 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
pixelBufferPtr
pb
;
sun_jpeg_error_ptr
jerr
;
boolean
done
;
jint
*
bandSize
;
int
maxBandValue
,
halfMaxBandValue
;
boolean
mustScale
=
FALSE
;
boolean
progressive
=
FALSE
;
boolean
orderedBands
=
TRUE
;
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
unsigned
in
t
numBytes
;
size_
t
numBytes
;
/* verify the inputs */
...
...
@@ -1849,7 +1846,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
cinfo
=
(
j_decompress_ptr
)
data
->
jpegObj
;
if
((
numBands
<
1
)
||
if
((
numBands
<
1
)
||
(
numBands
>
MAX_BANDS
)
||
(
sourceXStart
<
0
)
||
(
sourceXStart
>=
(
jint
)
cinfo
->
image_width
)
||
(
sourceYStart
<
0
)
||
(
sourceYStart
>=
(
jint
)
cinfo
->
image_height
)
||
(
sourceWidth
<
1
)
||
(
sourceWidth
>
(
jint
)
cinfo
->
image_width
)
||
...
...
@@ -1863,10 +1860,10 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
return
JNI_FALSE
;
}
if
(
stepX
>
cinfo
->
image_width
)
{
if
(
stepX
>
(
jint
)
cinfo
->
image_width
)
{
stepX
=
cinfo
->
image_width
;
}
if
(
stepY
>
cinfo
->
image_height
)
{
if
(
stepY
>
(
jint
)
cinfo
->
image_height
)
{
stepY
=
cinfo
->
image_height
;
}
...
...
@@ -2119,7 +2116,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_abortRead
jobject
this
,
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
if
(
data
==
NULL
)
{
JNU_ThrowByName
(
env
,
...
...
@@ -2137,7 +2134,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetLibraryState
(
JNIEnv
*
env
,
jobject
this
,
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
if
(
data
==
NULL
)
{
...
...
@@ -2159,7 +2156,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetReader
jobject
this
,
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_decompress_ptr
cinfo
;
sun_jpeg_error_ptr
jerr
;
...
...
@@ -2232,7 +2229,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_disposeReader
jclass
reader
,
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_common_ptr
info
=
destroyImageioData
(
env
,
data
);
imageio_dispose
(
info
);
...
...
@@ -2317,8 +2314,8 @@ imageio_term_destination (j_compress_ptr cinfo)
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
/* find out how much needs to be written */
jint
datacount
=
sb
->
bufferLength
-
dest
->
free_in_buffer
;
/* this conversion from size_t to jint is safe, because the lenght of the buffer is limited by jint */
jint
datacount
=
(
jint
)(
sb
->
bufferLength
-
dest
->
free_in_buffer
);
if
(
datacount
!=
0
)
{
RELEASE_ARRAYS
(
env
,
data
,
(
const
JOCTET
*
)(
dest
->
next_output_byte
));
...
...
@@ -2485,7 +2482,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initJPEGImageWriter
imageio_dispose
((
j_common_ptr
)
cinfo
);
return
0
;
}
return
(
jlong
)
ret
;
return
ptr_to_jlong
(
ret
)
;
}
JNIEXPORT
void
JNICALL
...
...
@@ -2495,7 +2492,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_setDest
jlong
ptr
,
jobject
destination
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_compress_ptr
cinfo
;
if
(
data
==
NULL
)
{
...
...
@@ -2526,7 +2523,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeTables
struct
jpeg_destination_mgr
*
dest
;
sun_jpeg_error_ptr
jerr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_compress_ptr
cinfo
;
if
(
data
==
NULL
)
{
...
...
@@ -2625,10 +2622,11 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
jint
*
scanData
;
jint
*
bandSize
;
int
maxBandValue
,
halfMaxBandValue
;
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_compress_ptr
cinfo
;
UINT8
**
scale
=
NULL
;
/* verify the inputs */
if
(
data
==
NULL
)
{
...
...
@@ -2740,6 +2738,16 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
buffer
);
JNU_ThrowByName
(
env
,
"javax/imageio/IIOException"
,
buffer
);
}
if
(
scale
!=
NULL
)
{
for
(
i
=
0
;
i
<
numBands
;
i
++
)
{
if
(
scale
[
i
]
!=
NULL
)
{
free
(
scale
[
i
]);
}
}
free
(
scale
);
}
free
(
scanLinePtr
);
return
data
->
abortFlag
;
}
...
...
@@ -2953,7 +2961,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_abortWrite
jobject
this
,
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
if
(
data
==
NULL
)
{
JNU_ThrowByName
(
env
,
...
...
@@ -2970,7 +2978,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_resetWriter
(
JNIEnv
*
env
,
jobject
this
,
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_compress_ptr
cinfo
;
if
(
data
==
NULL
)
{
...
...
@@ -3002,7 +3010,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_disposeWriter
jclass
writer
,
jlong
ptr
)
{
imageIODataPtr
data
=
(
imageIODataPtr
)
ptr
;
imageIODataPtr
data
=
(
imageIODataPtr
)
jlong_to_ptr
(
ptr
)
;
j_common_ptr
info
=
destroyImageioData
(
env
,
data
);
imageio_dispose
(
info
);
...
...
src/share/native/sun/awt/image/jpeg/jdmarker.c
浏览文件 @
d3868580
...
...
@@ -1325,14 +1325,14 @@ jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
unsigned
int
length_limit
)
{
my_marker_ptr
marker
=
(
my_marker_ptr
)
cinfo
->
marker
;
long
maxlength
;
size_t
maxlength
;
jpeg_marker_parser_method
processor
;
/* Length limit mustn't be larger than what we can allocate
* (should only be a concern in a 16-bit environment).
*/
maxlength
=
cinfo
->
mem
->
max_alloc_chunk
-
SIZEOF
(
struct
jpeg_marker_struct
);
if
(
((
long
)
length_limit
)
>
maxlength
)
if
(
length_limit
>
maxlength
)
length_limit
=
(
unsigned
int
)
maxlength
;
/* Choose processor routine to use.
...
...
src/share/native/sun/awt/image/jpeg/jmemmgr.c
浏览文件 @
d3868580
...
...
@@ -133,7 +133,7 @@ typedef struct {
jvirt_barray_ptr
virt_barray_list
;
/* This counts total space obtained from jpeg_get_small/large */
long
total_space_allocated
;
size_t
total_space_allocated
;
/* alloc_sarray and alloc_barray set this value for use by virtual
* array routines.
...
...
@@ -588,8 +588,8 @@ realize_virt_arrays (j_common_ptr cinfo)
/* Allocate the in-memory buffers for any unrealized virtual arrays */
{
my_mem_ptr
mem
=
(
my_mem_ptr
)
cinfo
->
mem
;
long
space_per_minheight
,
maximum_space
,
avail_mem
;
long
minheights
,
max_minheights
;
size_t
space_per_minheight
,
maximum_space
,
avail_mem
;
size_t
minheights
,
max_minheights
;
jvirt_sarray_ptr
sptr
;
jvirt_barray_ptr
bptr
;
...
...
@@ -1032,7 +1032,7 @@ GLOBAL(void)
jinit_memory_mgr
(
j_common_ptr
cinfo
)
{
my_mem_ptr
mem
;
long
max_to_use
;
size_t
max_to_use
;
int
pool
;
size_t
test_mac
;
...
...
@@ -1109,8 +1109,10 @@ jinit_memory_mgr (j_common_ptr cinfo)
if
((
memenv
=
getenv
(
"JPEGMEM"
))
!=
NULL
)
{
char
ch
=
'x'
;
unsigned
int
mem_max
=
0u
;
if
(
sscanf
(
memenv
,
"%ld%c"
,
&
max_to_use
,
&
ch
)
>
0
)
{
if
(
sscanf
(
memenv
,
"%u%c"
,
&
mem_max
,
&
ch
)
>
0
)
{
max_to_use
=
(
size_t
)
mem_max
;
if
(
ch
==
'm'
||
ch
==
'M'
)
max_to_use
*=
1000L
;
mem
->
pub
.
max_memory_to_use
=
max_to_use
*
1000L
;
...
...
src/share/native/sun/awt/image/jpeg/jmemnobs.c
浏览文件 @
d3868580
...
...
@@ -73,9 +73,9 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
* Here we always say, "we got all you want bud!"
*/
GLOBAL
(
long
)
jpeg_mem_available
(
j_common_ptr
cinfo
,
long
min_bytes_needed
,
long
max_bytes_needed
,
long
already_allocated
)
GLOBAL
(
size_t
)
jpeg_mem_available
(
j_common_ptr
cinfo
,
size_t
min_bytes_needed
,
size_t
max_bytes_needed
,
size_t
already_allocated
)
{
return
max_bytes_needed
;
}
...
...
@@ -100,7 +100,7 @@ jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
* cleanup required. Here, there isn't any.
*/
GLOBAL
(
long
)
GLOBAL
(
size_t
)
jpeg_mem_init
(
j_common_ptr
cinfo
)
{
return
0
;
/* just set max_memory_to_use to 0 */
...
...
src/share/native/sun/awt/image/jpeg/jmemsys.h
浏览文件 @
d3868580
...
...
@@ -104,10 +104,10 @@ EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
* Conversely, zero may be returned to always use the minimum amount of memory.
*/
EXTERN
(
long
)
jpeg_mem_available
JPP
((
j_common_ptr
cinfo
,
long
min_bytes_needed
,
long
max_bytes_needed
,
long
already_allocated
));
EXTERN
(
size_t
)
jpeg_mem_available
JPP
((
j_common_ptr
cinfo
,
size_t
min_bytes_needed
,
size_t
max_bytes_needed
,
size_t
already_allocated
));
/*
...
...
@@ -198,5 +198,5 @@ EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,
* all opened backing-store objects have been closed.
*/
EXTERN
(
long
)
jpeg_mem_init
JPP
((
j_common_ptr
cinfo
));
EXTERN
(
size_t
)
jpeg_mem_init
JPP
((
j_common_ptr
cinfo
));
EXTERN
(
void
)
jpeg_mem_term
JPP
((
j_common_ptr
cinfo
));
src/share/native/sun/awt/image/jpeg/jpegdecoder.c
浏览文件 @
d3868580
...
...
@@ -328,7 +328,7 @@ sun_jpeg_fill_suspended_buffer(j_decompress_ptr cinfo)
if
((
*
env
)
->
ExceptionOccurred
(
env
)
||
!
GET_ARRAYS
(
env
,
src
))
{
cinfo
->
err
->
error_exit
((
struct
jpeg_common_struct
*
)
cinfo
);
}
if
(
ret
<=
src
->
remaining_skip
)
{
if
(
ret
<
0
||
(
unsigned
int
)
ret
<
=
src
->
remaining_skip
)
{
return
;
}
if
(
src
->
remaining_skip
)
{
...
...
@@ -397,7 +397,7 @@ sun_jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
}
num_bytes
+=
src
->
remaining_skip
;
src
->
remaining_skip
=
0
;
ret
=
src
->
pub
.
bytes_in_buffer
;
ret
=
(
int
)
src
->
pub
.
bytes_in_buffer
;
/* this conversion is safe, because capacity of the buffer is limited by jnit */
if
(
ret
>=
num_bytes
)
{
src
->
pub
.
next_input_byte
+=
num_bytes
;
src
->
pub
.
bytes_in_buffer
-=
num_bytes
;
...
...
src/share/native/sun/awt/image/jpeg/jpeglib.h
浏览文件 @
d3868580
...
...
@@ -800,10 +800,10 @@ struct jpeg_memory_mgr {
* used for virtual-array buffers.) May be changed by outer application
* after creating the JPEG object.
*/
long
max_memory_to_use
;
size_t
max_memory_to_use
;
/* Maximum allocation request accepted by alloc_large. */
long
max_alloc_chunk
;
size_t
max_alloc_chunk
;
};
...
...
src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
浏览文件 @
d3868580
...
...
@@ -479,8 +479,7 @@ public abstract class XRSurfaceData extends XSurfaceData {
if
(
xrpipe
==
null
)
{
try
{
SunToolkit
.
awtLock
();
xgc
=
renderQueue
.
createGC
(
xid
);
// TODO: GC leak? where to
// clean up?
xgc
=
XCreateGC
(
getNativeOps
());
xrpipe
=
new
XRRenderer
(
maskBuffer
.
getMaskBuffer
());
xrtxpipe
=
new
PixelToShapeConverter
(
xrpipe
);
...
...
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
浏览文件 @
d3868580
...
...
@@ -595,15 +595,16 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo,
}
XImage
*
X11SD_GetSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
,
jboolean
readBits
)
j
int
maxWidth
,
jint
maxHeight
,
j
boolean
readBits
)
{
XImage
*
retImage
=
NULL
;
if
(
cachedXImage
!=
NULL
&&
X11SD_CachedXImageFits
(
width
,
height
,
xsdo
->
depth
,
readBits
))
{
/* sync so previous data gets flushed */
XSync
(
awt_display
,
False
);
retImage
=
cachedXImage
;
cachedXImage
=
(
XImage
*
)
NULL
;
X11SD_CachedXImageFits
(
width
,
height
,
maxWidth
,
maxHeight
,
xsdo
->
depth
,
readBits
))
{
/* sync so previous data gets flushed */
XSync
(
awt_display
,
False
);
retImage
=
cachedXImage
;
cachedXImage
=
(
XImage
*
)
NULL
;
}
else
if
(
width
*
height
*
xsdo
->
depth
>
0x10000
)
{
retImage
=
X11SD_CreateSharedImage
(
xsdo
,
width
,
height
);
}
...
...
@@ -728,8 +729,8 @@ void X11SD_UnPuntPixmap(X11SDOps *xsdo)
* it must be close enough to avoid excessive reading from the screen;
* otherwise it should just be at least the size requested.
*/
jboolean
X11SD_CachedXImageFits
(
jint
width
,
jint
height
,
jint
dep
th
,
jboolean
readBits
)
jboolean
X11SD_CachedXImageFits
(
jint
width
,
jint
height
,
jint
maxWid
th
,
j
int
maxHeight
,
jint
depth
,
j
boolean
readBits
)
{
/* we assume here that the cached image exists */
jint
imgWidth
=
cachedXImage
->
width
;
...
...
@@ -747,10 +748,14 @@ jboolean X11SD_CachedXImageFits(jint width, jint height, jint depth,
return
JNI_TRUE
;
}
if
((
imgWidth
<
width
+
64
)
&&
(
imgHeight
<
height
+
64
))
{
if
((
imgWidth
<
width
+
64
)
&&
(
imgHeight
<
height
+
64
)
&&
imgWidth
<=
maxWidth
&&
imgHeight
<=
maxHeight
)
{
/* Cached image's width/height shouldn't be more than 64 pixels
* larger than requested, because the region in XShmGetImage
* can't be specified and we don't want to read too much.
* Furthermore it has to be smaller than maxWidth/Height
* so drawables are not read out of bounds.
*/
return
JNI_TRUE
;
}
...
...
@@ -1295,7 +1300,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
SurfaceDataBounds
*
bounds
,
jint
lockFlags
)
{
int
x
,
y
,
w
,
h
;
int
x
,
y
,
w
,
h
,
maxWidth
,
maxHeight
;
int
scan
;
XImage
*
img
=
NULL
;
Drawable
drawable
;
...
...
@@ -1311,10 +1316,31 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
#ifdef MITSHM
if
(
useMitShmExt
==
CAN_USE_MITSHM
)
{
if
(
xsdo
->
isPixmap
&&
readBits
)
{
X11SD_PuntPixmap
(
xsdo
,
w
,
h
);
if
(
xsdo
->
isPixmap
)
{
if
(
readBits
)
{
X11SD_PuntPixmap
(
xsdo
,
w
,
h
);
}
maxWidth
=
xsdo
->
pmWidth
;
maxHeight
=
xsdo
->
pmHeight
;
}
else
{
XWindowAttributes
winAttr
;
if
(
XGetWindowAttributes
(
awt_display
,
(
Window
)
xsdo
->
drawable
,
&
winAttr
)
!=
0
)
{
maxWidth
=
winAttr
.
width
;
maxHeight
=
winAttr
.
height
;
}
else
{
/* XGWA failed which isn't a good thing. Defaulting to using
* x,y means that after the subtraction of these we will use
* w=0, h=0 which is a reasonable default on such a failure.
*/
maxWidth
=
x
;
maxHeight
=
y
;
}
}
img
=
X11SD_GetSharedImage
(
xsdo
,
w
,
h
,
readBits
);
maxWidth
-=
x
;
maxHeight
-=
y
;
img
=
X11SD_GetSharedImage
(
xsdo
,
w
,
h
,
maxWidth
,
maxHeight
,
readBits
);
}
#endif
/* MITSHM */
drawable
=
xsdo
->
drawable
;
...
...
src/solaris/native/sun/java2d/x11/X11SurfaceData.h
浏览文件 @
d3868580
...
...
@@ -125,15 +125,21 @@ struct _X11SDOps {
#define X11SD_LOCK_BY_SHMEM 4
/* surface locked by ShMemExt */
#ifdef MITSHM
XImage
*
X11SD_GetSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
,
jboolean
readBits
);
XImage
*
X11SD_GetSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
,
jint
maxWidth
,
jint
maxHeight
,
jboolean
readBits
);
XImage
*
X11SD_CreateSharedImage
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
);
Drawable
X11SD_CreateSharedPixmap
(
X11SDOps
*
xsdo
);
void
X11SD_DropSharedSegment
(
XShmSegmentInfo
*
shminfo
);
void
X11SD_PuntPixmap
(
X11SDOps
*
xsdo
,
jint
width
,
jint
height
);
void
X11SD_UnPuntPixmap
(
X11SDOps
*
xsdo
);
jboolean
X11SD_CachedXImageFits
(
jint
width
,
jint
height
,
jint
depth
,
jboolean
readBits
);
jboolean
X11SD_CachedXImageFits
(
jint
width
,
jint
height
,
jint
maxWidth
,
jint
maxHeight
,
jint
depth
,
jboolean
readBits
);
XImage
*
X11SD_GetCachedXImage
(
jint
width
,
jint
height
,
jboolean
readBits
);
#endif
/* MITSHM */
jint
X11SD_InitWindow
(
JNIEnv
*
env
,
X11SDOps
*
xsdo
);
void
X11SD_DisposeOrCacheXImage
(
XImage
*
image
);
void
X11SD_DisposeXImage
(
XImage
*
image
);
void
X11SD_DirectRenderNotify
(
JNIEnv
*
env
,
X11SDOps
*
xsdo
);
...
...
src/windows/classes/sun/awt/windows/WPathGraphics.java
浏览文件 @
d3868580
...
...
@@ -51,9 +51,12 @@ import java.awt.image.ColorModel;
import
java.awt.image.DataBuffer
;
import
java.awt.image.IndexColorModel
;
import
java.awt.image.WritableRaster
;
import
java.awt.image.ComponentSampleModel
;
import
java.awt.image.MultiPixelPackedSampleModel
;
import
java.awt.image.SampleModel
;
import
sun.awt.image.ByteComponentRaster
;
import
sun.awt.image.BytePackedRaster
;
import
java.awt.print.PageFormat
;
import
java.awt.print.Printable
;
import
java.awt.print.PrinterException
;
...
...
@@ -1272,6 +1275,25 @@ class WPathGraphics extends PathGraphics {
return
false
;
}
int
bitsPerPixel
=
24
;
SampleModel
sm
=
deepImage
.
getSampleModel
();
if
(
sm
instanceof
ComponentSampleModel
)
{
ComponentSampleModel
csm
=
(
ComponentSampleModel
)
sm
;
bitsPerPixel
=
csm
.
getPixelStride
()
*
8
;
}
else
if
(
sm
instanceof
MultiPixelPackedSampleModel
)
{
MultiPixelPackedSampleModel
mppsm
=
(
MultiPixelPackedSampleModel
)
sm
;
bitsPerPixel
=
mppsm
.
getPixelBitStride
();
}
else
{
if
(
icm
!=
null
)
{
int
diw
=
deepImage
.
getWidth
();
int
dih
=
deepImage
.
getHeight
();
if
(
diw
>
0
&&
dih
>
0
)
{
bitsPerPixel
=
data
.
length
*
8
/
diw
/
dih
;
}
}
}
/* Because the caller's image has been rotated
* and sheared into our BufferedImage and because
* we will be handing that BufferedImage directly to
...
...
@@ -1289,7 +1311,7 @@ class WPathGraphics extends PathGraphics {
(
float
)
Math
.
rint
(
scaledBounds
.
height
+
0.5
),
0
f
,
0
f
,
deepImage
.
getWidth
(),
deepImage
.
getHeight
(),
icm
);
bitsPerPixel
,
icm
);
setClip
(
holdClip
);
}
...
...
src/windows/classes/sun/awt/windows/WPrinterJob.java
浏览文件 @
d3868580
...
...
@@ -1212,13 +1212,14 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
float
destWidth
,
float
destHeight
,
float
srcX
,
float
srcY
,
float
srcWidth
,
float
srcHeight
,
int
sampleBitsPerPixel
,
IndexColorModel
icm
)
{
int
bitCount
=
24
;
byte
[]
bmiColors
=
null
;
if
(
icm
!=
null
)
{
bitCount
=
icm
.
getPixelSize
()
;
bmiColors
=
new
byte
[(
1
<<
bitCount
)*
4
];
bitCount
=
sampleBitsPerPixel
;
bmiColors
=
new
byte
[(
1
<<
icm
.
getPixelSize
()
)*
4
];
for
(
int
i
=
0
;
i
<
icm
.
getMapSize
();
i
++)
{
bmiColors
[
i
*
4
+
0
]=(
byte
)(
icm
.
getBlue
(
i
)&
0xff
);
bmiColors
[
i
*
4
+
1
]=(
byte
)(
icm
.
getGreen
(
i
)&
0xff
);
...
...
src/windows/classes/sun/print/Win32PrintService.java
浏览文件 @
d3868580
...
...
@@ -31,6 +31,7 @@ import java.net.URISyntaxException;
import
java.net.URL
;
import
java.util.Vector
;
import
java.util.HashMap
;
import
javax.print.DocFlavor
;
import
javax.print.DocPrintJob
;
...
...
@@ -205,6 +206,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
private
MediaPrintableArea
[]
mediaPrintables
;
private
MediaTray
[]
mediaTrays
;
private
PrinterResolution
[]
printRes
;
private
HashMap
mpaMap
;
private
int
nCopies
;
private
int
prnCaps
;
private
int
[]
defaultSettings
;
...
...
@@ -212,6 +214,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
private
boolean
gotTrays
;
private
boolean
gotCopies
;
private
boolean
mediaInitialized
;
private
boolean
mpaListInitialized
;
private
ArrayList
idList
;
private
MediaSize
[]
mediaSizes
;
...
...
@@ -380,43 +383,115 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
// Add mediaName to the msnList
if
(
mediaName
!=
null
)
{
added
=
addToUniqueList
(
msnList
,
mediaName
);
// get MediaPrintableArea only for supported MediaSizeName ?
if
(
added
&&
!
queryFailure
)
{
prnArea
=
getMediaPrintableArea
(
printer
,
((
Integer
)
idList
.
get
(
i
)).
intValue
());
if
(
prnArea
!=
null
)
{
try
{
MediaPrintableArea
mpa
=
new
MediaPrintableArea
(
prnArea
[
0
],
prnArea
[
1
],
prnArea
[
2
],
prnArea
[
3
],
MediaPrintableArea
.
INCH
);
printableList
.
add
(
mpa
);
}
catch
(
IllegalArgumentException
iae
)
{
}
}
else
{
// Calling getMediaPrintableArea causes
// much overhead so if first attempt failed, we should
// just bail out.
if
(
i
==
0
)
{
queryFailure
=
true
;
}
}
}
}
}
// init mediaSizeNames
mediaSizeNames
=
new
MediaSizeName
[
msnList
.
size
()];
msnList
.
toArray
(
mediaSizeNames
);
}
/*
* Gets a list of MediaPrintableAreas using a call to native function.
* msn is MediaSizeName used to get a specific printable area. If null,
* it will get all the supported MediPrintableAreas.
*/
private
synchronized
MediaPrintableArea
[]
getMediaPrintables
(
MediaSizeName
msn
)
{
if
(
msn
==
null
)
{
if
(
mpaListInitialized
==
true
)
{
return
mediaPrintables
;
}
}
else
{
// get from cached mapping of MPAs
if
(
mpaMap
!=
null
&&
(
mpaMap
.
get
(
msn
)
!=
null
))
{
MediaPrintableArea
[]
mpaArr
=
new
MediaPrintableArea
[
1
];
mpaArr
[
0
]
=
(
MediaPrintableArea
)
mpaMap
.
get
(
msn
);
return
mpaArr
;
}
}
// init mediaPrintables
mediaPrintables
=
new
MediaPrintableArea
[
printableList
.
size
()];
printableList
.
toArray
(
mediaPrintables
);
initMedia
();
if
((
mediaSizeNames
==
null
)
&&
(
mediaSizeNames
.
length
==
0
))
{
return
null
;
}
MediaSizeName
[]
loopNames
;
if
(
msn
!=
null
)
{
loopNames
=
new
MediaSizeName
[
1
];
loopNames
[
0
]
=
msn
;
}
else
{
loopNames
=
mediaSizeNames
;
}
if
(
mpaMap
==
null
)
{
mpaMap
=
new
HashMap
();
}
for
(
int
i
=
0
;
i
<
loopNames
.
length
;
i
++)
{
MediaSizeName
mediaName
=
loopNames
[
i
];
if
(
mpaMap
.
get
(
mediaName
)
!=
null
)
{
continue
;
}
if
(
mediaName
!=
null
)
{
int
defPaper
=
findPaperID
(
mediaName
);
float
[]
prnArea
=
getMediaPrintableArea
(
printer
,
defPaper
);
MediaPrintableArea
printableArea
=
null
;
if
(
prnArea
!=
null
)
{
try
{
printableArea
=
new
MediaPrintableArea
(
prnArea
[
0
],
prnArea
[
1
],
prnArea
[
2
],
prnArea
[
3
],
MediaPrintableArea
.
INCH
);
mpaMap
.
put
(
mediaName
,
printableArea
);
}
catch
(
IllegalArgumentException
e
)
{
}
}
else
{
// if getting MPA failed, we use MediaSize
MediaSize
ms
=
MediaSize
.
getMediaSizeForName
((
MediaSizeName
)
mediaName
);
if
(
ms
!=
null
)
{
try
{
printableArea
=
new
MediaPrintableArea
(
0
,
0
,
ms
.
getX
(
MediaSize
.
INCH
),
ms
.
getY
(
MediaSize
.
INCH
),
MediaPrintableArea
.
INCH
);
mpaMap
.
put
(
mediaName
,
printableArea
);
}
catch
(
IllegalArgumentException
e
)
{
}
}
}
}
//mediaName != null
}
if
(
mpaMap
.
size
()
==
0
)
{
return
null
;
}
if
(
msn
!=
null
)
{
if
(
mpaMap
.
get
(
msn
)
==
null
)
{
return
null
;
}
MediaPrintableArea
[]
mpaArr
=
new
MediaPrintableArea
[
1
];
// by this time, we've already gotten the desired MPA
mpaArr
[
0
]
=
(
MediaPrintableArea
)
mpaMap
.
get
(
msn
);
return
mpaArr
;
}
else
{
mediaPrintables
=
(
MediaPrintableArea
[])
mpaMap
.
values
().
toArray
(
new
MediaPrintableArea
[
0
]);
mpaListInitialized
=
true
;
return
mediaPrintables
;
}
}
private
synchronized
MediaTray
[]
getMediaTrays
()
{
if
(
gotTrays
==
true
&&
mediaTrays
!=
null
)
{
return
mediaTrays
;
...
...
@@ -626,7 +701,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
private
boolean
isSupportedMediaPrintableArea
(
MediaPrintableArea
mpa
)
{
initMedia
(
);
getMediaPrintables
(
null
);
if
(
mediaPrintables
!=
null
)
{
for
(
int
i
=
0
;
i
<
mediaPrintables
.
length
;
i
++)
{
...
...
@@ -1250,57 +1325,32 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
}
if
(
trays
!=
null
)
{
System
.
arraycopy
(
trays
,
0
,
arr
,
mediaSizeName
s
.
length
,
trays
.
length
);
len
-
tray
s
.
length
,
trays
.
length
);
}
return
arr
;
}
else
if
(
category
==
MediaPrintableArea
.
class
)
{
initMedia
();
if
(
mediaPrintables
==
null
)
{
return
null
;
}
// if getting printable area for a specific media size
Media
mediaName
;
Media
mediaName
=
null
;
if
((
attributes
!=
null
)
&&
((
mediaName
=
(
Media
)
attributes
.
get
(
Media
.
class
))
!=
null
))
{
if
(
mediaName
instanceof
MediaSizeName
)
{
MediaPrintableArea
[]
arr
=
new
MediaPrintableArea
[
1
];
if
(
mediaSizeNames
.
length
==
mediaPrintables
.
length
)
{
for
(
int
j
=
0
;
j
<
mediaSizeNames
.
length
;
j
++)
{
if
(
mediaName
.
equals
(
mediaSizeNames
[
j
]))
{
arr
[
0
]
=
mediaPrintables
[
j
];
return
arr
;
}
}
}
MediaSize
ms
=
MediaSize
.
getMediaSizeForName
((
MediaSizeName
)
mediaName
);
if
(
ms
!=
null
)
{
arr
[
0
]
=
new
MediaPrintableArea
(
0
,
0
,
ms
.
getX
(
MediaSize
.
INCH
),
ms
.
getY
(
MediaSize
.
INCH
),
MediaPrintableArea
.
INCH
);
return
arr
;
}
else
{
return
null
;
}
if
(!(
mediaName
instanceof
MediaSizeName
))
{
// if an instance of MediaTray, fall thru returning
// all MediaPrintableAreas
mediaName
=
null
;
}
// else an instance of MediaTray, fall thru returning
// all MediaPrintableAreas
}
MediaPrintableArea
[]
arr
=
new
MediaPrintableArea
[
mediaPrintables
.
length
];
System
.
arraycopy
(
mediaPrintables
,
0
,
arr
,
0
,
mediaPrintables
.
length
);
return
arr
;
MediaPrintableArea
[]
mpas
=
getMediaPrintables
((
MediaSizeName
)
mediaName
);
if
(
mpas
!=
null
)
{
MediaPrintableArea
[]
arr
=
new
MediaPrintableArea
[
mpas
.
length
];
System
.
arraycopy
(
mpas
,
0
,
arr
,
0
,
mpas
.
length
);
return
arr
;
}
else
{
return
null
;
}
}
else
if
(
category
==
SunAlternateMedia
.
class
)
{
return
new
SunAlternateMedia
(
(
Media
)
getDefaultAttributeValue
(
Media
.
class
));
...
...
src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp
浏览文件 @
d3868580
...
...
@@ -107,8 +107,16 @@ Java_sun_java2d_windows_GDIBlitLoops_nativeBlit
// could retain their own DIB info and we would not need to
// recreate it every time.
// GetRasInfo implicitly calls GetPrimitiveArrayCritical
// and since GetDC uses JNI it needs to be called first.
HDC
hDC
=
dstOps
->
GetDC
(
env
,
dstOps
,
0
,
NULL
,
clip
,
NULL
,
0
);
if
(
hDC
==
NULL
)
{
SurfaceData_InvokeUnlock
(
env
,
srcOps
,
&
srcInfo
);
return
;
}
srcOps
->
GetRasInfo
(
env
,
srcOps
,
&
srcInfo
);
if
(
srcInfo
.
rasBase
==
NULL
)
{
dstOps
->
ReleaseDC
(
env
,
dstOps
,
hDC
);
SurfaceData_InvokeUnlock
(
env
,
srcOps
,
&
srcInfo
);
return
;
}
...
...
@@ -174,13 +182,6 @@ Java_sun_java2d_windows_GDIBlitLoops_nativeBlit
bmi
.
colors
.
dwMasks
[
2
]
=
bmask
;
}
HDC
hDC
=
dstOps
->
GetDC
(
env
,
dstOps
,
0
,
NULL
,
clip
,
NULL
,
0
);
if
(
hDC
==
NULL
)
{
SurfaceData_InvokeRelease
(
env
,
srcOps
,
&
srcInfo
);
SurfaceData_InvokeUnlock
(
env
,
srcOps
,
&
srcInfo
);
return
;
}
if
(
fastBlt
)
{
// Window could go away at any time, leaving bits on the screen
// from this GDI call, so make sure window still exists
...
...
test/java/awt/PrintJob/Text/StringWidth.java
浏览文件 @
d3868580
...
...
@@ -63,7 +63,8 @@ public class StringWidth extends Frame {
}
public
static
void
main
(
String
[]
args
)
{
new
StringWidth
();
StringWidth
sw
=
new
StringWidth
();
sw
.
dispose
();
}
}
test/java/awt/font/StyledMetrics/BoldSpace.java
0 → 100644
浏览文件 @
d3868580
/*
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
@bug 6686365 7017637
@summary Confirm that styling does not affect metrics of zero advance glyphs
*/
import
java.awt.*
;
import
java.awt.image.*
;
public
class
BoldSpace
{
public
static
void
main
(
String
[]
s
)
{
BufferedImage
bi
=
new
BufferedImage
(
100
,
100
,
BufferedImage
.
TYPE_INT_ARGB
);
String
errMsg
=
"ZWJ Space char should have 0 advance\n"
;
Graphics
g
=
bi
.
getGraphics
();
// It turns out that some fonts inexplicably treat this as
// a standard character. In this 14 pt font, if we see an advance
// that's clearly bigger than we'd have introduced in bolding we'll
// not error out this test, presuming that its a consequence of
// the actual font data. A Linux font 'TLwg Type Bold' is the case
// in point.
int
errorMargin
=
4
;
g
.
setFont
(
new
Font
(
"monospaced"
,
Font
.
BOLD
,
14
));
//g.setFont(new Font("Lucida Sans Regular", Font.BOLD, 14));
FontMetrics
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold: "
+
fm
.
charWidth
(
'\u200b'
));
int
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_LCD_HRGB
);
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold + LCD: "
+
fm
.
charWidth
(
'\u200b'
));
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_FRACTIONALMETRICS
,
RenderingHints
.
VALUE_FRACTIONALMETRICS_ON
);
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_ON
);
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold FM OFF + AA: "
+
fm
.
charWidth
(
'\u200b'
));
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_FRACTIONALMETRICS
,
RenderingHints
.
VALUE_FRACTIONALMETRICS_OFF
);
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_ON
);
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold FM ON + AA: "
+
fm
.
charWidth
(
'\u200b'
));
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_FRACTIONALMETRICS
,
RenderingHints
.
VALUE_FRACTIONALMETRICS_ON
);
((
Graphics2D
)
g
).
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_OFF
);
fm
=
g
.
getFontMetrics
();
System
.
out
.
println
(
"Bold FM ON + nonAA: "
+
fm
.
charWidth
(
'\u200b'
));
cwid
=
fm
.
charWidth
(
'\u200b'
);
if
(
cwid
>
0
&&
cwid
<
errorMargin
)
{
throw
new
RuntimeException
(
errMsg
);
}
System
.
out
.
println
(
"All printed values should be 0 to PASS"
);
}
}
test/java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java
0 → 100644
浏览文件 @
d3868580
/*
* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
*
* @test
* @bug 4521945 7006865
* @summary Test printing images of different types.
* @author prr
* @run main/manual=yesno/timeout=900 ImageTypes
*/
import
java.io.*
;
import
static
java
.
awt
.
Color
.*;
import
java.awt.*
;
import
java.awt.geom.*
;
import
java.awt.event.*
;
import
java.awt.print.*
;
import
java.awt.image.*
;
import
static
java
.
awt
.
image
.
BufferedImage
.*;
import
javax.print.*
;
import
javax.print.attribute.*
;
import
javax.print.attribute.standard.*
;
public
class
ImageTypes
extends
Frame
implements
ActionListener
{
private
ImageCanvas
c
;
public
static
void
main
(
String
args
[])
{
ImageTypes
f
=
new
ImageTypes
();
f
.
show
();
}
public
ImageTypes
()
{
super
(
"Image Types Printing Test"
);
c
=
new
ImageCanvas
();
add
(
"Center"
,
c
);
Button
printThisButton
=
new
Button
(
"Print"
);
printThisButton
.
addActionListener
(
this
);
Panel
p
=
new
Panel
();
p
.
add
(
printThisButton
);
add
(
"South"
,
p
);
add
(
"North"
,
getInstructions
());
addWindowListener
(
new
WindowAdapter
()
{
public
void
windowClosing
(
WindowEvent
e
)
{
System
.
exit
(
0
);
}
});
pack
();
}
private
TextArea
getInstructions
()
{
TextArea
ta
=
new
TextArea
(
10
,
60
);
ta
.
setFont
(
new
Font
(
"Dialog"
,
Font
.
PLAIN
,
11
));
ta
.
setText
(
"This is a manual test as it requires that you compare "
+
"the on-screen rendering with the printed output.\n"
+
"Select the 'Print' button to print out the test.\n"
+
"For each image compare the printed one to the on-screen one.\n"
+
"The test PASSES if the onscreen and printed rendering match."
);
return
ta
;
}
public
void
actionPerformed
(
ActionEvent
e
)
{
PrinterJob
pj
=
PrinterJob
.
getPrinterJob
();
PrintRequestAttributeSet
attrs
=
new
HashPrintRequestAttributeSet
();
if
(
pj
!=
null
&&
pj
.
printDialog
(
attrs
))
{
pj
.
setPrintable
(
c
);
try
{
pj
.
print
(
attrs
);
}
catch
(
PrinterException
pe
)
{
pe
.
printStackTrace
();
throw
new
RuntimeException
(
"Exception whilst printing."
);
}
finally
{
System
.
out
.
println
(
"PRINT RETURNED OK."
);
}
}
}
}
class
ImageCanvas
extends
Component
implements
Printable
{
IndexColorModel
icm2
=
null
;
IndexColorModel
icm4
=
null
;
BufferedImage
opaqueImg
=
null
;
BufferedImage
transImg
=
null
;
int
sw
=
99
,
sh
=
99
;
void
paintImage
(
BufferedImage
bi
,
Color
c1
,
Color
c2
)
{
GradientPaint
tp
=
new
GradientPaint
(
0.0f
,
0.0f
,
c1
,
10
f
,
8
f
,
c2
,
true
);
Graphics2D
g2d
=
(
Graphics2D
)
bi
.
getGraphics
();
g2d
.
setPaint
(
tp
);
g2d
.
fillRect
(
0
,
0
,
sw
,
sh
);
g2d
.
setColor
(
gray
);
int
cnt
=
0
;
Font
font
=
new
Font
(
"Serif"
,
Font
.
PLAIN
,
11
);
g2d
.
setFont
(
font
);
FontMetrics
fm
=
g2d
.
getFontMetrics
();
for
(
int
y
=
12
;
y
<
sh
;
y
+=
12
)
{
int
x
=
0
;
while
(
x
<
sw
)
{
String
s
=
(
new
Integer
(++
cnt
)).
toString
();
g2d
.
drawString
(
s
,
x
,
y
);
x
+=
fm
.
stringWidth
(
s
);
}
}
}
ImageCanvas
()
{
opaqueImg
=
new
BufferedImage
(
sw
,
sh
,
TYPE_INT_RGB
);
Color
o1
=
new
Color
(
0
,
0
,
0
);
Color
o2
=
new
Color
(
255
,
255
,
255
);
paintImage
(
opaqueImg
,
o1
,
o2
);
transImg
=
new
BufferedImage
(
sw
,
sh
,
TYPE_INT_ARGB
);
Color
t1
=
new
Color
(
255
,
255
,
255
,
220
);
Color
t2
=
new
Color
(
255
,
200
,
0
,
220
);
paintImage
(
transImg
,
t1
,
t2
);
/* greyscale 2bpp */
byte
[]
arr2bpp
=
{(
byte
)
0
,
(
byte
)
0x55
,
(
byte
)
0xaa
,
(
byte
)
0xff
};
icm2
=
new
IndexColorModel
(
2
,
4
,
arr2bpp
,
arr2bpp
,
arr2bpp
);
/* color 4bpp */
int
[]
cmap
=
new
int
[
16
];
cmap
[
0
]
=
black
.
getRGB
();
cmap
[
1
]
=
white
.
getRGB
();
cmap
[
2
]
=
gray
.
getRGB
();
cmap
[
3
]
=
lightGray
.
getRGB
();
cmap
[
4
]
=
red
.
getRGB
();
cmap
[
5
]
=
green
.
getRGB
();
cmap
[
6
]
=
blue
.
getRGB
();
cmap
[
7
]
=
yellow
.
getRGB
();
cmap
[
8
]
=
cyan
.
getRGB
();
cmap
[
9
]
=
magenta
.
getRGB
();
cmap
[
10
]
=
orange
.
getRGB
();
cmap
[
11
]
=
pink
.
getRGB
();
cmap
[
12
]
=
darkGray
.
getRGB
();
cmap
[
13
]
=
192
<<
16
;
// dark red.
cmap
[
14
]
=
192
<<
8
;
// dark green
cmap
[
15
]
=
192
;
// dark blue
icm4
=
new
IndexColorModel
(
4
,
16
,
cmap
,
0
,
false
,
-
1
,
DataBuffer
.
TYPE_BYTE
);
}
public
int
print
(
Graphics
g
,
PageFormat
pgFmt
,
int
pgIndex
)
{
if
(
pgIndex
>
0
)
{
return
Printable
.
NO_SUCH_PAGE
;
}
Graphics2D
g2d
=
(
Graphics2D
)
g
;
g2d
.
translate
(
pgFmt
.
getImageableX
(),
pgFmt
.
getImageableY
());
paint
(
g2d
);
return
Printable
.
PAGE_EXISTS
;
}
private
void
drawImage
(
Graphics
g
,
int
biType
,
IndexColorModel
icm
)
{
BufferedImage
bi
;
if
(
icm
!=
null
)
{
bi
=
new
BufferedImage
(
sw
,
sh
,
biType
,
icm
);
}
else
{
bi
=
new
BufferedImage
(
sw
,
sh
,
biType
);
}
Graphics
big
=
bi
.
getGraphics
();
if
(
bi
.
getColorModel
().
getPixelSize
()
<=
2
)
{
big
.
drawImage
(
opaqueImg
,
0
,
0
,
null
);
}
else
{
big
.
drawImage
(
transImg
,
0
,
0
,
null
);
}
g
.
drawImage
(
bi
,
0
,
0
,
null
);
}
public
void
paint
(
Graphics
g
)
{
int
incX
=
sw
+
10
,
incY
=
sh
+
10
;
g
.
translate
(
10
,
10
);
drawImage
(
g
,
TYPE_INT_RGB
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_INT_BGR
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_INT_ARGB
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_INT_ARGB_PRE
,
null
);
g
.
translate
(-
3
*
incX
,
incY
);
drawImage
(
g
,
TYPE_3BYTE_BGR
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_4BYTE_ABGR
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_4BYTE_ABGR_PRE
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_USHORT_555_RGB
,
null
);
g
.
translate
(-
3
*
incX
,
incY
);
drawImage
(
g
,
TYPE_USHORT_555_RGB
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_USHORT_GRAY
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_GRAY
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_INDEXED
,
null
);
g
.
translate
(-
3
*
incX
,
incY
);
drawImage
(
g
,
TYPE_BYTE_BINARY
,
null
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_BINARY
,
icm2
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_BINARY
,
icm4
);
g
.
translate
(
incX
,
0
);
drawImage
(
g
,
TYPE_BYTE_INDEXED
,
icm2
);
g
.
translate
(-
3
*
incX
,
incY
);
drawImage
(
g
,
TYPE_BYTE_INDEXED
,
icm4
);
g
.
translate
(
incX
,
0
);
}
/* Size is chosen to match default imageable width of a NA letter
* page. This means there will be clipping, what is clipped will
* depend on PageFormat orientation.
*/
public
Dimension
getPreferredSize
()
{
return
new
Dimension
(
468
,
600
);
}
}
test/javax/print/attribute/ServiceDialogTest.java
浏览文件 @
d3868580
...
...
@@ -71,7 +71,7 @@ public class ServiceDialogTest {
if
(
factories
.
length
>
0
)
{
services
[
0
]
=
factories
[
0
].
getPrintService
(
fos
);
}
else
{
throw
new
RuntimeException
(
"No StreamPrintService available which would support "
+
flavor
"
);
throw
new
RuntimeException
(
"No StreamPrintService available which would support "
+
flavor
);
}
services
[
2
]
=
new
TestPrintService
(
"Test Printer"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录