Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c73a1fd6
Commit
c73a1fd6
authored
Sep 19, 1999
by
Karl Lessard
Committed by
Alexandre Julliard
Sep 19, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more minor GDI fixes.
parent
27492598
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
81 deletions
+55
-81
dib.c
graphics/x11drv/dib.c
+47
-70
dib.c
objects/dib.c
+8
-11
No files found.
graphics/x11drv/dib.c
View file @
c73a1fd6
...
@@ -299,7 +299,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
...
@@ -299,7 +299,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
/* ==== monochrome bitmap to monochrome dib ==== */
/* ==== monochrome bitmap to monochrome dib ==== */
case
4
:
case
4
:
/* ==== 4 colormap bitmap to monochrome dib ==== */
/* ==== 4 colormap bitmap to monochrome dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -322,7 +322,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
...
@@ -322,7 +322,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
case
8
:
case
8
:
/* ==== 8 colormap bitmap to monochrome dib ==== */
/* ==== 8 colormap bitmap to monochrome dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
BYTE
*
srcpixel
;
BYTE
*
srcpixel
;
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -473,9 +473,9 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
...
@@ -473,9 +473,9 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
srcpixel
=
bmpImage
->
data
+
h
*
bmpImage
->
bytes_per_line
;
srcpixel
=
bmpImage
->
data
+
h
*
bmpImage
->
bytes_per_line
;
for
(
x
=
0
;
x
<
dstwidth
;
x
++
,
srcpixel
+=
4
)
{
for
(
x
=
0
;
x
<
dstwidth
;
x
++
,
srcpixel
+=
4
)
{
if
(
!
(
x
&
7
))
*
bits
=
0
;
if
(
!
(
x
&
7
))
*
bits
=
0
;
*
bits
|=
(
X11DRV_DIB_GetNearestIndex
(
colors
,
2
,
srcpixel
[
0
]
,
srcpixel
[
1
],
srcpixel
[
2
])
<<
(
7
-
(
x
&
7
))
);
*
bits
|=
(
X11DRV_DIB_GetNearestIndex
(
colors
,
2
,
srcpixel
[
0
]
,
srcpixel
[
1
],
srcpixel
[
2
])
<<
(
7
-
(
x
&
7
))
);
if
((
x
&
7
)
==
7
)
bits
++
;
if
((
x
&
7
)
==
7
)
bits
++
;
}
}
bits
=
(
dstbits
+=
linebytes
);
bits
=
(
dstbits
+=
linebytes
);
}
}
}
}
...
@@ -483,13 +483,27 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
...
@@ -483,13 +483,27 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
}
}
break
;
break
;
default:
/* ? bit bmp ->
4 bit
DIB */
default:
/* ? bit bmp ->
monochrome
DIB */
notsupported:
notsupported:
FIXME_
(
bitmap
)(
"from %d bit bitmap with mask R,G,B %x,%x,%x to 4 bit DIB
\n
"
,
{
unsigned
long
white
=
(
1
<<
bmpImage
->
bits_per_pixel
)
-
1
;
FIXME_
(
bitmap
)(
"from %d bit bitmap with mask R,G,B %x,%x,%x to 1 bit DIB
\n
"
,
bmpImage
->
bits_per_pixel
,
(
int
)
bmpImage
->
red_mask
,
bmpImage
->
bits_per_pixel
,
(
int
)
bmpImage
->
red_mask
,
(
int
)
bmpImage
->
green_mask
,
(
int
)
bmpImage
->
blue_mask
);
(
int
)
bmpImage
->
green_mask
,
(
int
)
bmpImage
->
blue_mask
);
for
(
h
=
lines
-
1
;
h
>=
0
;
h
--
)
{
for
(
x
=
0
;
x
<
dstwidth
;
x
++
)
{
if
(
!
(
x
&
7
))
*
bits
=
0
;
*
bits
|=
(
XGetPixel
(
bmpImage
,
x
,
h
)
>=
white
)
<<
(
7
-
(
x
&
7
));
if
((
x
&
7
)
==
7
)
bits
++
;
}
bits
=
(
dstbits
+=
linebytes
);
}
}
break
;
break
;
}
}
}
}
/***********************************************************************
/***********************************************************************
...
@@ -574,7 +588,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
...
@@ -574,7 +588,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
/* ==== monochrome bitmap to 4 colormap dib ==== */
/* ==== monochrome bitmap to 4 colormap dib ==== */
case
4
:
case
4
:
/* ==== 4 colormap bitmap to 4 colormap dib ==== */
/* ==== 4 colormap bitmap to 4 colormap dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -597,7 +611,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
...
@@ -597,7 +611,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
case
8
:
case
8
:
/* ==== 8 colormap bitmap to 4 colormap dib ==== */
/* ==== 8 colormap bitmap to 4 colormap dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -920,13 +934,21 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
...
@@ -920,13 +934,21 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
bits
=
dstbits
;
bits
=
dstbits
;
/*
Hack for now
This condition is true when GetImageBits has been called by UpdateDIBSection.
For now, GetNearestIndex is too slow to support 256 colormaps, so we'll just use for
for GetDIBits calls. (In somes cases, in a updateDIBSection, the returned colors are bad too)
*/
if
(
!
srccolors
)
goto
updatesection
;
switch
(
bmpImage
->
depth
)
{
switch
(
bmpImage
->
depth
)
{
case
1
:
case
1
:
/* ==== monochrome bitmap to 8 colormap dib ==== */
/* ==== monochrome bitmap to 8 colormap dib ==== */
case
4
:
case
4
:
/* ==== 4 colormap bitmap to 8 colormap dib ==== */
/* ==== 4 colormap bitmap to 8 colormap dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -945,7 +967,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
...
@@ -945,7 +967,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
case
8
:
case
8
:
/* ==== 8 colormap bitmap to 8 colormap dib ==== */
/* ==== 8 colormap bitmap to 8 colormap dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
BYTE
*
srcpixel
;
BYTE
*
srcpixel
;
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -1101,6 +1123,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
...
@@ -1101,6 +1123,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
FIXME_
(
bitmap
)(
"from %d bit bitmap with mask R,G,B %x,%x,%x to 8 bit DIB
\n
"
,
FIXME_
(
bitmap
)(
"from %d bit bitmap with mask R,G,B %x,%x,%x to 8 bit DIB
\n
"
,
bmpImage
->
depth
,
(
int
)
bmpImage
->
red_mask
,
bmpImage
->
depth
,
(
int
)
bmpImage
->
red_mask
,
(
int
)
bmpImage
->
green_mask
,
(
int
)
bmpImage
->
blue_mask
);
(
int
)
bmpImage
->
green_mask
,
(
int
)
bmpImage
->
blue_mask
);
updatesection:
for
(
h
=
lines
-
1
;
h
>=
0
;
h
--
)
{
for
(
h
=
lines
-
1
;
h
>=
0
;
h
--
)
{
for
(
x
=
0
;
x
<
dstwidth
;
x
++
,
bits
++
)
{
for
(
x
=
0
;
x
<
dstwidth
;
x
++
,
bits
++
)
{
*
bits
=
X11DRV_DIB_MapColor
((
int
*
)
colors
,
256
,
*
bits
=
X11DRV_DIB_MapColor
((
int
*
)
colors
,
256
,
...
@@ -1578,7 +1601,7 @@ static void X11DRV_DIB_GetImageBits_16( int lines, BYTE *dstbits,
...
@@ -1578,7 +1601,7 @@ static void X11DRV_DIB_GetImageBits_16( int lines, BYTE *dstbits,
/* ==== monochrome bitmap to 16 BGR dib ==== */
/* ==== monochrome bitmap to 16 BGR dib ==== */
case
4
:
case
4
:
/* ==== 4 colormap bitmap to 16 BGR dib ==== */
/* ==== 4 colormap bitmap to 16 BGR dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
LPWORD
ptr
=
(
LPWORD
)
dstbits
;
LPWORD
ptr
=
(
LPWORD
)
dstbits
;
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -1599,7 +1622,7 @@ static void X11DRV_DIB_GetImageBits_16( int lines, BYTE *dstbits,
...
@@ -1599,7 +1622,7 @@ static void X11DRV_DIB_GetImageBits_16( int lines, BYTE *dstbits,
case
8
:
case
8
:
/* ==== 8 colormap bitmap to 16 BGR dib ==== */
/* ==== 8 colormap bitmap to 16 BGR dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
LPWORD
ptr
=
(
LPWORD
)
dstbits
;
LPWORD
ptr
=
(
LPWORD
)
dstbits
;
BYTE
*
srcpixel
;
BYTE
*
srcpixel
;
...
@@ -2036,7 +2059,7 @@ static void X11DRV_DIB_GetImageBits_24( int lines, BYTE *dstbits,
...
@@ -2036,7 +2059,7 @@ static void X11DRV_DIB_GetImageBits_24( int lines, BYTE *dstbits,
/* ==== monochrome bitmap to 24 BGR dib ==== */
/* ==== monochrome bitmap to 24 BGR dib ==== */
case
4
:
case
4
:
/* ==== 4 colormap bitmap to 24 BGR dib ==== */
/* ==== 4 colormap bitmap to 24 BGR dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
LPBYTE
bits
=
dstbits
;
LPBYTE
bits
=
dstbits
;
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -2057,7 +2080,7 @@ static void X11DRV_DIB_GetImageBits_24( int lines, BYTE *dstbits,
...
@@ -2057,7 +2080,7 @@ static void X11DRV_DIB_GetImageBits_24( int lines, BYTE *dstbits,
case
8
:
case
8
:
/* ==== 8 colormap bitmap to 24 BGR dib ==== */
/* ==== 8 colormap bitmap to 24 BGR dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
BYTE
*
srcpixel
;
BYTE
*
srcpixel
;
LPBYTE
bits
=
dstbits
;
LPBYTE
bits
=
dstbits
;
...
@@ -2091,9 +2114,9 @@ static void X11DRV_DIB_GetImageBits_24( int lines, BYTE *dstbits,
...
@@ -2091,9 +2114,9 @@ static void X11DRV_DIB_GetImageBits_24( int lines, BYTE *dstbits,
for
(
x
=
0
;
x
<
dstwidth
;
x
++
,
bits
+=
3
)
for
(
x
=
0
;
x
<
dstwidth
;
x
++
,
bits
+=
3
)
{
{
COLORREF
pixel
=
X11DRV_PALETTE_ToLogical
(
XGetPixel
(
bmpImage
,
x
,
h
)
);
COLORREF
pixel
=
X11DRV_PALETTE_ToLogical
(
XGetPixel
(
bmpImage
,
x
,
h
)
);
bits
[
0
]
=
Get
R
Value
(
pixel
);
bits
[
0
]
=
Get
B
Value
(
pixel
);
bits
[
1
]
=
GetGValue
(
pixel
);
bits
[
1
]
=
GetGValue
(
pixel
);
bits
[
2
]
=
Get
B
Value
(
pixel
);
bits
[
2
]
=
Get
R
Value
(
pixel
);
}
}
bits
=
(
dstbits
+=
linebytes
);
bits
=
(
dstbits
+=
linebytes
);
}
}
...
@@ -2370,7 +2393,7 @@ static void X11DRV_DIB_GetImageBits_32( int lines, BYTE *dstbits,
...
@@ -2370,7 +2393,7 @@ static void X11DRV_DIB_GetImageBits_32( int lines, BYTE *dstbits,
/* ==== monochrome bitmap to 32 BGR dib ==== */
/* ==== monochrome bitmap to 32 BGR dib ==== */
case
4
:
case
4
:
/* ==== 4 colormap bitmap to 32 BGR dib ==== */
/* ==== 4 colormap bitmap to 32 BGR dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -2391,7 +2414,7 @@ static void X11DRV_DIB_GetImageBits_32( int lines, BYTE *dstbits,
...
@@ -2391,7 +2414,7 @@ static void X11DRV_DIB_GetImageBits_32( int lines, BYTE *dstbits,
case
8
:
case
8
:
/* ==== 8 colormap bitmap to 32 BGR dib ==== */
/* ==== 8 colormap bitmap to 32 BGR dib ==== */
if
(
bmpImage
->
red_mask
==
bmpImage
->
green_mask
==
bmpImage
->
blue_mask
==
0
)
if
(
bmpImage
->
red_mask
==
0
&&
bmpImage
->
green_mask
==
0
&&
bmpImage
->
blue_mask
==
0
&&
srccolors
)
{
{
BYTE
*
srcpixel
;
BYTE
*
srcpixel
;
PALETTEENTRY
val
;
PALETTEENTRY
val
;
...
@@ -2421,9 +2444,9 @@ static void X11DRV_DIB_GetImageBits_32( int lines, BYTE *dstbits,
...
@@ -2421,9 +2444,9 @@ static void X11DRV_DIB_GetImageBits_32( int lines, BYTE *dstbits,
for
(
x
=
0
;
x
<
dstwidth
;
x
++
,
bits
+=
4
)
for
(
x
=
0
;
x
<
dstwidth
;
x
++
,
bits
+=
4
)
{
{
COLORREF
pixel
=
X11DRV_PALETTE_ToLogical
(
XGetPixel
(
bmpImage
,
x
,
h
)
);
COLORREF
pixel
=
X11DRV_PALETTE_ToLogical
(
XGetPixel
(
bmpImage
,
x
,
h
)
);
bits
[
0
]
=
Get
R
Value
(
pixel
);
bits
[
0
]
=
Get
B
Value
(
pixel
);
bits
[
1
]
=
GetGValue
(
pixel
);
bits
[
1
]
=
GetGValue
(
pixel
);
bits
[
2
]
=
Get
B
Value
(
pixel
);
bits
[
2
]
=
Get
R
Value
(
pixel
);
}
}
bits
=
(
dstbits
+=
linebytes
);
bits
=
(
dstbits
+=
linebytes
);
}
}
...
@@ -2457,31 +2480,6 @@ int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
...
@@ -2457,31 +2480,6 @@ int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
bmpImage
->
data
=
xcalloc
(
bmpImage
->
bytes_per_line
*
lines
);
bmpImage
->
data
=
xcalloc
(
bmpImage
->
bytes_per_line
*
lines
);
}
}
/* Hack for now */
if
(
bmpImage
->
red_mask
==
bmpImage
->
blue_mask
==
bmpImage
->
green_mask
==
0
)
{
switch
(
bmpImage
->
depth
)
{
case
15
:
bmpImage
->
red_mask
=
0x7c00
;
bmpImage
->
green_mask
=
0x03e0
;
bmpImage
->
blue_mask
=
0x001f
;
break
;
case
16
:
bmpImage
->
red_mask
=
0xf800
;
bmpImage
->
green_mask
=
0x07e0
;
bmpImage
->
blue_mask
=
0x001f
;
break
;
case
24
:
case
32
:
bmpImage
->
red_mask
=
0xff0000
;
bmpImage
->
green_mask
=
0xff00
;
bmpImage
->
blue_mask
=
0xff
;
break
;
}
}
/* Transfer the pixels */
/* Transfer the pixels */
switch
(
descr
->
infoBpp
)
switch
(
descr
->
infoBpp
)
{
{
...
@@ -2579,30 +2577,6 @@ int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
...
@@ -2579,30 +2577,6 @@ int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
descr
->
width
,
descr
->
height
,
AllPlanes
,
ZPixmap
,
descr
->
width
,
descr
->
height
,
AllPlanes
,
ZPixmap
,
bmpImage
,
descr
->
xSrc
,
descr
->
ySrc
);
bmpImage
,
descr
->
xSrc
,
descr
->
ySrc
);
/* Hack for now */
if
(
bmpImage
->
red_mask
==
bmpImage
->
blue_mask
==
bmpImage
->
green_mask
==
0
)
{
switch
(
bmpImage
->
depth
)
{
case
15
:
bmpImage
->
red_mask
=
0x7c00
;
bmpImage
->
green_mask
=
0x03e0
;
bmpImage
->
blue_mask
=
0x001f
;
break
;
case
16
:
bmpImage
->
red_mask
=
0xf800
;
bmpImage
->
green_mask
=
0x07e0
;
bmpImage
->
blue_mask
=
0x001f
;
break
;
case
24
:
case
32
:
bmpImage
->
red_mask
=
0xff0000
;
bmpImage
->
green_mask
=
0xff00
;
bmpImage
->
blue_mask
=
0xff
;
break
;
}
}
/* Transfer the pixels */
/* Transfer the pixels */
switch
(
descr
->
infoBpp
)
switch
(
descr
->
infoBpp
)
{
{
...
@@ -2728,6 +2702,7 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
...
@@ -2728,6 +2702,7 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
descr
.
dc
=
dc
;
descr
.
dc
=
dc
;
descr
.
bits
=
bits
;
descr
.
bits
=
bits
;
descr
.
image
=
NULL
;
descr
.
image
=
NULL
;
descr
.
palentry
=
NULL
;
descr
.
lines
=
tmpheight
>=
0
?
lines
:
-
lines
;
descr
.
lines
=
tmpheight
>=
0
?
lines
:
-
lines
;
descr
.
infoWidth
=
width
;
descr
.
infoWidth
=
width
;
descr
.
depth
=
dc
->
w
.
bitsPerPixel
;
descr
.
depth
=
dc
->
w
.
bitsPerPixel
;
...
@@ -2820,6 +2795,7 @@ INT X11DRV_DIB_SetDIBits(
...
@@ -2820,6 +2795,7 @@ INT X11DRV_DIB_SetDIBits(
descr
.
bits
=
bits
;
descr
.
bits
=
bits
;
descr
.
image
=
NULL
;
descr
.
image
=
NULL
;
descr
.
palentry
=
NULL
;
descr
.
lines
=
tmpheight
>=
0
?
lines
:
-
lines
;
descr
.
lines
=
tmpheight
>=
0
?
lines
:
-
lines
;
descr
.
depth
=
bmp
->
bitmap
.
bmBitsPixel
;
descr
.
depth
=
bmp
->
bitmap
.
bmBitsPixel
;
descr
.
drawable
=
pbitmap
->
pixmap
;
descr
.
drawable
=
pbitmap
->
pixmap
;
...
@@ -2961,6 +2937,7 @@ static void X11DRV_DIB_DoUpdateDIBSection(BITMAPOBJ *bmp, BOOL toDIB)
...
@@ -2961,6 +2937,7 @@ static void X11DRV_DIB_DoUpdateDIBSection(BITMAPOBJ *bmp, BOOL toDIB)
return
;
return
;
descr
.
dc
=
NULL
;
descr
.
dc
=
NULL
;
descr
.
palentry
=
NULL
;
descr
.
image
=
dib
->
image
;
descr
.
image
=
dib
->
image
;
descr
.
colorMap
=
(
RGBQUAD
*
)
dib
->
colorMap
;
descr
.
colorMap
=
(
RGBQUAD
*
)
dib
->
colorMap
;
descr
.
nColorMap
=
dib
->
nColorMap
;
descr
.
nColorMap
=
dib
->
nColorMap
;
...
...
objects/dib.c
View file @
c73a1fd6
...
@@ -592,8 +592,8 @@ INT WINAPI GetDIBits(
...
@@ -592,8 +592,8 @@ INT WINAPI GetDIBits(
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
srcwidth
;
x
++
)
{
for
(
x
=
0
;
x
<
srcwidth
;
x
++
)
{
val
=
*
srcbits
++
;
val
=
*
srcbits
++
;
*
dstbits
++
=
(
WORD
)(((
val
>>
19
)
&
bmask
)
|
((
val
>>
6
)
&
gmask
)
|
*
dstbits
++
=
(
WORD
)(((
val
>>
3
)
&
bmask
)
|
((
val
>>
6
)
&
gmask
)
|
((
val
<<
7
)
&
rmask
));
((
val
>>
9
)
&
rmask
));
}
}
dstbits
=
(
LPWORD
)(
dbits
+=
dstwidthb
);
dstbits
=
(
LPWORD
)(
dbits
+=
dstwidthb
);
srcbits
=
(
LPDWORD
)(
sbits
+=
srcwidthb
);
srcbits
=
(
LPDWORD
)(
sbits
+=
srcwidthb
);
...
@@ -624,9 +624,9 @@ INT WINAPI GetDIBits(
...
@@ -624,9 +624,9 @@ INT WINAPI GetDIBits(
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
srcwidth
;
x
++
)
{
for
(
x
=
0
;
x
<
srcwidth
;
x
++
)
{
val
=
*
srcbits
++
;
val
=
*
srcbits
++
;
*
dstbits
++
=
(
BYTE
)(((
val
>>
7
)
&
0xf8
)
|
((
val
>>
12
)
&
0x07
));
*
dstbits
++
=
(
BYTE
)(((
val
>>
2
)
&
0xf8
)
|
((
val
>>
7
)
&
0x07
));
*
dstbits
++
=
(
BYTE
)(((
val
<<
3
)
&
0xf8
)
|
((
val
>>
2
)
&
0x07
));
*
dstbits
++
=
(
BYTE
)(((
val
<<
3
)
&
0xf8
)
|
((
val
>>
2
)
&
0x07
));
*
dstbits
++
=
(
BYTE
)(((
val
>>
2
)
&
0xf8
)
|
((
val
>>
7
)
&
0x07
));
*
dstbits
++
=
(
BYTE
)(((
val
>>
7
)
&
0xf8
)
|
((
val
>>
12
)
&
0x07
));
}
}
dstbits
=
(
LPBYTE
)(
dbits
+=
dstwidthb
);
dstbits
=
(
LPBYTE
)(
dbits
+=
dstwidthb
);
srcbits
=
(
LPWORD
)(
sbits
+=
srcwidthb
);
srcbits
=
(
LPWORD
)(
sbits
+=
srcwidthb
);
...
@@ -668,7 +668,6 @@ INT WINAPI GetDIBits(
...
@@ -668,7 +668,6 @@ INT WINAPI GetDIBits(
case
32
:
/* 32 bpp dstDIB */
case
32
:
/* 32 bpp dstDIB */
{
{
LPDWORD
dstbits
=
(
LPDWORD
)
dbits
;
LPDWORD
dstbits
=
(
LPDWORD
)
dbits
;
DWORD
rmask
=
0xff
,
gmask
=
0xff00
,
bmask
=
0xff0000
;
/* FIXME: BI_BITFIELDS not supported yet */
/* FIXME: BI_BITFIELDS not supported yet */
...
@@ -682,9 +681,9 @@ INT WINAPI GetDIBits(
...
@@ -682,9 +681,9 @@ INT WINAPI GetDIBits(
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
srcwidth
;
x
++
)
{
for
(
x
=
0
;
x
<
srcwidth
;
x
++
)
{
val
=
(
DWORD
)
*
srcbits
++
;
val
=
(
DWORD
)
*
srcbits
++
;
*
dstbits
++
=
((
val
>>
7
)
&
0xf8
)
|
((
val
>>
1
2
)
&
0x07
)
|
*
dstbits
++
=
((
val
<<
3
)
&
0xf8
)
|
((
val
>>
2
)
&
0x07
)
|
((
val
<<
6
)
&
0xf800
)
|
((
val
<<
1
)
&
0x0700
)
|
((
val
<<
6
)
&
0xf800
)
|
((
val
<<
1
)
&
0x0700
)
|
((
val
<<
19
)
&
0xf800
)
|
((
val
<<
1
4
)
&
0x070000
);
((
val
<<
9
)
&
0xf80000
)
|
((
val
<<
4
)
&
0x070000
);
}
}
dstbits
=
(
LPDWORD
)(
dbits
+=
dstwidthb
);
dstbits
=
(
LPDWORD
)(
dbits
+=
dstwidthb
);
srcbits
=
(
LPWORD
)(
sbits
+=
srcwidthb
);
srcbits
=
(
LPWORD
)(
sbits
+=
srcwidthb
);
...
@@ -697,10 +696,8 @@ INT WINAPI GetDIBits(
...
@@ -697,10 +696,8 @@ INT WINAPI GetDIBits(
LPBYTE
srcbits
=
sbits
;
LPBYTE
srcbits
=
sbits
;
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
srcwidth
;
x
++
)
for
(
x
=
0
;
x
<
srcwidth
;
x
++
,
srcbits
+=
3
)
*
dstbits
++
=
((
DWORD
)
*
srcbits
++
&
rmask
)
|
*
dstbits
++
=
((
DWORD
)
*
srcbits
)
&
0x00ffffff
;
(((
DWORD
)
*
srcbits
++
<<
8
)
&
gmask
)
|
(((
DWORD
)
*
srcbits
++
<<
7
)
&
bmask
);
dstbits
=
(
LPDWORD
)(
dbits
+=
dstwidthb
);
dstbits
=
(
LPDWORD
)(
dbits
+=
dstwidthb
);
srcbits
=
(
sbits
+=
srcwidthb
);
srcbits
=
(
sbits
+=
srcwidthb
);
}
}
...
...
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