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
26501596
Commit
26501596
authored
Sep 10, 2000
by
Eric Pouech
Committed by
Alexandre Julliard
Sep 10, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fallback code for StretchBlt on RLE DIBs with gaps.
parent
bd6a0394
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
5 deletions
+36
-5
dib.c
objects/dib.c
+36
-5
No files found.
objects/dib.c
View file @
26501596
...
@@ -145,15 +145,46 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
...
@@ -145,15 +145,46 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
HBITMAP
hBitmap
,
hOldBitmap
;
HBITMAP
hBitmap
,
hOldBitmap
;
HDC
hdcMem
;
HDC
hdcMem
;
hBitmap
=
CreateDIBitmap
(
hdc
,
&
info
->
bmiHeader
,
CBM_INIT
,
bits
,
info
,
wUsage
);
hdcMem
=
CreateCompatibleDC
(
hdc
);
hdcMem
=
CreateCompatibleDC
(
hdc
);
hOldBitmap
=
SelectObject
(
hdcMem
,
hBitmap
);
if
(
info
->
bmiHeader
.
biCompression
==
BI_RLE4
||
info
->
bmiHeader
.
biCompression
==
BI_RLE8
)
{
/* when RLE compression is used, there may be some gaps (ie the DIB doesn't
* contain all the rectangle described in bmiHeader, but only part of it.
* This mean that those undescribed pixels must be left untouched.
* So, we first copy on a memory bitmap the current content of the
* destination rectangle, blit the DIB bits on top of it - hence leaving
* the gaps untouched -, and blitting the rectangle back.
* This insure that gaps are untouched on the destination rectangle
* Not doing so leads to trashed images (the gaps contain what was on the
* memory bitmap => generally black or garbage)
* Unfortunately, RLE DIBs without gaps will be slowed down. But this is
* another speed vs correctness issue. Anyway, if speed is needed, then the
* pStretchDIBits function shall be implemented.
* ericP (2000/09/09)
*/
hBitmap
=
CreateCompatibleBitmap
(
hdc
,
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biHeight
);
hOldBitmap
=
SelectObject
(
hdcMem
,
hBitmap
);
/* copy existing bitmap from destination dc */
StretchBlt
(
hdcMem
,
xSrc
,
abs
(
info
->
bmiHeader
.
biHeight
)
-
heightSrc
-
ySrc
,
widthSrc
,
heightSrc
,
hdc
,
xDst
,
yDst
,
widthDst
,
heightDst
,
dwRop
);
SetDIBits
(
hdcMem
,
hBitmap
,
0
,
info
->
bmiHeader
.
biHeight
,
bits
,
info
,
DIB_RGB_COLORS
);
}
else
{
hBitmap
=
CreateDIBitmap
(
hdc
,
&
info
->
bmiHeader
,
CBM_INIT
,
bits
,
info
,
wUsage
);
hOldBitmap
=
SelectObject
(
hdcMem
,
hBitmap
);
}
/* Origin for DIBitmap may be bottom left (positive biHeight) or top
/* Origin for DIBitmap may be bottom left (positive biHeight) or top
left (negative biHeight) */
left (negative biHeight) */
StretchBlt
(
hdc
,
xDst
,
yDst
,
widthDst
,
heightDst
,
StretchBlt
(
hdc
,
xDst
,
yDst
,
widthDst
,
heightDst
,
hdcMem
,
xSrc
,
abs
(
info
->
bmiHeader
.
biHeight
)
-
heightSrc
-
ySrc
,
hdcMem
,
xSrc
,
abs
(
info
->
bmiHeader
.
biHeight
)
-
heightSrc
-
ySrc
,
widthSrc
,
heightSrc
,
dwRop
);
widthSrc
,
heightSrc
,
dwRop
);
SelectObject
(
hdcMem
,
hOldBitmap
);
SelectObject
(
hdcMem
,
hOldBitmap
);
DeleteDC
(
hdcMem
);
DeleteDC
(
hdcMem
);
DeleteObject
(
hBitmap
);
DeleteObject
(
hBitmap
);
...
...
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