Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
dd8922f2
Commit
dd8922f2
authored
Aug 12, 2004
by
Huw Davies
Committed by
Alexandre Julliard
Aug 12, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repect the width of both the src and dst when calculating how many
pixels to copy in a dib <-> bmp operation.
parent
b4620226
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
12 deletions
+23
-12
dib.c
dlls/gdi/dib.c
+23
-12
dib.c
dlls/x11drv/dib.c
+0
-0
No files found.
dlls/gdi/dib.c
View file @
dd8922f2
...
...
@@ -522,9 +522,10 @@ INT WINAPI GetDIBits(
{
/*FIXME: Only RGB dibs supported for now */
unsigned
int
srcwidth
=
bmp
->
dib
->
dsBm
.
bmWidth
,
srcwidthb
=
bmp
->
dib
->
dsBm
.
bmWidthBytes
;
unsigned
int
dstwidth
=
info
->
bmiHeader
.
biWidth
;
int
dstwidthb
=
DIB_GetDIBWidthBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biBitCount
);
LPBYTE
dbits
=
bits
,
sbits
=
(
LPBYTE
)
bmp
->
dib
->
dsBm
.
bmBits
+
(
startscan
*
srcwidthb
);
unsigned
int
x
,
y
;
unsigned
int
x
,
y
,
width
,
widthb
;
if
((
info
->
bmiHeader
.
biHeight
<
0
)
^
(
bmp
->
dib
->
dsBmih
.
biHeight
<
0
))
{
...
...
@@ -546,9 +547,10 @@ INT WINAPI GetDIBits(
case
16
:
/* 16 bpp srcDIB -> 16 bpp dstDIB */
{
widthb
=
min
(
srcwidthb
,
abs
(
dstwidthb
));
/* FIXME: BI_BITFIELDS not supported yet */
for
(
y
=
0
;
y
<
lines
;
y
++
,
dbits
+=
dstwidthb
,
sbits
+=
srcwidthb
)
memcpy
(
dbits
,
sbits
,
src
widthb
);
memcpy
(
dbits
,
sbits
,
widthb
);
}
break
;
...
...
@@ -556,8 +558,9 @@ INT WINAPI GetDIBits(
{
LPBYTE
srcbits
=
sbits
;
width
=
min
(
srcwidth
,
dstwidth
);
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
src
width
;
x
++
,
srcbits
+=
3
)
for
(
x
=
0
;
x
<
width
;
x
++
,
srcbits
+=
3
)
*
dstbits
++
=
((
srcbits
[
0
]
>>
3
)
&
bmask
)
|
(((
WORD
)
srcbits
[
1
]
<<
2
)
&
gmask
)
|
(((
WORD
)
srcbits
[
2
]
<<
7
)
&
rmask
);
...
...
@@ -573,8 +576,9 @@ INT WINAPI GetDIBits(
LPDWORD
srcbits
=
(
LPDWORD
)
sbits
;
DWORD
val
;
width
=
min
(
srcwidth
,
dstwidth
);
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
src
width
;
x
++
)
{
for
(
x
=
0
;
x
<
width
;
x
++
)
{
val
=
*
srcbits
++
;
*
dstbits
++
=
(
WORD
)(((
val
>>
3
)
&
bmask
)
|
((
val
>>
6
)
&
gmask
)
|
((
val
>>
9
)
&
rmask
));
...
...
@@ -604,9 +608,10 @@ INT WINAPI GetDIBits(
LPWORD
srcbits
=
(
LPWORD
)
sbits
;
WORD
val
;
width
=
min
(
srcwidth
,
dstwidth
);
/* FIXME: BI_BITFIELDS not supported yet */
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
src
width
;
x
++
)
{
for
(
x
=
0
;
x
<
width
;
x
++
)
{
val
=
*
srcbits
++
;
*
dstbits
++
=
(
BYTE
)(((
val
<<
3
)
&
0xf8
)
|
((
val
>>
2
)
&
0x07
));
*
dstbits
++
=
(
BYTE
)(((
val
>>
2
)
&
0xf8
)
|
((
val
>>
7
)
&
0x07
));
...
...
@@ -620,8 +625,9 @@ INT WINAPI GetDIBits(
case
24
:
/* 24 bpp srcDIB -> 24 bpp dstDIB */
{
widthb
=
min
(
srcwidthb
,
abs
(
dstwidthb
));
for
(
y
=
0
;
y
<
lines
;
y
++
,
dbits
+=
dstwidthb
,
sbits
+=
srcwidthb
)
memcpy
(
dbits
,
sbits
,
src
widthb
);
memcpy
(
dbits
,
sbits
,
widthb
);
}
break
;
...
...
@@ -629,8 +635,9 @@ INT WINAPI GetDIBits(
{
LPBYTE
srcbits
=
(
LPBYTE
)
sbits
;
width
=
min
(
srcwidth
,
dstwidth
);
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
src
width
;
x
++
,
srcbits
++
)
{
for
(
x
=
0
;
x
<
width
;
x
++
,
srcbits
++
)
{
*
dstbits
++
=
*
srcbits
++
;
*
dstbits
++
=
*
srcbits
++
;
*
dstbits
++
=
*
srcbits
++
;
...
...
@@ -661,9 +668,10 @@ INT WINAPI GetDIBits(
LPWORD
srcbits
=
(
LPWORD
)
sbits
;
DWORD
val
;
width
=
min
(
srcwidth
,
dstwidth
);
/* FIXME: BI_BITFIELDS not supported yet */
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
src
width
;
x
++
)
{
for
(
x
=
0
;
x
<
width
;
x
++
)
{
val
=
(
DWORD
)
*
srcbits
++
;
*
dstbits
++
=
((
val
<<
3
)
&
0xf8
)
|
((
val
>>
2
)
&
0x07
)
|
((
val
<<
6
)
&
0xf800
)
|
((
val
<<
1
)
&
0x0700
)
|
...
...
@@ -679,8 +687,9 @@ INT WINAPI GetDIBits(
{
LPBYTE
srcbits
=
sbits
;
width
=
min
(
srcwidth
,
dstwidth
);
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
src
width
;
x
++
,
srcbits
+=
3
)
for
(
x
=
0
;
x
<
width
;
x
++
,
srcbits
+=
3
)
*
dstbits
++
=
((
DWORD
)
*
srcbits
)
&
0x00ffffff
;
dstbits
=
(
LPDWORD
)(
dbits
+=
dstwidthb
);
srcbits
=
(
sbits
+=
srcwidthb
);
...
...
@@ -688,11 +697,13 @@ INT WINAPI GetDIBits(
}
break
;
case
32
:
/* 32 bpp srcDIB ->
16
bpp dstDIB */
case
32
:
/* 32 bpp srcDIB ->
32
bpp dstDIB */
{
widthb
=
min
(
srcwidthb
,
abs
(
dstwidthb
));
/* FIXME: BI_BITFIELDS not supported yet */
for
(
y
=
0
;
y
<
lines
;
y
++
,
dbits
+=
dstwidthb
,
sbits
+=
srcwidthb
)
memcpy
(
dbits
,
sbits
,
srcwidthb
);
for
(
y
=
0
;
y
<
lines
;
y
++
,
dbits
+=
dstwidthb
,
sbits
+=
srcwidthb
)
{
memcpy
(
dbits
,
sbits
,
widthb
);
}
}
break
;
...
...
dlls/x11drv/dib.c
View file @
dd8922f2
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment