Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
26908af8
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看板
提交
26908af8
编写于
3月 30, 2017
作者:
P
psadhukhan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8176287: [macosx] The print test crashed with Nimbus L&F
Reviewed-by: serb, prr
上级
7cc383f4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
43 deletion
+14
-43
src/macosx/native/sun/awt/QuartzSurfaceData.m
src/macosx/native/sun/awt/QuartzSurfaceData.m
+14
-43
未找到文件。
src/macosx/native/sun/awt/QuartzSurfaceData.m
浏览文件 @
26908af8
...
@@ -72,7 +72,7 @@ static pthread_mutex_t gColorCacheLock = PTHREAD_MUTEX_INITIALIZER;
...
@@ -72,7 +72,7 @@ static pthread_mutex_t gColorCacheLock = PTHREAD_MUTEX_INITIALIZER;
//
given
a
UInt32
color
,
it
tries
to
find
that
find
the
corresponding
CGColorRef
in
the
hash
cache
.
If
the
CGColorRef
//
given
a
UInt32
color
,
it
tries
to
find
that
find
the
corresponding
CGColorRef
in
the
hash
cache
.
If
the
CGColorRef
//
doesn
'
t
exist
or
there
is
a
collision
,
it
creates
a
new
one
CGColorRef
and
put
'
s
in
the
cache
.
Then
,
//
doesn
'
t
exist
or
there
is
a
collision
,
it
creates
a
new
one
CGColorRef
and
put
'
s
in
the
cache
.
Then
,
//
it
sets
with
current
fill
/
stroke
color
for
the
the
CGContext
passed
in
(
qsdo
->
cgRef
)
.
//
it
sets
with
current
fill
/
stroke
color
for
the
CGContext
passed
in
(
qsdo
->
cgRef
)
.
void
setCachedColor
(
QuartzSDOps
*
qsdo
,
UInt32
color
)
void
setCachedColor
(
QuartzSDOps
*
qsdo
,
UInt32
color
)
{
{
static
const
CGFloat
kColorConversionMultiplier
=
1.0
f
/
255.0
f
;
static
const
CGFloat
kColorConversionMultiplier
=
1.0
f
/
255.0
f
;
...
@@ -286,26 +286,19 @@ PRINT(" contextQuartzLinearGradientPath");
...
@@ -286,26 +286,19 @@ PRINT(" contextQuartzLinearGradientPath");
for
(
i
=
0
;
i
<
num
_
locations
;
i
++
)
{
for
(
i
=
0
;
i
<
num
_
locations
;
i
++
)
{
locations
[
i
]
=
gradientInfo
->
fractionsdata
[
i
]
;
locations
[
i
]
=
gradientInfo
->
fractionsdata
[
i
]
;
//
fprintf
(
stderr
,
"locations[%d] %f\n"
,
i
,
locations
[
i
])
;
}
}
for
(
i
=
0
;
i
<
component
_
size
;
i
++
)
{
for
(
i
=
0
;
i
<
component
_
size
;
i
++
)
{
components
[
i
]
=
gradientInfo
->
colordata
[
i
]
;
components
[
i
]
=
gradientInfo
->
colordata
[
i
]
;
//
fprintf
(
stderr
,
"components[%d] %f, gradientInfo->colordata[%d] %f\n"
,
//
i
,
components
[
i
]
,
i
,
gradientInfo
->
colordata
[
i
])
;
}
}
CGContextSaveGState
(
cgRef
)
;
CGContextSaveGState
(
cgRef
)
;
gradient
=
CGGradientCreateWithColorComponents
(
colorspace
,
components
,
locations
,
num
_
locations
)
;
gradient
=
CGGradientCreateWithColorComponents
(
colorspace
,
components
,
locations
,
num
_
locations
)
;
//
fprintf
(
stderr
,
"gradientInfo->start.x %f, gradientInfo->start.y %f\n"
,
//
gradientInfo
->
start
.
x
,
gradientInfo
->
start
.
y
)
;
//
fprintf
(
stderr
,
"gradientInfo->end.x %f, gradientInfo->end.y %f\n"
,
//
gradientInfo
->
end
.
x
,
gradientInfo
->
end
.
y
)
;
if
(
qsdo
->
isEvenOddFill
)
{
if
(
qsdo
->
isEvenOddFill
)
{
CGContextEOClip
(
cgRef
)
;
CGContextEOClip
(
cgRef
)
;
}
else
{
}
else
{
CGContextClip
(
cgRef
)
;
CGContextClip
(
cgRef
)
;
}
}
CGContextDrawLinearGradient
(
cgRef
,
gradient
,
gradientInfo
->
start
,
gradientInfo
->
end
,
kCGGradientDrawsAfterEndLocation
)
;
CGContextDrawLinearGradient
(
cgRef
,
gradient
,
gradientInfo
->
start
,
gradientInfo
->
end
,
kCGGradientDrawsAfterEndLocation
)
;
CGContextRestoreGState
(
cgRef
)
;
CGContextRestoreGState
(
cgRef
)
;
CGColorSpaceRelease
(
colorspace
)
;
CGColorSpaceRelease
(
colorspace
)
;
CGGradientRelease
(
gradient
)
;
CGGradientRelease
(
gradient
)
;
...
@@ -334,25 +327,17 @@ PRINT(" contextQuartzRadialGradientPath");
...
@@ -334,25 +327,17 @@ PRINT(" contextQuartzRadialGradientPath");
for
(
i
=
0
;
i
<
num
_
locations
;
i
++
)
{
for
(
i
=
0
;
i
<
num
_
locations
;
i
++
)
{
locations
[
i
]
=
gradientInfo
->
fractionsdata
[
i
]
;
locations
[
i
]
=
gradientInfo
->
fractionsdata
[
i
]
;
//
fprintf
(
stderr
,
"locations[%d] %f\n"
,
i
,
locations
[
i
])
;
}
}
for
(
i
=
0
;
i
<
component
_
size
;
i
++
)
{
for
(
i
=
0
;
i
<
component
_
size
;
i
++
)
{
components
[
i
]
=
gradientInfo
->
colordata
[
i
]
;
components
[
i
]
=
gradientInfo
->
colordata
[
i
]
;
//
fprintf
(
stderr
,
"components[%d] %f, gradientInfo->colordata[%d] %f\n"
,
//
i
,
components
[
i
]
,
i
,
gradientInfo
->
colordata
[
i
])
;
}
}
CGContextSaveGState
(
cgRef
)
;
CGContextSaveGState
(
cgRef
)
;
gradient
=
CGGradientCreateWithColorComponents
(
colorspace
,
components
,
locations
,
num
_
locations
)
;
gradient
=
CGGradientCreateWithColorComponents
(
colorspace
,
components
,
locations
,
num
_
locations
)
;
//
fprintf
(
stderr
,
"gradientInfo->start.x %f, gradientInfo->start.y %f\n"
,
//
gradientInfo
->
start
.
x
,
gradientInfo
->
start
.
y
)
;
//
fprintf
(
stderr
,
"gradientInfo->end.x %f, gradientInfo->end.y %f\n"
,
//
gradientInfo
->
end
.
x
,
gradientInfo
->
end
.
y
)
;
if
(
qsdo
->
isEvenOddFill
)
{
if
(
qsdo
->
isEvenOddFill
)
{
CGContextEOClip
(
cgRef
)
;
CGContextEOClip
(
cgRef
)
;
}
else
{
}
else
{
CGContextClip
(
cgRef
)
;
CGContextClip
(
cgRef
)
;
}
}
//
fprintf
(
stderr
,
"gradientInfo->startRadius %f, gradientInfo->endRadius %f\n"
,
startRadius
,
endRadius
)
;
CGContextDrawRadialGradient
(
cgRef
,
gradient
,
gradientInfo
->
start
,
0
,
gradientInfo
->
end
,
endRadius
,
kCGGradientDrawsAfterEndLocation
)
;
CGContextDrawRadialGradient
(
cgRef
,
gradient
,
gradientInfo
->
start
,
0
,
gradientInfo
->
end
,
endRadius
,
kCGGradientDrawsAfterEndLocation
)
;
CGContextRestoreGState
(
cgRef
)
;
CGContextRestoreGState
(
cgRef
)
;
...
@@ -944,55 +929,41 @@ void setupGradient(JNIEnv *env, QuartzSDOps* qsdo, jfloat* javaFloatGraphicsStat
...
@@ -944,55 +929,41 @@ void setupGradient(JNIEnv *env, QuartzSDOps* qsdo, jfloat* javaFloatGraphicsStat
if (colorArray != NULL)
if (colorArray != NULL)
{
{
jint length = (*env)->GetArrayLength(env, colorArray);
jint length = (*env)->GetArrayLength(env, colorArray);
//fprintf(stderr, "length %d\n", length);
jint* jcolorData = (jint*)(*env)->GetPrimitiveArrayCritical(env, colorArray, NULL);
jint* jcolorData = (jint*)(*env)->GetPrimitiveArrayCritical(env, colorArray, NULL);
CGFloat* colors= (CGFloat*)calloc(0, sizeof(CGFloat)
*length);
qsdo->gradientInfo->colordata = (CGFloat*)malloc(sizeof(CGFloat)*4
*length);
int i = 0
;
memset(qsdo->gradientInfo->colordata, 0, sizeof(CGFloat)*4*length)
;
if (jcolorData != NULL)
if (jcolorData != NULL)
{
{
jint ival
;
int i
;
for (i
val=0; ival<length; ival
++)
for (i
=0; i<length; i
++)
{
{
colors[ival] = (CGFloat)jcolorData[ival];
qsdo->gradientInfo->colordata[i*4] = ((jcolorData[i]>>16)&0xff)*kColorConversionMultiplier;
}
}
(*env)->ReleasePrimitiveArrayCritical(env, colorArray, jcolorData, 0);
qsdo->gradientInfo->colordata = (CGFloat*)calloc(0, sizeof(CGFloat)*4*length);
for (i = 0; i < length; i++)
{
jint c1 = colors[i];
//fprintf(stderr, "c1 %x\n", c1);
qsdo->gradientInfo->colordata[i*4] = ((c1>>16)&0xff)*kColorConversionMultiplier;
//fprintf(stderr, "qsdo->gradientInfo->colordata[%d] %f\n", i*4, qsdo->gradientInfo->colordata[i*4]);
qsdo->gradientInfo->colordata[i*4+1] = ((c1>>8)&0xff)*kColorConversionMultiplier;
qsdo->gradientInfo->colordata[i*4+1] = ((jcolorData[i]>>8)&0xff)*kColorConversionMultiplier;
//fprintf(stderr, "qsdo->gradientInfo->colordata[%d] %f\n", i*4+1, qsdo->gradientInfo->colordata[i*4+1]);
qsdo->gradientInfo->colordata[i*4+2] = ((c1>>0)&0xff)*kColorConversionMultiplier;
qsdo->gradientInfo->colordata[i*4+2] = ((jcolorData[i]>>0)&0xff)*kColorConversionMultiplier;
//fprintf(stderr, "qsdo->gradientInfo->colordata[%d] %f\n", i*4+2, qsdo->gradientInfo->colordata[i*4+2]);
qsdo->gradientInfo->colordata[i*4+3] = ((c1
>>24)&0xff)*kColorConversionMultiplier;
qsdo->gradientInfo->colordata[i*4+3] = ((jcolorData[i]
>>24)&0xff)*kColorConversionMultiplier;
//fprintf(stderr, "qsdo->gradientInfo->colordata[%d] %f\n", i*4+3, qsdo->gradientInfo->colordata[i*4+3]);
}
}
}
free(colors
);
(*env)->ReleasePrimitiveArrayCritical(env, colorArray, jcolorData, 0
);
}
}
jobject fractionsArray = ((*env)->GetObjectArrayElement(env, qsdo->javaGraphicsStatesObjects, sun_java2d_OSXSurfaceData_kFractionsArrayIndex));
jobject fractionsArray = ((*env)->GetObjectArrayElement(env, qsdo->javaGraphicsStatesObjects, sun_java2d_OSXSurfaceData_kFractionsArrayIndex));
if (fractionsArray != NULL)
if (fractionsArray != NULL)
{
{
jint length = (*env)->GetArrayLength(env, fractionsArray);
jint length = (*env)->GetArrayLength(env, fractionsArray);
//fprintf(stderr, "fractions length %d\n", length);
qsdo->gradientInfo->fractionsLength = length;
qsdo->gradientInfo->fractionsLength = length;
jfloat* jfractionsData = (jfloat*)(*env)->GetPrimitiveArrayCritical(env, fractionsArray, NULL);
jfloat* jfractionsData = (jfloat*)(*env)->GetPrimitiveArrayCritical(env, fractionsArray, NULL);
if (jfractionsData != NULL)
if (jfractionsData != NULL)
{
{
int i;
qsdo->gradientInfo->fractionsdata = (CGFloat *)malloc(sizeof(CGFloat) *length);
qsdo->gradientInfo->fractionsdata = (CGFloat *)malloc(sizeof(CGFloat) *length);
jint i
;
memset(qsdo->gradientInfo->fractionsdata, 0, sizeof(CGFloat)*length)
;
for (i=0; i<length; i++)
for (i=0; i<length; i++)
{
{
qsdo->gradientInfo->fractionsdata[i] = jfractionsData[i];
qsdo->gradientInfo->fractionsdata[i] = jfractionsData[i];
//fprintf(stderr, "jfrationsData[%d] %f, qsdo->gradientInfo->fractionsdata[%d] = %f\n", i, jfractionsData[i], i, qsdo->gradientInfo->fractionsdata[i]);
}
}
(*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, jfractionsData, 0);
(*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, jfractionsData, 0);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录