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
e1ba4bb4
Commit
e1ba4bb4
authored
Feb 12, 2001
by
Ove Kaaven
Committed by
Alexandre Julliard
Feb 12, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In CopyDIBSection, use source DIB colormap instead if no palette has
been selected into the source DC, to work around some X11-imposed DIBsection implementation deficiencies.
parent
c2fd62d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
dib.c
graphics/x11drv/dib.c
+20
-7
No files found.
graphics/x11drv/dib.c
View file @
e1ba4bb4
...
...
@@ -3245,7 +3245,7 @@ void X11DRV_DIB_CopyDIBSection(DC *dcSrc, DC *dcDst,
{
BITMAPOBJ
*
bmp
;
X11DRV_PDEVICE
*
physDev
=
(
X11DRV_PDEVICE
*
)
dcDst
->
physDev
;
int
nColorMap
=
0
,
*
colorMap
=
NULL
;
int
nColorMap
=
0
,
*
colorMap
=
NULL
,
aColorMap
=
FALSE
;
TRACE
(
"(%p,%p,%ld,%ld,%ld,%ld,%ld,%ld)
\n
"
,
dcSrc
,
dcDst
,
xSrc
,
ySrc
,
xDest
,
yDest
,
width
,
height
);
...
...
@@ -3272,17 +3272,30 @@ void X11DRV_DIB_CopyDIBSection(DC *dcSrc, DC *dcDst,
height
=
bmp
->
bitmap
.
bmHeight
-
ySrc
;
/* if the source bitmap is 8bpp or less, we're supposed to use the
* DC's palette for color conversion (not the DIB color table) */
if
(
bmp
->
dib
->
dsBm
.
bmBitsPixel
<=
8
)
colorMap
=
X11DRV_DIB_BuildColorMap
(
dcSrc
,
(
WORD
)
-
1
,
bmp
->
dib
->
dsBm
.
bmBitsPixel
,
(
BITMAPINFO
*
)
&
(
bmp
->
dib
->
dsBmih
),
&
nColorMap
);
if
(
bmp
->
dib
->
dsBm
.
bmBitsPixel
<=
8
)
{
X11DRV_DIBSECTION
*
dib
=
(
X11DRV_DIBSECTION
*
)
bmp
->
dib
;
if
((
!
dcSrc
->
hPalette
)
||
(
dcSrc
->
hPalette
==
GetStockObject
(
DEFAULT_PALETTE
)))
{
/* HACK: no palette has been set in the source DC,
* use the DIB colormap instead - this is necessary in some
* cases since we need to do depth conversion in some places
* where real Windows can just copy data straight over */
colorMap
=
dib
->
colorMap
;
nColorMap
=
dib
->
nColorMap
;
}
else
{
colorMap
=
X11DRV_DIB_BuildColorMap
(
dcSrc
,
(
WORD
)
-
1
,
bmp
->
dib
->
dsBm
.
bmBitsPixel
,
(
BITMAPINFO
*
)
&
(
bmp
->
dib
->
dsBmih
),
&
nColorMap
);
if
(
colorMap
)
aColorMap
=
TRUE
;
}
}
/* perform the copy */
X11DRV_DIB_DoCopyDIBSection
(
bmp
,
FALSE
,
colorMap
,
nColorMap
,
physDev
->
drawable
,
xSrc
,
ySrc
,
xDest
,
yDest
,
width
,
height
);
/* free color mapping */
if
(
c
olorMap
)
if
(
aC
olorMap
)
HeapFree
(
GetProcessHeap
(),
0
,
colorMap
);
}
GDI_ReleaseObj
(
dcSrc
->
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