Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
b12f32c4
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b12f32c4
编写于
10月 10, 2012
作者:
G
Gerd Hoffmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pixman: switch screendump function.
Signed-off-by:
N
Gerd Hoffmann
<
kraxel@redhat.com
>
上级
1fd2510a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
28 deletion
+11
-28
hw/vga.c
hw/vga.c
+11
-28
未找到文件。
hw/vga.c
浏览文件 @
b12f32c4
...
...
@@ -2393,13 +2393,12 @@ void vga_init_vbe(VGACommonState *s, MemoryRegion *system_memory)
void
ppm_save
(
const
char
*
filename
,
struct
DisplaySurface
*
ds
,
Error
**
errp
)
{
int
width
=
pixman_image_get_width
(
ds
->
image
);
int
height
=
pixman_image_get_height
(
ds
->
image
);
FILE
*
f
;
uint8_t
*
d
,
*
d1
;
uint32_t
v
;
int
y
,
x
;
uint8_t
r
,
g
,
b
;
int
y
;
int
ret
;
char
*
linebuf
,
*
p
buf
;
pixman_image_t
*
line
buf
;
trace_ppm_save
(
filename
,
ds
);
f
=
fopen
(
filename
,
"wb"
);
...
...
@@ -2408,33 +2407,17 @@ void ppm_save(const char *filename, struct DisplaySurface *ds, Error **errp)
strerror
(
errno
));
return
;
}
ret
=
fprintf
(
f
,
"P6
\n
%d %d
\n
%d
\n
"
,
ds
->
width
,
ds
->
height
,
255
);
ret
=
fprintf
(
f
,
"P6
\n
%d %d
\n
%d
\n
"
,
width
,
height
,
255
);
if
(
ret
<
0
)
{
linebuf
=
NULL
;
goto
write_err
;
}
linebuf
=
g_malloc
(
ds
->
width
*
3
);
d1
=
ds
->
data
;
for
(
y
=
0
;
y
<
ds
->
height
;
y
++
)
{
d
=
d1
;
pbuf
=
linebuf
;
for
(
x
=
0
;
x
<
ds
->
width
;
x
++
)
{
if
(
ds
->
pf
.
bits_per_pixel
==
32
)
v
=
*
(
uint32_t
*
)
d
;
else
v
=
(
uint32_t
)
(
*
(
uint16_t
*
)
d
);
/* Limited to 8 or fewer bits per channel: */
r
=
((
v
>>
ds
->
pf
.
rshift
)
&
ds
->
pf
.
rmax
)
<<
(
8
-
ds
->
pf
.
rbits
);
g
=
((
v
>>
ds
->
pf
.
gshift
)
&
ds
->
pf
.
gmax
)
<<
(
8
-
ds
->
pf
.
gbits
);
b
=
((
v
>>
ds
->
pf
.
bshift
)
&
ds
->
pf
.
bmax
)
<<
(
8
-
ds
->
pf
.
bbits
);
*
pbuf
++
=
r
;
*
pbuf
++
=
g
;
*
pbuf
++
=
b
;
d
+=
ds
->
pf
.
bytes_per_pixel
;
}
d1
+=
ds
->
linesize
;
linebuf
=
qemu_pixman_linebuf_create
(
PIXMAN_BE_r8g8b8
,
width
);
for
(
y
=
0
;
y
<
height
;
y
++
)
{
qemu_pixman_linebuf_fill
(
linebuf
,
ds
->
image
,
width
,
y
);
clearerr
(
f
);
ret
=
fwrite
(
linebuf
,
1
,
pbuf
-
linebuf
,
f
);
ret
=
fwrite
(
pixman_image_get_data
(
linebuf
),
1
,
pixman_image_get_stride
(
linebuf
),
f
);
(
void
)
ret
;
if
(
ferror
(
f
))
{
goto
write_err
;
...
...
@@ -2442,7 +2425,7 @@ void ppm_save(const char *filename, struct DisplaySurface *ds, Error **errp)
}
out:
g_free
(
linebuf
);
qemu_pixman_image_unref
(
linebuf
);
fclose
(
f
);
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录