Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
0a7906e1
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看板
提交
0a7906e1
编写于
5月 29, 2013
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
4f4a63d2
9da71f70
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
239 addition
and
35 deletion
+239
-35
make/sun/awt/FILES_c_unix.gmk
make/sun/awt/FILES_c_unix.gmk
+10
-0
make/sun/awt/FILES_export_unix.gmk
make/sun/awt/FILES_export_unix.gmk
+11
-0
make/sun/awt/mawt.gmk
make/sun/awt/mawt.gmk
+18
-2
makefiles/CompileNativeLibraries.gmk
makefiles/CompileNativeLibraries.gmk
+27
-1
src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
+55
-31
src/macosx/native/sun/font/AWTFont.m
src/macosx/native/sun/font/AWTFont.m
+2
-0
src/share/native/sun/java2d/cmm/lcms/cmscgats.c
src/share/native/sun/java2d/cmm/lcms/cmscgats.c
+2
-0
src/share/native/sun/java2d/cmm/lcms/cmslut.c
src/share/native/sun/java2d/cmm/lcms/cmslut.c
+2
-0
src/solaris/classes/sun/print/IPPPrintService.java
src/solaris/classes/sun/print/IPPPrintService.java
+7
-0
src/windows/classes/sun/awt/windows/WPathGraphics.java
src/windows/classes/sun/awt/windows/WPathGraphics.java
+2
-0
test/java/awt/print/PrinterJob/Collate2DPrintingTest.java
test/java/awt/print/PrinterJob/Collate2DPrintingTest.java
+1
-1
test/java/awt/print/PrinterJob/PrintLatinCJKTest.java
test/java/awt/print/PrinterJob/PrintLatinCJKTest.java
+102
-0
未找到文件。
make/sun/awt/FILES_c_unix.gmk
浏览文件 @
0a7906e1
...
...
@@ -171,3 +171,13 @@ FILES_NO_MOTIF_c = \
GLXSurfaceData.c \
AccelGlyphCache.c \
CUPSfuncs.c
ifeq ($(PLATFORM), macosx)
FILES_NO_MOTIF_objc = \
AWTFont.m \
AWTStrike.m \
CCharToGlyphMapper.m \
CGGlyphImages.m \
CGGlyphOutlines.m \
CoreTextSupport.m
endif # PLATFORM
make/sun/awt/FILES_export_unix.gmk
浏览文件 @
0a7906e1
...
...
@@ -187,3 +187,14 @@ FILES_export2 = \
java/awt/dnd/DnDConstants.java \
sun/awt/CausedFocusEvent.java
ifeq ($(PLATFORM), macosx)
ifeq ($(HEADLESS), true)
FILES_export += \
sun/awt/SunHints.java \
sun/font/CCharToGlyphMapper.java \
sun/font/CFont.java \
sun/font/CFontManager.java \
sun/font/CStrike.java \
sun/font/CStrikeDisposer.java
endif # HEADLESS
endif # PLATFORM
make/sun/awt/mawt.gmk
浏览文件 @
0a7906e1
...
...
@@ -43,6 +43,10 @@ include $(BUILDDIR)/sun/awt/FILES_export_unix.gmk
# compiled based on the motif version.
FILES_c = $(FILES_NO_MOTIF_c)
ifeq ($(PLATFORM), macosx)
FILES_objc = $(FILES_NO_MOTIF_objc)
endif # PLATFORM
ifeq ($(PLATFORM), solaris)
ifneq ($(ARCH), amd64)
FILES_reorder += reorder-$(ARCH)
...
...
@@ -97,6 +101,10 @@ vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe
vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/image
vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/robot_child
ifeq ($(PLATFORM), macosx)
vpath %.m $(call NativeSrcDirList,,native/sun/font)
endif # PLATFORM
#
# Libraries to link in.
#
...
...
@@ -192,13 +200,21 @@ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
$(EVENT_MODEL)
ifeq ($(PLATFORM), macosx)
CPPFLAGS += -I$(CUPS_HEADERS_PATH)
CPPFLAGS += -I$(CUPS_HEADERS_PATH) \
$(call NativeSrcDirList,-I,native/sun/awt) \
$(call NativeSrcDirList,-I,native/sun/font)
ifndef HEADLESS
CPPFLAGS += -I$(MOTIF_DIR)/include \
-I$(OPENWIN_HOME)/include
LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB)
else
LDFLAGS += -framework Accelerate \
-framework ApplicationServices \
-framework Cocoa \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport
endif # !HEADLESS
endif # PLATFORM
...
...
makefiles/CompileNativeLibraries.gmk
浏览文件 @
0a7906e1
...
...
@@ -2314,6 +2314,10 @@ LIBAWT_HEADLESS_DIRS:=$(JDK_TOPDIR)/src/share/native/sun/font \
$(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
$(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11
ifeq ($(OPENJDK_TARGET_OS),macosx)
LIBAWT_HEADLESS_DIRS+=$(JDK_TOPDIR)/src/macosx/native/sun/font
endif
LIBAWT_HEADLESS_CFLAGS:=-DHEADLESS=true \
-DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
$(CUPS_CFLAGS) \
...
...
@@ -2328,6 +2332,12 @@ LIBAWT_HEADLESS_CFLAGS:=-DHEADLESS=true \
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
$(foreach dir,$(LIBAWT_HEADLESS_DIRS),-I$(dir))
ifeq ($(OPENJDK_TARGET_OS),macosx)
LIBAWT_HEADLESS_CFLAGS+=\
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
endif
LIBAWT_HEADLESS_FILES:=\
awt_Font.c \
HeadlessToolkit.c \
...
...
@@ -2356,6 +2366,16 @@ LIBAWT_HEADLESS_FILES:=\
AccelGlyphCache.c \
CUPSfuncs.c
ifeq ($(OPENJDK_TARGET_OS),macosx)
LIBAWT_HEADLESS_FILES+=\
AWTFont.m \
AWTStrike.m \
CCharToGlyphMapper.m \
CGGlyphImages.m \
CGGlyphOutlines.m \
CoreTextSupport.m
endif
LIBAWT_HEADLESS_REORDER:=
ifeq ($(OPENJDK_TARGET_OS), solaris)
ifneq ($(OPENJDK_TARGET_CPU), x86_64)
...
...
@@ -2382,7 +2402,13 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS,\
REORDER:=$(LIBAWT_HEADLESS_REORDER), \
LDFLAGS_SUFFIX_linux:=-ljvm -lawt -lm $(LIBDL) -ljava,\
LDFLAGS_SUFFIX_solaris:=$(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc,\
LDFLAGS_SUFFIX_macosx:=-ljvm $(LIBCXX) -lawt $(LIBDL) -ljava,\
LDFLAGS_SUFFIX_macosx:=-ljvm $(LIBCXX) -lawt $(LIBDL) -ljava \
-framework Accelerate \
-framework ApplicationServices \
-framework Cocoa \
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport,\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_headless,\
DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
...
...
src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
浏览文件 @
0a7906e1
...
...
@@ -36,6 +36,7 @@ import java.security.PrivilegedAction;
import
javax.print.*
;
import
javax.print.attribute.PrintRequestAttributeSet
;
import
javax.print.attribute.HashPrintRequestAttributeSet
;
import
javax.print.attribute.standard.PageRanges
;
import
sun.java2d.*
;
import
sun.print.*
;
...
...
@@ -173,6 +174,19 @@ public class CPrinterJob extends RasterPrinterJob {
if
(
nsPrintInfo
!=
null
)
{
fNSPrintInfo
=
nsPrintInfo
.
getValue
();
}
PageRanges
pageRangesAttr
=
(
PageRanges
)
attributes
.
get
(
PageRanges
.
class
);
if
(
isSupportedValue
(
pageRangesAttr
,
attributes
))
{
SunPageSelection
rangeSelect
=
(
SunPageSelection
)
attributes
.
get
(
SunPageSelection
.
class
);
// If rangeSelect is not null, we are using AWT's print dialog that has
// All, Selection, and Range radio buttons
if
(
rangeSelect
==
null
||
rangeSelect
==
SunPageSelection
.
RANGE
)
{
int
[][]
range
=
pageRangesAttr
.
getMembers
();
// setPageRange will set firstPage and lastPage as called in getFirstPage
// and getLastPage
setPageRange
(
range
[
0
][
0
]
-
1
,
range
[
0
][
1
]
-
1
);
}
}
}
volatile
boolean
onEventThread
;
...
...
@@ -225,7 +239,6 @@ public class CPrinterJob extends RasterPrinterJob {
* the end of the document. Note that firstPage
* and lastPage are 0 based page indices.
*/
int
numPages
=
mDocument
.
getNumberOfPages
();
int
firstPage
=
getFirstPage
();
int
lastPage
=
getLastPage
();
...
...
@@ -242,42 +255,53 @@ public class CPrinterJob extends RasterPrinterJob {
userCancelled
=
false
;
}
if
(
EventQueue
.
isDispatchThread
())
{
// This is an AWT EventQueue, and this print rendering loop needs to block it.
//Add support for PageRange
PageRanges
pr
=
(
attributes
==
null
)
?
null
:
(
PageRanges
)
attributes
.
get
(
PageRanges
.
class
);
int
[][]
prMembers
=
(
pr
==
null
)
?
new
int
[
0
][
0
]
:
pr
.
getMembers
();
int
loopi
=
0
;
do
{
if
(
EventQueue
.
isDispatchThread
())
{
// This is an AWT EventQueue, and this print rendering loop needs to block it.
onEventThread
=
true
;
printingLoop
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
SecondaryLoop
>()
{
@Override
public
SecondaryLoop
run
()
{
return
Toolkit
.
getDefaultToolkit
()
.
getSystemEventQueue
()
.
createSecondaryLoop
();
}
});
onEventThread
=
true
;
printingLoop
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
SecondaryLoop
>()
{
@Override
public
SecondaryLoop
run
()
{
return
Toolkit
.
getDefaultToolkit
()
.
getSystemEventQueue
()
.
createSecondaryLoop
();
try
{
// Fire off the print rendering loop on the AppKit thread, and don't have
// it wait and block this thread.
if
(
printLoop
(
false
,
firstPage
,
lastPage
))
{
// Start a secondary loop on EDT until printing operation is finished or cancelled
printingLoop
.
enter
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
});
}
else
{
// Fire off the print rendering loop on the AppKit, and block this thread
// until it is done.
// But don't actually block... we need to come back here!
onEventThread
=
false
;
try
{
// Fire off the print rendering loop on the AppKit thread, and don't have
// it wait and block this thread.
if
(
printLoop
(
false
,
firstPage
,
lastPage
))
{
// Start a secondary loop on EDT until printing operation is finished or cancelled
printingLoop
.
enter
();
try
{
printLoop
(
true
,
firstPage
,
lastPage
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
// Fire off the print rendering loop on the AppKit, and block this thread
// until it is done.
// But don't actually block... we need to come back here!
onEventThread
=
false
;
try
{
printLoop
(
true
,
firstPage
,
lastPage
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
if
(++
loopi
<
prMembers
.
length
)
{
firstPage
=
prMembers
[
loopi
][
0
]-
1
;
lastPage
=
prMembers
[
loopi
][
1
]
-
1
;
}
}
}
while
(
loopi
<
prMembers
.
length
);
}
finally
{
synchronized
(
this
)
{
// NOTE: Native code shouldn't allow exceptions out while
...
...
src/macosx/native/sun/font/AWTFont.m
浏览文件 @
0a7906e1
...
...
@@ -395,6 +395,7 @@ JNF_COCOA_EXIT(env);
#pragma mark --- Miscellaneous JNI ---
#ifndef HEADLESS
/*
* Class: sun_awt_PlatformFont
* Method: initIDs
...
...
@@ -416,3 +417,4 @@ Java_sun_awt_FontDescriptor_initIDs
(
JNIEnv
*
env
,
jclass
cls
)
{
}
#endif
src/share/native/sun/java2d/cmm/lcms/cmscgats.c
浏览文件 @
0a7906e1
...
...
@@ -634,6 +634,8 @@ cmsFloat64Number ParseFloatNumber(const char *Buffer)
cmsFloat64Number
dnum
=
0
.
0
;
int
sign
=
1
;
if
(
Buffer
==
NULL
)
return
0
.
0
;
if
(
*
Buffer
==
'-'
||
*
Buffer
==
'+'
)
{
sign
=
(
*
Buffer
==
'-'
)
?
-
1
:
1
;
...
...
src/share/native/sun/java2d/cmm/lcms/cmslut.c
浏览文件 @
0a7906e1
...
...
@@ -1021,6 +1021,8 @@ cmsStage* _cmsStageAllocLabV2ToV4curves(cmsContext ContextID)
mpe
=
cmsStageAllocToneCurves
(
ContextID
,
3
,
LabTable
);
cmsFreeToneCurveTriple
(
LabTable
);
if
(
mpe
==
NULL
)
return
NULL
;
mpe
->
Implements
=
cmsSigLabV2toV4
;
return
mpe
;
}
...
...
src/solaris/classes/sun/print/IPPPrintService.java
浏览文件 @
0a7906e1
...
...
@@ -1023,6 +1023,13 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
// this is already supported in UnixPrintJob
catList
.
add
(
Destination
.
class
);
// It is unfortunate that CUPS doesn't provide a way to query
// if printer supports collation but since most printers
// now supports collation and that most OS has a way
// of setting it, it is a safe assumption to just always
// include SheetCollate as supported attribute.
catList
.
add
(
SheetCollate
.
class
);
}
// With the assumption that Chromaticity is equivalent to
...
...
src/windows/classes/sun/awt/windows/WPathGraphics.java
浏览文件 @
0a7906e1
...
...
@@ -549,6 +549,8 @@ class WPathGraphics extends PathGraphics {
userx
+=
xAdvance
;
userpos
.
x
+=
xAdvance
;
deviceTransform
.
transform
(
userpos
,
devpos
);
devx
=
devpos
.
x
;
devy
=
devpos
.
y
;
}
}
else
{
super
.
drawString
(
str
,
x
,
y
,
font
,
frc
,
targetW
);
...
...
test/java/awt/print/PrinterJob/Collate2DPrintingTest.java
浏览文件 @
0a7906e1
...
...
@@ -23,7 +23,7 @@
/**
* @test
* @bug 6362683
* @bug 6362683
8012381
* @summary Collation should work.
* @run main/manual Collate2DPrintingTest
*/
...
...
test/java/awt/print/PrinterJob/PrintLatinCJKTest.java
0 → 100644
浏览文件 @
0a7906e1
/*
* Copyright (c) 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.
*
* 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 800535
* @summary JDK7 Printing: CJK and Latin Text in string overlap
* @run main/manual=yesno PrintLatinCJKTest
*/
import
java.awt.Font
;
import
java.awt.Graphics
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.awt.print.PageFormat
;
import
java.awt.print.Pageable
;
import
java.awt.print.Printable
;
import
java.awt.print.PrinterException
;
import
java.awt.print.PrinterJob
;
import
javax.swing.JButton
;
import
javax.swing.JFrame
;
import
javax.swing.JTextArea
;
import
javax.swing.SwingUtilities
;
public
class
PrintLatinCJKTest
implements
Printable
,
ActionListener
{
static
PrintLatinCJKTest
testInstance
=
new
PrintLatinCJKTest
();
private
PageFormat
pf
;
static
String
info
=
"You need a printer for this test. If you have none, let "
+
"the test pass. If there is a printer, press Print, send "
+
"the output to the printer, and examine it. It should have "
+
"text looking like this : \u4e00\u4e01\u4e02\u4e03\u4e04English."
;
public
static
void
showFrame
()
{
JFrame
f
=
new
JFrame
();
JTextArea
jta
=
new
JTextArea
(
info
,
4
,
30
);
jta
.
setLineWrap
(
true
);
jta
.
setWrapStyleWord
(
true
);
f
.
add
(
"Center"
,
jta
);
JButton
b
=
new
JButton
(
"Print"
);
b
.
addActionListener
(
testInstance
);
f
.
add
(
"South"
,
b
);
f
.
pack
();
f
.
setVisible
(
true
);
}
public
int
print
(
Graphics
g
,
PageFormat
pf
,
int
pageIndex
)
throws
PrinterException
{
if
(
pageIndex
>
0
)
{
return
Printable
.
NO_SUCH_PAGE
;
}
g
.
translate
((
int
)
pf
.
getImageableX
(),
(
int
)
pf
.
getImageableY
());
g
.
setFont
(
new
Font
(
"Dialog"
,
Font
.
PLAIN
,
36
));
g
.
drawString
(
"\u4e00\u4e01\u4e02\u4e03\u4e04English"
,
20
,
100
);
return
Printable
.
PAGE_EXISTS
;
}
public
void
actionPerformed
(
ActionEvent
e
)
{
try
{
PrinterJob
job
=
PrinterJob
.
getPrinterJob
();
job
.
setPrintable
(
testInstance
);
if
(
job
.
printDialog
())
{
job
.
print
();
}
}
catch
(
PrinterException
ex
)
{
ex
.
printStackTrace
();
}
}
public
static
void
main
(
String
[]
args
)
{
SwingUtilities
.
invokeLater
(
new
Runnable
()
{
@Override
public
void
run
()
{
showFrame
();
}
});
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录