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
ff17abc6
Commit
ff17abc6
authored
Jul 15, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Jul 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Move the query info code to a separate function.
parent
9b56cec9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
48 deletions
+52
-48
dib.c
dlls/gdi32/dib.c
+52
-48
No files found.
dlls/gdi32/dib.c
View file @
ff17abc6
...
...
@@ -444,6 +444,57 @@ static const DWORD bit_fields_888[3] = {0xff0000, 0x00ff00, 0x0000ff};
static
const
DWORD
bit_fields_565
[
3
]
=
{
0xf800
,
0x07e0
,
0x001f
};
static
const
DWORD
bit_fields_555
[
3
]
=
{
0x7c00
,
0x03e0
,
0x001f
};
static
int
fill_query_info
(
BITMAPINFO
*
info
,
BITMAPOBJ
*
bmp
)
{
BITMAPINFOHEADER
header
;
header
.
biSize
=
info
->
bmiHeader
.
biSize
;
/* Ensure we don't overwrite the original size when we copy back */
header
.
biWidth
=
bmp
->
bitmap
.
bmWidth
;
header
.
biHeight
=
bmp
->
bitmap
.
bmHeight
;
header
.
biPlanes
=
1
;
if
(
bmp
->
dib
)
{
header
.
biBitCount
=
bmp
->
dib
->
dsBm
.
bmBitsPixel
;
switch
(
bmp
->
dib
->
dsBm
.
bmBitsPixel
)
{
case
16
:
case
32
:
header
.
biCompression
=
BI_BITFIELDS
;
break
;
default:
header
.
biCompression
=
BI_RGB
;
break
;
}
}
else
{
header
.
biCompression
=
(
bmp
->
bitmap
.
bmBitsPixel
>
8
)
?
BI_BITFIELDS
:
BI_RGB
;
header
.
biBitCount
=
bmp
->
bitmap
.
bmBitsPixel
;
}
header
.
biSizeImage
=
DIB_GetDIBImageBytes
(
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmBitsPixel
);
header
.
biXPelsPerMeter
=
0
;
header
.
biYPelsPerMeter
=
0
;
header
.
biClrUsed
=
0
;
header
.
biClrImportant
=
0
;
if
(
info
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPCOREHEADER
)
)
{
BITMAPCOREHEADER
*
coreheader
=
(
BITMAPCOREHEADER
*
)
info
;
coreheader
->
bcWidth
=
header
.
biWidth
;
coreheader
->
bcHeight
=
header
.
biHeight
;
coreheader
->
bcPlanes
=
header
.
biPlanes
;
coreheader
->
bcBitCount
=
header
.
biBitCount
;
}
else
info
->
bmiHeader
=
header
;
return
abs
(
bmp
->
bitmap
.
bmHeight
);
}
/************************************************************************
* copy_color_info
...
...
@@ -519,7 +570,6 @@ INT WINAPI GetDIBits(
BITMAPOBJ
*
bmp
;
int
i
;
int
bitmap_type
;
BOOL
core_header
;
LONG
width
;
LONG
height
;
WORD
planes
,
bpp
;
...
...
@@ -535,7 +585,6 @@ INT WINAPI GetDIBits(
ERR
(
"Invalid bitmap format
\n
"
);
return
0
;
}
core_header
=
(
bitmap_type
==
0
);
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
...
...
@@ -551,55 +600,10 @@ INT WINAPI GetDIBits(
if
(
bpp
==
0
)
/* query bitmap info only */
{
if
(
core_header
)
{
BITMAPCOREHEADER
*
coreheader
=
(
BITMAPCOREHEADER
*
)
info
;
coreheader
->
bcWidth
=
bmp
->
bitmap
.
bmWidth
;
coreheader
->
bcHeight
=
bmp
->
bitmap
.
bmHeight
;
coreheader
->
bcPlanes
=
1
;
coreheader
->
bcBitCount
=
bmp
->
bitmap
.
bmBitsPixel
;
}
else
{
info
->
bmiHeader
.
biWidth
=
bmp
->
bitmap
.
bmWidth
;
info
->
bmiHeader
.
biHeight
=
bmp
->
bitmap
.
bmHeight
;
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biSizeImage
=
DIB_GetDIBImageBytes
(
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmBitsPixel
);
if
(
bmp
->
dib
)
{
info
->
bmiHeader
.
biBitCount
=
bmp
->
dib
->
dsBm
.
bmBitsPixel
;
switch
(
bmp
->
dib
->
dsBm
.
bmBitsPixel
)
{
case
16
:
case
32
:
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
break
;
default:
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
break
;
}
}
else
{
info
->
bmiHeader
.
biCompression
=
(
bmp
->
bitmap
.
bmBitsPixel
>
8
)
?
BI_BITFIELDS
:
BI_RGB
;
info
->
bmiHeader
.
biBitCount
=
bmp
->
bitmap
.
bmBitsPixel
;
}
info
->
bmiHeader
.
biXPelsPerMeter
=
0
;
info
->
bmiHeader
.
biYPelsPerMeter
=
0
;
info
->
bmiHeader
.
biClrUsed
=
0
;
info
->
bmiHeader
.
biClrImportant
=
0
;
/* Windows 2000 doesn't touch the additional struct members if
it's a BITMAPV4HEADER or a BITMAPV5HEADER */
}
lines
=
abs
(
bmp
->
bitmap
.
bmHeight
);
lines
=
fill_query_info
(
info
,
bmp
);
goto
done
;
}
/* Since info may be a BITMAPCOREINFO or any of the larger BITMAPINFO structures, we'll use our
own copy and transfer the colour info back at the end */
...
...
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