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
baa8d225
Commit
baa8d225
authored
Sep 17, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Replace DC_GetDCUpdate by get_dc_ptr+update_dc in the bitmap functions.
parent
f3f792d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
47 deletions
+58
-47
bitblt.c
dlls/gdi32/bitblt.c
+31
-30
dib.c
dlls/gdi32/dib.c
+27
-17
No files found.
dlls/gdi32/bitblt.c
View file @
baa8d225
...
...
@@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bitblt);
BOOL
WINAPI
PatBlt
(
HDC
hdc
,
INT
left
,
INT
top
,
INT
width
,
INT
height
,
DWORD
rop
)
{
DC
*
dc
=
DC_GetDCUpdate
(
hdc
);
DC
*
dc
=
get_dc_ptr
(
hdc
);
BOOL
bRet
=
FALSE
;
if
(
!
dc
)
return
FALSE
;
...
...
@@ -43,9 +43,10 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top,
if
(
dc
->
funcs
->
pPatBlt
)
{
TRACE
(
"%p %d,%d %dx%d %06x
\n
"
,
hdc
,
left
,
top
,
width
,
height
,
rop
);
update_dc
(
dc
);
bRet
=
dc
->
funcs
->
pPatBlt
(
dc
->
physDev
,
left
,
top
,
width
,
height
,
rop
);
}
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
bRet
;
}
...
...
@@ -59,22 +60,23 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
BOOL
ret
=
FALSE
;
DC
*
dcDst
,
*
dcSrc
;
if
((
dcDst
=
DC_GetDCUpdate
(
hdcDst
))
&&
dcDst
->
funcs
->
pBitBlt
)
if
(
!
(
dcDst
=
get_dc_ptr
(
hdcDst
)))
return
FALSE
;
if
(
dcDst
->
funcs
->
pBitBlt
)
{
DC_ReleaseDCPtr
(
dcDst
);
/* FIXME: there is a race condition here */
dcSrc
=
DC_GetDCUpdate
(
hdcSrc
);
dcDst
=
DC_GetDCPtr
(
hdcDst
);
update_dc
(
dcDst
);
dcSrc
=
get_dc_ptr
(
hdcSrc
);
if
(
dcSrc
)
update_dc
(
dcSrc
);
TRACE
(
"hdcSrc=%p %d,%d -> hdcDest=%p %d,%d %dx%d rop=%06x
\n
"
,
hdcSrc
,
xSrc
,
ySrc
,
hdcDst
,
xDst
,
yDst
,
width
,
height
,
rop
);
ret
=
dcDst
->
funcs
->
pBitBlt
(
dcDst
->
physDev
,
xDst
,
yDst
,
width
,
height
,
dcSrc
?
dcSrc
->
physDev
:
NULL
,
xSrc
,
ySrc
,
rop
);
DC_ReleaseDCP
tr
(
dcDst
);
if
(
dcSrc
)
DC_ReleaseDCP
tr
(
dcSrc
);
release_dc_p
tr
(
dcDst
);
if
(
dcSrc
)
release_dc_p
tr
(
dcSrc
);
}
else
if
(
dcDst
&&
dcDst
->
funcs
->
pStretchDIBits
)
else
if
(
dcDst
->
funcs
->
pStretchDIBits
)
{
BITMAP
bm
;
BITMAPINFOHEADER
info_hdr
;
...
...
@@ -82,7 +84,7 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
LPVOID
bits
;
INT
lines
;
DC_ReleaseDCP
tr
(
dcDst
);
release_dc_p
tr
(
dcDst
);
if
(
GetObjectType
(
hdcSrc
)
!=
OBJ_MEMDC
)
{
...
...
@@ -118,8 +120,7 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
HeapFree
(
GetProcessHeap
(),
0
,
bits
);
return
(
lines
==
height
);
}
else
if
(
dcDst
)
DC_ReleaseDCPtr
(
dcDst
);
else
release_dc_ptr
(
dcDst
);
return
ret
;
}
...
...
@@ -137,13 +138,14 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
BOOL
ret
=
FALSE
;
DC
*
dcDst
,
*
dcSrc
;
if
((
dcDst
=
DC_GetDCUpdate
(
hdcDst
))
&&
dcDst
->
funcs
->
pStretchBlt
)
if
(
!
(
dcDst
=
get_dc_ptr
(
hdcDst
)))
return
FALSE
;
if
(
dcDst
->
funcs
->
pStretchBlt
)
{
DC_ReleaseDCPtr
(
dcDst
);
/* FIXME: there is a race condition here */
if
((
dcSrc
=
DC_GetDCUpdate
(
hdcSrc
)))
if
((
dcSrc
=
get_dc_ptr
(
hdcSrc
)))
{
dcDst
=
DC_GetDCPtr
(
hdcDst
);
update_dc
(
dcDst
);
update_dc
(
dcSrc
);
TRACE
(
"%p %d,%d %dx%d -> %p %d,%d %dx%d rop=%06x
\n
"
,
hdcSrc
,
xSrc
,
ySrc
,
widthSrc
,
heightSrc
,
...
...
@@ -152,11 +154,11 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
ret
=
dcDst
->
funcs
->
pStretchBlt
(
dcDst
->
physDev
,
xDst
,
yDst
,
widthDst
,
heightDst
,
dcSrc
->
physDev
,
xSrc
,
ySrc
,
widthSrc
,
heightSrc
,
rop
);
DC_ReleaseDCP
tr
(
dcDst
);
DC_ReleaseDCP
tr
(
dcSrc
);
release_dc_p
tr
(
dcDst
);
release_dc_p
tr
(
dcSrc
);
}
}
else
if
(
dcDst
&&
dcDst
->
funcs
->
pStretchDIBits
)
else
if
(
dcDst
->
funcs
->
pStretchDIBits
)
{
BITMAP
bm
;
BITMAPINFOHEADER
info_hdr
;
...
...
@@ -164,7 +166,7 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
LPVOID
bits
;
INT
lines
;
DC_ReleaseDCP
tr
(
dcDst
);
release_dc_p
tr
(
dcDst
);
if
(
GetObjectType
(
hdcSrc
)
!=
OBJ_MEMDC
)
return
FALSE
;
...
...
@@ -196,8 +198,7 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
HeapFree
(
GetProcessHeap
(),
0
,
bits
);
return
(
lines
==
heightSrc
);
}
else
if
(
dcDst
)
DC_ReleaseDCPtr
(
dcDst
);
else
release_dc_ptr
(
dcDst
);
return
ret
;
}
...
...
@@ -496,11 +497,11 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig
BOOL
ret
=
FALSE
;
DC
*
dcDst
,
*
dcSrc
;
if
((
dcSrc
=
DC_GetDCUpdate
(
hdcSrc
)))
DC_ReleaseDCPtr
(
dcSrc
);
/* FIXME: there is a race condition here */
if
((
dcDst
=
DC_GetDCUpdate
(
hdcDst
)))
dcSrc
=
get_dc_ptr
(
hdcSrc
);
if
((
dcDst
=
get_dc_ptr
(
hdcDst
)))
{
dcSrc
=
DC_GetDCPtr
(
hdcSrc
);
if
(
dcSrc
)
update_dc
(
dcSrc
);
update_dc
(
dcDst
);
TRACE
(
"%p %d,%d %dx%d -> %p %d,%d %dx%d op=%02x flags=%02x srcconstalpha=%02x alphafmt=%02x
\n
"
,
hdcSrc
,
xSrc
,
ySrc
,
widthSrc
,
heightSrc
,
hdcDst
,
xDst
,
yDst
,
widthDst
,
heightDst
,
...
...
@@ -510,9 +511,9 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig
ret
=
dcDst
->
funcs
->
pAlphaBlend
(
dcDst
->
physDev
,
xDst
,
yDst
,
widthDst
,
heightDst
,
dcSrc
?
dcSrc
->
physDev
:
NULL
,
xSrc
,
ySrc
,
widthSrc
,
heightSrc
,
blendFunction
);
if
(
dcSrc
)
DC_ReleaseDCPtr
(
dcSrc
);
DC_ReleaseDCPtr
(
dcDst
);
release_dc_ptr
(
dcDst
);
}
if
(
dcSrc
)
release_dc_ptr
(
dcSrc
);
return
ret
;
}
...
...
dlls/gdi32/dib.c
View file @
baa8d225
...
...
@@ -193,15 +193,15 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
if
(
!
bits
||
!
info
)
return
0
;
dc
=
DC_GetDCUpdate
(
hdc
);
if
(
!
dc
)
return
FALSE
;
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
return
FALSE
;
if
(
dc
->
funcs
->
pStretchDIBits
)
{
update_dc
(
dc
);
heightSrc
=
dc
->
funcs
->
pStretchDIBits
(
dc
->
physDev
,
xDst
,
yDst
,
widthDst
,
heightDst
,
xSrc
,
ySrc
,
widthSrc
,
heightSrc
,
bits
,
info
,
wUsage
,
dwRop
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
}
else
/* use StretchBlt */
{
...
...
@@ -213,7 +213,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
WORD
planes
,
bpp
;
DWORD
compr
,
size
;
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
if
(
DIB_GetBitmapInfo
(
&
info
->
bmiHeader
,
&
width
,
&
height
,
&
planes
,
&
bpp
,
&
compr
,
&
size
)
==
-
1
)
{
...
...
@@ -303,29 +303,35 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
BITMAPOBJ
*
bitmap
;
INT
result
=
0
;
if
(
!
(
dc
=
DC_GetDCUpdate
(
hdc
)))
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
{
if
(
coloruse
==
DIB_RGB_COLORS
)
FIXME
(
"shouldn't require a DC for DIB_RGB_COLORS
\n
"
);
return
0
;
}
update_dc
(
dc
);
if
(
!
(
bitmap
=
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
)))
{
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
0
;
}
if
(
!
bitmap
->
funcs
&&
!
BITMAP_SetOwnerDC
(
hbitmap
,
dc
))
goto
done
;
if
(
bitmap
->
funcs
&&
bitmap
->
funcs
->
pSetDIBits
)
result
=
bitmap
->
funcs
->
pSetDIBits
(
dc
->
physDev
,
hbitmap
,
startscan
,
lines
,
result
=
lines
;
if
(
bitmap
->
funcs
)
{
if
(
bitmap
->
funcs
!=
dc
->
funcs
)
ERR
(
"not supported: DDB bitmap %p not belonging to device %p
\n
"
,
hbitmap
,
hdc
);
else
if
(
dc
->
funcs
->
pSetDIBits
)
result
=
dc
->
funcs
->
pSetDIBits
(
dc
->
physDev
,
hbitmap
,
startscan
,
lines
,
bits
,
info
,
coloruse
);
else
result
=
lines
;
}
done:
GDI_ReleaseObj
(
hbitmap
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
result
;
}
...
...
@@ -343,18 +349,21 @@ INT WINAPI SetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx,
if
(
!
bits
)
return
0
;
if
(
!
(
dc
=
DC_GetDCUpdate
(
hdc
)))
return
0
;
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
return
0
;
if
(
dc
->
funcs
->
pSetDIBitsToDevice
)
{
update_dc
(
dc
);
ret
=
dc
->
funcs
->
pSetDIBitsToDevice
(
dc
->
physDev
,
xDest
,
yDest
,
cx
,
cy
,
xSrc
,
ySrc
,
startscan
,
lines
,
bits
,
info
,
coloruse
);
}
else
{
FIXME
(
"unimplemented on hdc %p
\n
"
,
hdc
);
ret
=
0
;
}
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
@@ -563,14 +572,15 @@ INT WINAPI GetDIBits(
return
0
;
}
core_header
=
(
bitmap_type
==
0
);
if
(
!
(
dc
=
DC_GetDCUpdate
(
hdc
)))
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
update_dc
(
dc
);
if
(
!
(
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
)))
{
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
0
;
}
...
...
@@ -622,7 +632,7 @@ INT WINAPI GetDIBits(
memset
(
palEntry
,
0
,
sizeof
(
palEntry
)
);
if
(
!
GetPaletteEntries
(
dc
->
hPalette
,
0
,
1
<<
bmp
->
bitmap
.
bmBitsPixel
,
palEntry
))
{
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
GDI_ReleaseObj
(
hbitmap
);
return
0
;
}
...
...
@@ -1019,7 +1029,7 @@ INT WINAPI GetDIBits(
}
TRACE
(
"biWidth = %d, biHeight = %d
\n
"
,
width
,
height
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
GDI_ReleaseObj
(
hbitmap
);
return
lines
;
}
...
...
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