Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
70ccae4f
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看板
提交
70ccae4f
编写于
1月 31, 2017
作者:
D
dmarkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8163889: [macosx] Can't print from browser on Mac OS X
Reviewed-by: prr, psadhukhan
上级
54ede258
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
89 addition
and
9 deletion
+89
-9
src/macosx/classes/sun/java2d/OSXOffScreenSurfaceData.java
src/macosx/classes/sun/java2d/OSXOffScreenSurfaceData.java
+8
-1
src/macosx/native/sun/awt/ImageSurfaceData.m
src/macosx/native/sun/awt/ImageSurfaceData.m
+4
-8
test/java/awt/print/PrinterJob/PrintCrashTest.java
test/java/awt/print/PrinterJob/PrintCrashTest.java
+77
-0
未找到文件。
src/macosx/classes/sun/java2d/OSXOffScreenSurfaceData.java
浏览文件 @
70ccae4f
/*
* Copyright (c) 2011, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 201
7
, 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
...
...
@@ -607,6 +607,13 @@ public class OSXOffScreenSurfaceData extends OSXSurfaceData // implements Raster
fImageInfoInt
.
put
(
kNeedToSyncFromJavaPixelsIndex
,
1
);
// the pixels will change
}
private
void
syncFromCustom
()
{
}
private
void
syncToCustom
()
{
}
// /**
// * Invoked when the raster's contents will be taken (via the Raster.getDataBuffer() method)
// */
...
...
src/macosx/native/sun/awt/ImageSurfaceData.m
浏览文件 @
70ccae4f
...
...
@@ -34,9 +34,6 @@
#import
<
JavaNativeFoundation
/
JavaNativeFoundation
.
h
>
#import
"BufImgSurfaceData.h"
#import
"ThreadUtilities.h"
//
#define
DEBUG
1
#if
defined
DEBUG
...
...
@@ -195,10 +192,9 @@ IMAGE_SURFACE_INLINE void customPixelsFromJava(JNIEnv *env, ImageSDOps *isdo)
PRINT
(
" customPixelsFromJava"
)
SurfaceDataOps
*
sdo
=
(
SurfaceDataOps
*
)
isdo
;
JNFCallVoidMethod
(
[
ThreadUtilities
getJNIEnv
]
,
sdo
->
sdObject
,
jm
_
syncFromCustom
)
;
//
AWT
_
THREADING
Safe
(
known
object
)
JNFCallVoidMethod
(
env
,
sdo
->
sdObject
,
jm
_
syncFromCustom
)
;
//
AWT
_
THREADING
Safe
(
known
object
)
}
IMAGE
_
SURFACE
_
INLINE
void
copyBits
(
jint
w
,
jint
h
,
jint
javaPixelsBytesPerRow
,
Pixel8bit
*
pixelsSrc
,
jint
dstPixelsBytesPerRow
,
Pixel8bit
*
pixelsDst
)
{
PRINT
(
" copyBits"
)
...
...
@@ -427,7 +423,7 @@ IMAGE_SURFACE_INLINE void customPixelsToJava(JNIEnv *env, ImageSDOps *isdo)
PRINT
(
" customPixelsToJava"
)
SurfaceDataOps
*
sdo
=
(
SurfaceDataOps
*
)
isdo
;
JNFCallVoidMethod
(
[
ThreadUtilities
getJNIEnv
]
,
sdo
->
sdObject
,
jm
_
syncToCustom
)
;
//
AWT
_
THREADING
Safe
(
known
object
)
JNFCallVoidMethod
(
env
,
sdo
->
sdObject
,
jm
_
syncToCustom
)
;
//
AWT
_
THREADING
Safe
(
known
object
)
}
IMAGE
_
SURFACE
_
INLINE
void
removeAlphaPre
_
32
bit
(
jint
w
,
jint
h
,
jint
javaPixelsBytesPerRow
,
jint
javaPixelBytes
,
Pixel32bit
*
pixelsSrc
)
...
...
@@ -995,9 +991,9 @@ static void imageDataProvider_UnholdJavaPixels(void *info, const void *data, siz
{
PRINT("imageDataProvider_UnholdJavaPixels")
ImageSDOps* isdo = (ImageSDOps*)info;
unholdJavaPixels([ThreadUtilities getJNIEnv], isdo);
// Currently do nothing
}
static void imageDataProvider_FreeTempPixels(void *info, const void *data, size_t size)
{
PRINT("imageDataProvider_FreeTempPixels")
...
...
test/java/awt/print/PrinterJob/PrintCrashTest.java
0 → 100644
浏览文件 @
70ccae4f
/*
* Copyright (c) 2017, 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 8163889
* @summary Printing crashes on OSX.
* @run main PrintCrashTest
*/
import
javax.print.attribute.HashPrintRequestAttributeSet
;
import
javax.print.attribute.standard.Destination
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.Rectangle
;
import
java.awt.Shape
;
import
java.awt.Transparency
;
import
java.awt.image.BufferedImage
;
import
java.awt.print.Printable
;
import
java.awt.print.PrinterJob
;
import
java.io.File
;
public
class
PrintCrashTest
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
PrinterJob
printerJob
=
PrinterJob
.
getPrinterJob
();
printerJob
.
setPrintable
((
graphics
,
pageFormat
,
pageIndex
)
->
{
if
(
pageIndex
!=
0
)
{
return
Printable
.
NO_SUCH_PAGE
;
}
else
{
Shape
shape
=
new
Rectangle
(
110
,
110
,
10
,
10
);
Rectangle
rect
=
shape
.
getBounds
();
BufferedImage
image
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
().
getDefaultScreenDevice
()
.
getDefaultConfiguration
().
createCompatibleImage
(
rect
.
width
,
rect
.
height
,
Transparency
.
BITMASK
);
graphics
.
drawImage
(
image
,
rect
.
x
,
rect
.
y
,
rect
.
width
,
rect
.
height
,
null
);
return
Printable
.
PAGE_EXISTS
;
}
});
File
file
=
null
;
try
{
HashPrintRequestAttributeSet
hashPrintRequestAttributeSet
=
new
HashPrintRequestAttributeSet
();
file
=
File
.
createTempFile
(
"out"
,
"ps"
);
file
.
deleteOnExit
();
Destination
destination
=
new
Destination
(
file
.
toURI
());
hashPrintRequestAttributeSet
.
add
(
destination
);
printerJob
.
print
(
hashPrintRequestAttributeSet
);
}
finally
{
if
(
file
!=
null
)
{
file
.
delete
();
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录