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
1bb98605
Commit
1bb98605
authored
Sep 19, 1999
by
Huw D M Davies
Committed by
Alexandre Julliard
Sep 19, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small DIB fixes.
parent
07c447f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
33 deletions
+24
-33
dib.c
graphics/x11drv/dib.c
+12
-21
dib.c
objects/dib.c
+12
-12
No files found.
graphics/x11drv/dib.c
View file @
1bb98605
...
...
@@ -278,19 +278,18 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
RGBQUAD
*
colors
,
PALETTEENTRY
*
srccolors
,
XImage
*
bmpImage
)
{
DWORD
x
;
int
h
;
BYTE
*
bits
;
DWORD
x
;
int
h
;
BYTE
*
bits
;
/* 32 bit aligned */
DWORD
linebytes
=
((
dstwidth
+
31
)
&
~
31
)
/
8
;
if
(
lines
<
0
)
{
lines
=
-
lines
;
dstbits
=
dstbits
+
(
linebytes
*
lines
-
1
);
linebytes
=
-
linebytes
;
}
if
(
lines
<
0
)
{
lines
=
-
lines
;
dstbits
=
dstbits
+
linebytes
*
(
lines
-
1
);
linebytes
=
-
linebytes
;
}
bits
=
dstbits
;
...
...
@@ -1666,7 +1665,7 @@ static void X11DRV_DIB_SetImageBits_24( int lines, const BYTE *srcbits,
if
(
lines
<
0
)
{
lines
=
-
lines
;
srcbits
=
srcbits
+
(
linebytes
*
lines
-
1
);
srcbits
=
srcbits
+
linebytes
*
(
lines
-
1
);
linebytes
=
-
linebytes
;
}
...
...
@@ -2853,7 +2852,6 @@ INT X11DRV_DIB_GetDIBits(
X11DRV_DIBSECTION
*
dib
=
(
X11DRV_DIBSECTION
*
)
bmp
->
dib
;
X11DRV_DIB_IMAGEBITS_DESCR
descr
;
PALETTEOBJ
*
palette
;
BYTE
*
bbits
=
(
BYTE
*
)
bits
;
TRACE_
(
bitmap
)(
"%u scanlines of (%i,%i) -> (%i,%i) starting from %u
\n
"
,
lines
,
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
...
...
@@ -2906,16 +2904,12 @@ INT X11DRV_DIB_GetDIBits(
descr
.
yDest
=
0
;
descr
.
width
=
bmp
->
bitmap
.
bmWidth
;
descr
.
height
=
bmp
->
bitmap
.
bmHeight
;
descr
.
colorMap
=
info
->
bmiColors
;
descr
.
colorMap
=
info
->
bmiColors
;
if
(
dib
)
{
descr
.
useShm
=
(
dib
->
shminfo
.
shmid
!=
-
1
);
}
descr
.
useShm
=
(
dib
->
shminfo
.
shmid
!=
-
1
);
else
{
descr
.
useShm
=
FALSE
;
}
EnterCriticalSection
(
&
X11DRV_CritSection
);
...
...
@@ -2925,14 +2919,11 @@ INT X11DRV_DIB_GetDIBits(
LeaveCriticalSection
(
&
X11DRV_CritSection
);
if
(
info
->
bmiHeader
.
biSizeImage
==
0
)
/* Fill in biSizeImage */
info
->
bmiHeader
.
biSizeImage
=
DIB_GetDIBImageBytes
(
info
->
bmiHeader
.
biSizeImage
=
DIB_GetDIBImageBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biHeight
,
info
->
bmiHeader
.
biBitCount
);
if
(
bbits
-
(
BYTE
*
)
bits
>
info
->
bmiHeader
.
biSizeImage
)
ERR_
(
bitmap
)(
"Buffer overrun. Please investigate.
\n
"
);
info
->
bmiHeader
.
biCompression
=
0
;
GDI_HEAP_UNLOCK
(
dc
->
w
.
hPalette
);
...
...
objects/dib.c
View file @
1bb98605
...
...
@@ -540,12 +540,12 @@ INT WINAPI GetDIBits(
/*FIXME: Only RGB dibs supported for now */
int
srcwidth
=
bmp
->
dib
->
dsBm
.
bmWidth
,
srcwidthb
=
bmp
->
dib
->
dsBm
.
bmWidthBytes
;
int
dstwidthb
=
DIB_GetDIBWidthBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biBitCount
);
LP
VOID
dbits
=
bits
,
sbits
=
bmp
->
dib
->
dsBm
.
bmBits
+
(
startscan
*
srcwidthb
);
LP
BYTE
dbits
=
bits
,
sbits
=
bmp
->
dib
->
dsBm
.
bmBits
+
(
startscan
*
srcwidthb
);
int
x
,
y
;
if
((
info
->
bmiHeader
.
biHeight
<
0
)
^
(
bmp
->
dib
->
dsBmih
.
biHeight
<
0
))
{
dbits
=
bits
+
(
dstwidthb
*
(
lines
-
1
));
dbits
=
(
LPBYTE
)
bits
+
(
dstwidthb
*
(
lines
-
1
));
dstwidthb
=
-
dstwidthb
;
}
...
...
@@ -571,7 +571,7 @@ INT WINAPI GetDIBits(
case
24
:
/* 24 bpp srcDIB -> 16 bpp dstDIB */
{
LPBYTE
srcbits
=
(
LPBYTE
)
sbits
;
LPBYTE
srcbits
=
sbits
;
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
srcwidth
;
x
++
)
...
...
@@ -579,7 +579,7 @@ INT WINAPI GetDIBits(
(((
WORD
)
*
srcbits
++
<<
2
)
&
gmask
)
|
(((
WORD
)
*
srcbits
++
<<
7
)
&
rmask
);
dstbits
=
(
LPWORD
)(
dbits
+=
dstwidthb
);
srcbits
=
(
LPBYTE
)(
sbits
+=
srcwidthb
);
srcbits
=
(
sbits
+=
srcwidthb
);
}
}
break
;
...
...
@@ -595,8 +595,8 @@ INT WINAPI GetDIBits(
*
dstbits
++
=
(
WORD
)(((
val
>>
19
)
&
bmask
)
|
((
val
>>
6
)
&
gmask
)
|
((
val
<<
7
)
&
rmask
));
}
dstbits
=
(
LPWORD
)(
dbits
+=
dstwidthb
);
srcbits
=
(
LPDWORD
)(
sbits
+=
srcwidthb
);
dstbits
=
(
LPWORD
)(
dbits
+=
dstwidthb
);
srcbits
=
(
LPDWORD
)(
sbits
+=
srcwidthb
);
}
}
break
;
...
...
@@ -611,7 +611,7 @@ INT WINAPI GetDIBits(
case
24
:
/* 24 bpp dstDIB */
{
LPBYTE
dstbits
=
(
LPBYTE
)
dbits
;
LPBYTE
dstbits
=
dbits
;
switch
(
bmp
->
dib
->
dsBm
.
bmBitsPixel
)
{
...
...
@@ -628,7 +628,7 @@ INT WINAPI GetDIBits(
*
dstbits
++
=
(
BYTE
)(((
val
>>
2
)
&
0xf8
)
|
((
val
>>
7
)
&
0x07
));
*
dstbits
++
=
(
BYTE
)(((
val
<<
3
)
&
0xf8
)
|
((
val
>>
2
)
&
0x07
));
}
dstbits
=
(
LPBYTE
)(
dbits
+=
dstwidthb
);
dstbits
=
(
LPBYTE
)(
dbits
+=
dstwidthb
);
srcbits
=
(
LPWORD
)(
sbits
+=
srcwidthb
);
}
}
...
...
@@ -686,22 +686,22 @@ INT WINAPI GetDIBits(
((
val
<<
6
)
&
0xf800
)
|
((
val
<<
1
)
&
0x0700
)
|
((
val
<<
19
)
&
0xf800
)
|
((
val
<<
14
)
&
0x070000
);
}
dstbits
=
(
dbits
+=
dstwidthb
);
srcbits
=
(
sbits
+=
srcwidthb
);
dstbits
=
(
LPDWORD
)(
dbits
+=
dstwidthb
);
srcbits
=
(
LPWORD
)(
sbits
+=
srcwidthb
);
}
}
break
;
case
24
:
/* 24 bpp srcDIB -> 32 bpp dstDIB */
{
LPBYTE
srcbits
=
(
LPBYTE
)
sbits
;
LPBYTE
srcbits
=
sbits
;
for
(
y
=
0
;
y
<
lines
;
y
++
)
{
for
(
x
=
0
;
x
<
srcwidth
;
x
++
)
*
dstbits
++
=
((
DWORD
)
*
srcbits
++
&
rmask
)
|
(((
DWORD
)
*
srcbits
++
<<
8
)
&
gmask
)
|
(((
DWORD
)
*
srcbits
++
<<
7
)
&
bmask
);
dstbits
=
(
dbits
+=
dstwidthb
);
dstbits
=
(
LPDWORD
)(
dbits
+=
dstwidthb
);
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