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
6f066ec1
Commit
6f066ec1
authored
Aug 30, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Forward the null driver PutImage to the DIB driver since the bits are in DIB format.
parent
bff79eb2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
59 deletions
+10
-59
bitmap.c
dlls/gdi32/bitmap.c
+9
-59
objects.c
dlls/gdi32/mfdrv/objects.c
+1
-0
No files found.
dlls/gdi32/bitmap.c
View file @
6f066ec1
...
...
@@ -88,73 +88,23 @@ DWORD nulldrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *inf
BITMAPOBJ
*
bmp
;
if
(
!
hbitmap
)
return
ERROR_SUCCESS
;
if
(
!
(
bmp
=
GDI_GetObjPtr
(
hbitmap
,
OBJ_BITMAP
)))
return
ERROR_INVALID_HANDLE
;
if
(
info
->
bmiHeader
.
biPlanes
!=
1
)
goto
update_format
;
if
(
info
->
bmiHeader
.
biBitCount
!=
bmp
->
bitmap
.
bmBitsPixel
)
goto
update_format
;
/* FIXME: check color masks */
if
(
bits
)
{
int
i
,
width_bytes
=
get_dib_stride
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biBitCount
);
unsigned
char
*
dst_bits
,
*
src_bits
;
if
((
src
->
width
!=
dst
->
width
)
||
(
src
->
height
!=
dst
->
height
))
{
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_TRANSFORM_NOT_SUPPORTED
;
}
if
(
src
->
visrect
.
left
>
0
||
src
->
visrect
.
right
<
bmp
->
bitmap
.
bmWidth
||
dst
->
visrect
.
left
>
0
||
dst
->
visrect
.
right
<
bmp
->
bitmap
.
bmWidth
)
{
FIXME
(
"setting partial rows not supported
\n
"
);
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_NOT_SUPPORTED
;
}
if
(
clip
)
{
FIXME
(
"clip region not supported
\n
"
);
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_NOT_SUPPORTED
;
}
if
(
!
bmp
->
bitmap
.
bmBits
&&
!
(
bmp
->
bitmap
.
bmBits
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
bmp
->
bitmap
.
bmHeight
*
width_bytes
)))
if
(
!
(
bmp
=
GDI_GetObjPtr
(
hbitmap
,
OBJ_BITMAP
)))
return
ERROR_INVALID_HANDLE
;
if
(
!
bmp
->
bitmap
.
bmBits
)
{
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_OUTOFMEMORY
;
}
dst_bits
=
(
unsigned
char
*
)
bmp
->
bitmap
.
bmBits
+
dst
->
visrect
.
top
*
width_bytes
;
src_bits
=
bits
->
ptr
;
if
(
info
->
bmiHeader
.
biHeight
>
0
)
{
src_bits
+=
(
info
->
bmiHeader
.
biHeight
-
1
-
src
->
visrect
.
top
)
*
width_bytes
;
width_bytes
=
-
width_bytes
;
}
else
src_bits
+=
src
->
visrect
.
top
*
width_bytes
;
if
(
width_bytes
!=
bmp
->
bitmap
.
bmWidthBytes
)
{
for
(
i
=
0
;
i
<
dst
->
visrect
.
bottom
-
dst
->
visrect
.
top
;
i
++
)
int
width_bytes
=
get_dib_stride
(
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmBitsPixel
);
if
(
!
(
bmp
->
bitmap
.
bmBits
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
bmp
->
bitmap
.
bmHeight
*
width_bytes
)))
{
memcpy
(
dst_bits
,
src_bits
,
bmp
->
bitmap
.
bmWidthBytes
);
src_bits
+=
width_bytes
;
dst_bits
+=
abs
(
width_bytes
);
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_OUTOFMEMORY
;
}
}
else
memcpy
(
dst_bits
,
src_bits
,
width_bytes
*
(
dst
->
visrect
.
bottom
-
dst
->
visrect
.
top
)
);
GDI_ReleaseObj
(
hbitmap
);
}
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_SUCCESS
;
update_format:
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biBitCount
=
bmp
->
bitmap
.
bmBitsPixel
;
if
(
info
->
bmiHeader
.
biHeight
>
0
)
info
->
bmiHeader
.
biHeight
=
-
info
->
bmiHeader
.
biHeight
;
GDI_ReleaseObj
(
hbitmap
);
return
ERROR_BAD_FORMAT
;
return
dib_driver
.
pPutImage
(
NULL
,
hbitmap
,
clip
,
info
,
bits
,
src
,
dst
,
rop
);
}
...
...
dlls/gdi32/mfdrv/objects.c
View file @
6f066ec1
...
...
@@ -202,6 +202,7 @@ INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush )
mr
->
rdParm
[
1
]
=
DIB_RGB_COLORS
;
dst_info
=
(
BITMAPINFO
*
)(
mr
->
rdParm
+
2
);
dst_info
->
bmiHeader
=
src_info
->
bmiHeader
;
dst_info
->
bmiHeader
.
biClrUsed
=
0
;
cref
=
GetTextColor
(
dev
->
hdc
);
dst_info
->
bmiColors
[
0
].
rgbRed
=
GetRValue
(
cref
);
dst_info
->
bmiColors
[
0
].
rgbGreen
=
GetGValue
(
cref
);
...
...
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