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
d353c95d
Commit
d353c95d
authored
Dec 12, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a flag to request a default color table from init_dib_info.
parent
c5895ead
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
27 deletions
+15
-27
bitblt.c
dlls/gdi32/bitblt.c
+0
-14
dib.c
dlls/gdi32/dib.c
+0
-1
bitblt.c
dlls/gdi32/dibdrv/bitblt.c
+2
-3
dc.c
dlls/gdi32/dibdrv/dc.c
+11
-8
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+2
-1
No files found.
dlls/gdi32/bitblt.c
View file @
d353c95d
...
...
@@ -321,20 +321,6 @@ BOOL nulldrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
err
=
dst_dev
->
funcs
->
pBlendImage
(
dst_dev
,
dst_info
,
&
bits
,
src
,
dst
,
func
);
if
(
err
==
ERROR_BAD_FORMAT
)
{
/* 1-bpp source without a color table uses black & white */
if
(
src_info
->
bmiHeader
.
biBitCount
==
1
&&
!
src_info
->
bmiHeader
.
biClrUsed
)
{
src_info
->
bmiColors
[
0
].
rgbRed
=
0
;
src_info
->
bmiColors
[
0
].
rgbGreen
=
0
;
src_info
->
bmiColors
[
0
].
rgbBlue
=
0
;
src_info
->
bmiColors
[
0
].
rgbReserved
=
0
;
src_info
->
bmiColors
[
1
].
rgbRed
=
0xff
;
src_info
->
bmiColors
[
1
].
rgbGreen
=
0xff
;
src_info
->
bmiColors
[
1
].
rgbBlue
=
0xff
;
src_info
->
bmiColors
[
1
].
rgbReserved
=
0
;
src_info
->
bmiHeader
.
biClrUsed
=
2
;
}
err
=
convert_bits
(
src_info
,
src
,
dst_info
,
&
bits
,
TRUE
);
if
(
!
err
)
err
=
dst_dev
->
funcs
->
pBlendImage
(
dst_dev
,
dst_info
,
&
bits
,
src
,
dst
,
func
);
}
...
...
dlls/gdi32/dib.c
View file @
d353c95d
...
...
@@ -1155,7 +1155,6 @@ void get_ddb_bitmapinfo( BITMAPOBJ *bmp, BITMAPINFO *info )
info
->
bmiHeader
.
biYPelsPerMeter
=
0
;
info
->
bmiHeader
.
biClrUsed
=
0
;
info
->
bmiHeader
.
biClrImportant
=
0
;
if
(
info
->
bmiHeader
.
biBitCount
<=
8
)
fill_default_color_table
(
info
);
}
BITMAPINFO
*
copy_packed_dib
(
const
BITMAPINFO
*
src_info
,
UINT
usage
)
...
...
dlls/gdi32/dibdrv/bitblt.c
View file @
d353c95d
...
...
@@ -927,7 +927,6 @@ static BOOL matching_color_info( const dib_info *dib, const BITMAPINFO *info )
case
8
:
{
RGBQUAD
*
color_table
=
(
RGBQUAD
*
)((
char
*
)
info
+
info
->
bmiHeader
.
biSize
);
if
(
!
info
->
bmiHeader
.
biClrUsed
)
return
FALSE
;
if
(
dib
->
color_table_size
!=
info
->
bmiHeader
.
biClrUsed
)
return
FALSE
;
return
!
memcmp
(
color_table
,
dib
->
color_table
,
dib
->
color_table_size
*
sizeof
(
RGBQUAD
)
);
}
...
...
@@ -1327,7 +1326,7 @@ DWORD blend_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bitbl
if
(
!
init_dib_info_from_bitmapinfo
(
&
src_dib
,
src_info
,
src_bits
,
0
)
)
return
ERROR_BAD_FORMAT
;
if
(
!
init_dib_info_from_bitmapinfo
(
&
dst_dib
,
dst_info
,
dst_bits
,
0
)
)
if
(
!
init_dib_info_from_bitmapinfo
(
&
dst_dib
,
dst_info
,
dst_bits
,
default_color_table
)
)
return
ERROR_BAD_FORMAT
;
return
blend_rect
(
&
dst_dib
,
&
dst
->
visrect
,
&
src_dib
,
&
src
->
visrect
,
NULL
,
blend
);
...
...
@@ -1345,7 +1344,7 @@ DWORD gradient_bitmapinfo( const BITMAPINFO *info, void *bits, TRIVERTEX *vert_a
DWORD
ret
=
ERROR_SUCCESS
;
HRGN
tmp_rgn
=
0
;
if
(
!
init_dib_info_from_bitmapinfo
(
&
dib
,
info
,
bits
,
0
))
return
ERROR_BAD_FORMAT
;
if
(
!
init_dib_info_from_bitmapinfo
(
&
dib
,
info
,
bits
,
default_color_table
))
return
ERROR_BAD_FORMAT
;
switch
(
mode
)
{
...
...
dlls/gdi32/dibdrv/dc.c
View file @
d353c95d
...
...
@@ -153,6 +153,11 @@ static BOOL init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD
dib
->
color_table
=
color_table
;
dib
->
color_table_size
=
bi
->
biClrUsed
;
}
else
if
(
flags
&
default_color_table
)
{
dib
->
color_table
=
(
RGBQUAD
*
)
get_default_color_table
(
dib
->
bit_count
);
dib
->
color_table_size
=
dib
->
color_table
?
(
1
<<
dib
->
bit_count
)
:
0
;
}
else
{
dib
->
color_table
=
NULL
;
...
...
@@ -186,10 +191,9 @@ BOOL init_dib_info_from_bitmapobj(dib_info *dib, BITMAPOBJ *bmp, enum dib_info_f
{
if
(
!
bmp
->
dib
)
{
char
buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)];
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
buffer
;
BITMAPINFO
info
;
get_ddb_bitmapinfo
(
bmp
,
info
);
get_ddb_bitmapinfo
(
bmp
,
&
info
);
if
(
!
bmp
->
bitmap
.
bmBits
)
{
int
width_bytes
=
get_dib_stride
(
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmBitsPixel
);
...
...
@@ -197,8 +201,7 @@ BOOL init_dib_info_from_bitmapobj(dib_info *dib, BITMAPOBJ *bmp, enum dib_info_f
bmp
->
bitmap
.
bmHeight
*
width_bytes
);
if
(
!
bmp
->
bitmap
.
bmBits
)
return
FALSE
;
}
return
init_dib_info_from_bitmapinfo
(
dib
,
info
,
bmp
->
bitmap
.
bmBits
,
flags
|
private_color_table
);
return
init_dib_info_from_bitmapinfo
(
dib
,
&
info
,
bmp
->
bitmap
.
bmBits
,
flags
);
}
return
init_dib_info
(
dib
,
&
bmp
->
dib
->
dsBmih
,
bmp
->
dib
->
dsBitfields
,
bmp
->
color_table
,
bmp
->
dib
->
dsBm
.
bmBits
,
flags
);
...
...
@@ -261,9 +264,9 @@ DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bit
dib_info
src_dib
,
dst_dib
;
DWORD
ret
;
if
(
!
init_dib_info_from_bitmapinfo
(
&
src_dib
,
src_info
,
src_bits
,
0
)
)
if
(
!
init_dib_info_from_bitmapinfo
(
&
src_dib
,
src_info
,
src_bits
,
default_color_table
)
)
return
ERROR_BAD_FORMAT
;
if
(
!
init_dib_info_from_bitmapinfo
(
&
dst_dib
,
dst_info
,
dst_bits
,
0
)
)
if
(
!
init_dib_info_from_bitmapinfo
(
&
dst_dib
,
dst_info
,
dst_bits
,
default_color_table
)
)
return
ERROR_BAD_FORMAT
;
__TRY
...
...
@@ -405,7 +408,7 @@ static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
free_dib_info
(
&
pdev
->
dib
);
pdev
->
defer
=
0
;
if
(
!
init_dib_info_from_bitmapobj
(
&
pdev
->
dib
,
bmp
,
0
))
if
(
!
init_dib_info_from_bitmapobj
(
&
pdev
->
dib
,
bmp
,
default_color_table
))
pdev
->
defer
|=
DEFER_FORMAT
;
GDI_ReleaseObj
(
bitmap
);
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
d353c95d
...
...
@@ -20,7 +20,8 @@
enum
dib_info_flags
{
private_color_table
=
1
private_color_table
=
1
,
default_color_table
=
2
};
typedef
struct
...
...
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