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
66a05b2a
Commit
66a05b2a
authored
Feb 23, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Feb 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Fallback to StretchDIBits if the driver doesn't support BitBlt.
parent
56247a20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
7 deletions
+56
-7
bitblt.c
dlls/gdi/bitblt.c
+56
-7
No files found.
dlls/gdi/bitblt.c
View file @
66a05b2a
...
@@ -55,19 +55,68 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
...
@@ -55,19 +55,68 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
DC
*
dcDst
,
*
dcSrc
;
DC
*
dcDst
,
*
dcSrc
;
if
((
dcSrc
=
DC_GetDCUpdate
(
hdcSrc
)))
GDI_ReleaseObj
(
hdcSrc
);
if
((
dcDst
=
DC_GetDCUpdate
(
hdcDst
))
&&
dcDst
->
funcs
->
pBitBlt
)
/* FIXME: there is a race condition here */
if
((
dcDst
=
DC_GetDCUpdate
(
hdcDst
)))
{
{
dcSrc
=
DC_GetDCPtr
(
hdcSrc
);
GDI_ReleaseObj
(
hdcDst
);
/* FIXME: there is a race condition here */
dcSrc
=
DC_GetDCUpdate
(
hdcSrc
);
dcDst
=
DC_GetDCPtr
(
hdcDst
);
TRACE
(
"hdcSrc=%p %d,%d -> hdcDest=%p %d,%d %dx%d rop=%06lx
\n
"
,
TRACE
(
"hdcSrc=%p %d,%d -> hdcDest=%p %d,%d %dx%d rop=%06lx
\n
"
,
hdcSrc
,
xSrc
,
ySrc
,
hdcDst
,
xDst
,
yDst
,
width
,
height
,
rop
);
hdcSrc
,
xSrc
,
ySrc
,
hdcDst
,
xDst
,
yDst
,
width
,
height
,
rop
);
if
(
dcDst
->
funcs
->
pBitBlt
)
ret
=
dcDst
->
funcs
->
pBitBlt
(
dcDst
->
physDev
,
xDst
,
yDst
,
width
,
height
,
ret
=
dcDst
->
funcs
->
pBitBlt
(
dcDst
->
physDev
,
xDst
,
yDst
,
width
,
height
,
dcSrc
?
dcSrc
->
physDev
:
NULL
,
xSrc
,
ySrc
,
rop
);
dcSrc
?
dcSrc
->
physDev
:
NULL
,
xSrc
,
ySrc
,
rop
);
GDI_ReleaseObj
(
hdcDst
);
if
(
dcSrc
)
GDI_ReleaseObj
(
hdcSrc
);
if
(
dcSrc
)
GDI_ReleaseObj
(
hdcSrc
);
}
else
if
(
dcDst
&&
dcDst
->
funcs
->
pStretchDIBits
)
{
BITMAP
bm
;
BITMAPINFOHEADER
info_hdr
;
HBITMAP
hbm
;
LPVOID
bits
;
INT
lines
;
GDI_ReleaseObj
(
hdcDst
);
GDI_ReleaseObj
(
hdcDst
);
if
(
GetObjectType
(
hdcSrc
)
!=
OBJ_MEMDC
)
{
FIXME
(
"hdcSrc isn't a memory dc. Don't yet cope with this
\n
"
);
return
FALSE
;
}
GetObjectW
(
GetCurrentObject
(
hdcSrc
,
OBJ_BITMAP
),
sizeof
(
bm
),
&
bm
);
info_hdr
.
biSize
=
sizeof
(
info_hdr
);
info_hdr
.
biWidth
=
bm
.
bmWidth
;
info_hdr
.
biHeight
=
bm
.
bmHeight
;
info_hdr
.
biPlanes
=
1
;
info_hdr
.
biBitCount
=
32
;
info_hdr
.
biCompression
=
BI_RGB
;
info_hdr
.
biSizeImage
=
0
;
info_hdr
.
biXPelsPerMeter
=
0
;
info_hdr
.
biYPelsPerMeter
=
0
;
info_hdr
.
biClrUsed
=
0
;
info_hdr
.
biClrImportant
=
0
;
if
(
!
(
bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bm
.
bmHeight
*
bm
.
bmWidth
*
4
)))
return
FALSE
;
/* Select out the src bitmap before calling GetDIBits */
hbm
=
SelectObject
(
hdcSrc
,
GetStockObject
(
DEFAULT_BITMAP
));
GetDIBits
(
hdcSrc
,
hbm
,
0
,
bm
.
bmHeight
,
bits
,
(
BITMAPINFO
*
)
&
info_hdr
,
DIB_RGB_COLORS
);
SelectObject
(
hdcSrc
,
hbm
);
lines
=
StretchDIBits
(
hdcDst
,
xDst
,
yDst
,
width
,
height
,
xSrc
,
ySrc
,
width
,
height
,
bits
,
(
BITMAPINFO
*
)
&
info_hdr
,
DIB_RGB_COLORS
,
rop
);
HeapFree
(
GetProcessHeap
(),
0
,
bits
);
return
(
lines
==
bm
.
bmHeight
);
}
}
else
if
(
dcDst
)
GDI_ReleaseObj
(
hdcDst
);
return
ret
;
return
ret
;
}
}
...
...
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