Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
27d2b9b8
Commit
27d2b9b8
authored
Dec 01, 2010
by
Wolfram Sang
Committed by
Alexandre Julliard
Dec 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: In GetDIBits() with DIB sections, always use dibpitch from the target.
parent
fe05a730
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
bitmap.c
dlls/gdi32/tests/bitmap.c
+13
-2
dib.c
dlls/winex11.drv/dib.c
+1
-2
No files found.
dlls/gdi32/tests/bitmap.c
View file @
27d2b9b8
...
...
@@ -1218,7 +1218,8 @@ static void test_GetDIBits_selected_DIB(UINT bpp)
BITMAPINFO
*
info2
;
void
*
bits
;
void
*
bits2
;
UINT
dib_size
;
UINT
dib_size
,
dib32_size
;
DWORD
pixel
;
HDC
dib_dc
,
dc
;
HBITMAP
old_bmp
;
BOOL
equalContents
;
...
...
@@ -1254,6 +1255,7 @@ static void test_GetDIBits_selected_DIB(UINT bpp)
dib
=
CreateDIBSection
(
NULL
,
info
,
DIB_RGB_COLORS
,
&
bits
,
NULL
,
0
);
assert
(
dib
);
dib_size
=
bpp
*
(
info
->
bmiHeader
.
biWidth
*
info
->
bmiHeader
.
biHeight
)
/
8
;
dib32_size
=
32
*
(
info
->
bmiHeader
.
biWidth
*
info
->
bmiHeader
.
biHeight
)
/
8
;
/* Set the bits of the DIB section */
for
(
i
=
0
;
i
<
dib_size
;
i
++
)
...
...
@@ -1265,7 +1267,7 @@ static void test_GetDIBits_selected_DIB(UINT bpp)
dib_dc
=
CreateCompatibleDC
(
NULL
);
old_bmp
=
SelectObject
(
dib_dc
,
dib
);
dc
=
CreateCompatibleDC
(
NULL
);
bits2
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
dib_size
);
bits2
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
dib
32
_size
);
assert
(
bits2
);
/* Copy the DIB attributes but not the color table */
...
...
@@ -1300,6 +1302,15 @@ static void test_GetDIBits_selected_DIB(UINT bpp)
}
ok
(
equalContents
,
"GetDIBits with %d bpp DIB selected in DC: Invalid DIB bits
\n
"
,
bpp
);
/* Map into a 32bit-DIB */
info2
->
bmiHeader
.
biBitCount
=
32
;
res
=
GetDIBits
(
dc
,
dib
,
0
,
info
->
bmiHeader
.
biHeight
,
bits2
,
info2
,
DIB_RGB_COLORS
);
ok
(
res
,
"GetDIBits failed
\n
"
);
/* Check if last pixel was set */
pixel
=
((
DWORD
*
)
bits2
)[
info
->
bmiHeader
.
biWidth
*
info
->
bmiHeader
.
biHeight
-
1
];
ok
(
pixel
!=
0
,
"Pixel: 0x%08x
\n
"
,
pixel
);
HeapFree
(
GetProcessHeap
(),
0
,
bits2
);
DeleteDC
(
dc
);
...
...
dlls/winex11.drv/dib.c
View file @
27d2b9b8
...
...
@@ -4210,8 +4210,7 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start
descr
.
ySrc
=
startscan
;
}
descr
.
shm_mode
=
physBitmap
->
shm_mode
;
descr
.
dibpitch
=
(
obj_size
==
sizeof
(
DIBSECTION
))
?
dib
.
dsBm
.
bmWidthBytes
:
(((
descr
.
infoWidth
*
descr
.
infoBpp
+
31
)
&~
31
)
/
8
);
descr
.
dibpitch
=
(((
descr
.
infoWidth
*
descr
.
infoBpp
+
31
)
&~
31
)
/
8
);
X11DRV_DIB_Lock
(
physBitmap
,
DIB_Status_GdiMod
);
X11DRV_DIB_GetImageBits
(
&
descr
);
...
...
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