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
e81e7314
Commit
e81e7314
authored
Aug 02, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Aug 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Actually use the dib driver's Get/PutImage if the bitmap is a dib.
parent
d4076d43
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
dib.c
dlls/gdi32/dib.c
+13
-4
bitmap.c
dlls/gdi32/tests/bitmap.c
+1
-2
No files found.
dlls/gdi32/dib.c
View file @
e81e7314
...
...
@@ -509,6 +509,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
struct
bitblt_coords
src
,
dst
;
INT
src_to_dst_offset
;
HRGN
clip
=
0
;
const
struct
gdi_dc_funcs
*
funcs
;
src_bits
.
ptr
=
(
void
*
)
bits
;
src_bits
.
is_copy
=
FALSE
;
...
...
@@ -578,9 +579,14 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
if
(
lines
<
src
.
visrect
.
bottom
)
src
.
visrect
.
bottom
=
lines
;
}
physdev
=
GET_DC_PHYSDEV
(
dc
,
pPutImage
);
/* Hack to ensure we don't get the nulldrv if the bmp hasn't been selected
into a dc yet */
physdev
=
GET_DC_PHYSDEV
(
dc
,
pCreateBitmap
);
if
(
!
BITMAP_SetOwnerDC
(
hbitmap
,
physdev
))
goto
done
;
funcs
=
bitmap
->
funcs
;
if
(
bitmap
->
dib
)
funcs
=
dc
->
dibdrv
.
dev
.
funcs
;
result
=
lines
;
offset_rect
(
&
src
.
visrect
,
0
,
src_to_dst_offset
);
...
...
@@ -600,7 +606,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
memcpy
(
dst_info
,
src_info
,
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
));
err
=
physdev
->
funcs
->
pPutImage
(
physdev
,
hbitmap
,
clip
,
dst_info
,
&
src_bits
,
&
src
,
&
dst
,
0
);
err
=
funcs
->
pPutImage
(
NULL
,
hbitmap
,
clip
,
dst_info
,
&
src_bits
,
&
src
,
&
dst
,
0
);
if
(
err
==
ERROR_BAD_FORMAT
)
{
void
*
ptr
;
...
...
@@ -616,7 +622,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
src_bits
.
is_copy
=
TRUE
;
src_bits
.
free
=
free_heap_bits
;
if
(
!
err
)
err
=
physdev
->
funcs
->
pPutImage
(
physdev
,
hbitmap
,
clip
,
dst_info
,
&
src_bits
,
&
src
,
&
dst
,
0
);
err
=
funcs
->
pPutImage
(
NULL
,
hbitmap
,
clip
,
dst_info
,
&
src_bits
,
&
src
,
&
dst
,
0
);
}
}
else
err
=
ERROR_OUTOFMEMORY
;
...
...
@@ -915,6 +921,7 @@ INT WINAPI GetDIBits(
char
dst_bmibuf
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)];
BITMAPINFO
*
dst_info
=
(
BITMAPINFO
*
)
dst_bmibuf
;
unsigned
int
colors
=
0
;
const
struct
gdi_dc_funcs
*
funcs
;
if
(
!
info
)
return
0
;
...
...
@@ -936,6 +943,8 @@ INT WINAPI GetDIBits(
return
0
;
}
funcs
=
bmp
->
funcs
;
if
(
bmp
->
dib
)
funcs
=
dc
->
dibdrv
.
dev
.
funcs
;
if
(
bpp
==
0
)
/* query bitmap info only */
{
...
...
@@ -1104,7 +1113,7 @@ INT WINAPI GetDIBits(
lines
=
src
.
height
;
err
=
bmp
->
funcs
->
pGetImage
(
NULL
,
hbitmap
,
src_info
,
&
src_bits
,
&
src
);
err
=
funcs
->
pGetImage
(
NULL
,
hbitmap
,
src_info
,
&
src_bits
,
&
src
);
if
(
err
)
{
...
...
dlls/gdi32/tests/bitmap.c
View file @
e81e7314
...
...
@@ -437,8 +437,7 @@ static void test_dib_bits_access( HBITMAP hdib, void *bits )
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"%x != PAGE_READWRITE
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
State
==
MEM_COMMIT
,
"%x != MEM_COMMIT
\n
"
,
info
.
State
);
ok
(
info
.
Type
==
MEM_PRIVATE
,
"%x != MEM_PRIVATE
\n
"
,
info
.
Type
);
/* it has been protected now */
todo_wine
ok
(
info
.
Protect
==
PAGE_READWRITE
,
"%x != PAGE_READWRITE
\n
"
,
info
.
Protect
);
ok
(
info
.
Protect
==
PAGE_READWRITE
,
"%x != PAGE_READWRITE
\n
"
,
info
.
Protect
);
/* try writing protected bits to a file */
...
...
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