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
140eabf3
Commit
140eabf3
authored
Apr 05, 2006
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add tests for GetBitmapBits and GetObject for a DIB section.
Make them pass under Wine.
parent
6c1dfc83
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
17 deletions
+34
-17
bitmap.c
dlls/gdi/bitmap.c
+34
-17
bitmap.c
dlls/gdi/tests/bitmap.c
+0
-0
No files found.
dlls/gdi/bitmap.c
View file @
140eabf3
...
...
@@ -311,10 +311,19 @@ LONG WINAPI GetBitmapBits(
{
DIBSECTION
*
dib
=
bmp
->
dib
;
const
char
*
src
=
dib
->
dsBm
.
bmBits
;
DWORD
max
=
dib
->
dsBm
.
bmWidthBytes
*
dib
->
dsBm
.
bmHeight
;
INT
width_bytes
=
BITMAP_GetWidthBytes
(
dib
->
dsBm
.
bmWidth
,
dib
->
dsBm
.
bmBitsPixel
);
DWORD
max
=
width_bytes
*
bmp
->
bitmap
.
bmHeight
;
if
(
!
bits
)
{
ret
=
max
;
goto
done
;
}
if
(
count
>
max
)
count
=
max
;
ret
=
count
;
if
(
!
bits
)
goto
done
;
/* GetBitmapBits returns not 32-bit aligned data */
if
(
bmp
->
dib
->
dsBmih
.
biHeight
>=
0
)
/* not top-down, need to flip contents vertically */
{
...
...
@@ -322,12 +331,21 @@ LONG WINAPI GetBitmapBits(
while
(
count
>
0
)
{
src
-=
dib
->
dsBm
.
bmWidthBytes
;
memcpy
(
bits
,
src
,
min
(
count
,
dib
->
dsBm
.
bmWidthBytes
)
);
bits
=
(
char
*
)
bits
+
dib
->
dsBm
.
bmWidthBytes
;
count
-=
dib
->
dsBm
.
bmWidthBytes
;
memcpy
(
bits
,
src
,
min
(
count
,
width_bytes
)
);
bits
=
(
char
*
)
bits
+
width_bytes
;
count
-=
width_bytes
;
}
}
else
{
while
(
count
>
0
)
{
memcpy
(
bits
,
src
,
min
(
count
,
width_bytes
)
);
src
+=
dib
->
dsBm
.
bmWidthBytes
;
bits
=
(
char
*
)
bits
+
width_bytes
;
count
-=
width_bytes
;
}
}
else
memcpy
(
bits
,
src
,
count
);
goto
done
;
}
...
...
@@ -667,26 +685,25 @@ static INT BITMAP_GetObject( HGDIOBJ handle, void *obj, INT count, LPVOID buffer
{
BITMAPOBJ
*
bmp
=
obj
;
if
(
!
buffer
)
return
sizeof
(
BITMAP
);
if
(
count
<
sizeof
(
BITMAP
))
return
0
;
if
(
bmp
->
dib
)
{
if
(
!
buffer
)
return
sizeof
(
DIBSECTION
);
if
(
count
<
sizeof
(
DIBSECTION
))
if
(
count
>=
sizeof
(
DIBSECTION
))
{
if
(
count
>
sizeof
(
BITMAP
))
count
=
sizeof
(
BITMAP
);
memcpy
(
buffer
,
bmp
->
dib
,
sizeof
(
DIBSECTION
)
);
return
sizeof
(
DIBSECTION
);
}
else
else
/* if (count >= sizeof(BITMAP)) */
{
if
(
count
>
sizeof
(
DIBSECTION
))
count
=
sizeof
(
DIBSECTION
);
DIBSECTION
*
dib
=
bmp
->
dib
;
memcpy
(
buffer
,
&
dib
->
dsBm
,
sizeof
(
BITMAP
)
);
return
sizeof
(
BITMAP
);
}
memcpy
(
buffer
,
bmp
->
dib
,
count
);
return
count
;
}
else
{
if
(
!
buffer
)
return
sizeof
(
BITMAP
);
if
(
count
<
sizeof
(
BITMAP
))
return
0
;
memcpy
(
buffer
,
&
bmp
->
bitmap
,
sizeof
(
BITMAP
)
);
return
sizeof
(
BITMAP
);
}
...
...
dlls/gdi/tests/bitmap.c
View file @
140eabf3
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