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
494bfa86
Commit
494bfa86
authored
Dec 09, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Remove the nb_colors fields in the bitmap object, we always allocate a…
gdi32: Remove the nb_colors fields in the bitmap object, we always allocate a full size color table.
parent
c441ebc2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
16 deletions
+11
-16
bitmap.c
dlls/gdi32/bitmap.c
+0
-1
brush.c
dlls/gdi32/brush.c
+3
-3
dib.c
dlls/gdi32/dib.c
+6
-9
dc.c
dlls/gdi32/dibdrv/dc.c
+1
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-2
No files found.
dlls/gdi32/bitmap.c
View file @
494bfa86
...
...
@@ -300,7 +300,6 @@ HBITMAP WINAPI CreateBitmapIndirect( const BITMAP *bmp )
bmpobj
->
funcs
=
&
null_driver
;
bmpobj
->
dib
=
NULL
;
bmpobj
->
color_table
=
NULL
;
bmpobj
->
nb_colors
=
0
;
if
(
!
(
hbitmap
=
alloc_gdi_handle
(
&
bmpobj
->
header
,
OBJ_BITMAP
,
&
bitmap_funcs
)))
{
...
...
dlls/gdi32/brush.c
View file @
494bfa86
...
...
@@ -122,10 +122,10 @@ static BOOL copy_bitmap( BRUSHOBJ *brush, HBITMAP bitmap )
bitmap_info_size
(
(
BITMAPINFO
*
)
&
bmp
->
dib
->
dsBmih
,
DIB_RGB_COLORS
));
if
(
!
info
)
goto
done
;
info
->
bmiHeader
=
bmp
->
dib
->
dsBmih
;
if
(
bmp
->
dib
->
dsBmih
.
biCompression
==
BI_BITFIELDS
)
if
(
info
->
bmiHeader
.
biCompression
==
BI_BITFIELDS
)
memcpy
(
&
info
->
bmiHeader
+
1
,
bmp
->
dib
->
dsBitfields
,
sizeof
(
bmp
->
dib
->
dsBitfields
)
);
else
if
(
bmp
->
nb_colors
)
memcpy
(
&
info
->
bmiHeader
+
1
,
bmp
->
color_table
,
bmp
->
nb_colors
*
sizeof
(
RGBQUAD
)
);
else
if
(
info
->
bmiHeader
.
biClrUsed
)
memcpy
(
&
info
->
bmiHeader
+
1
,
bmp
->
color_table
,
info
->
bmiHeader
.
biClrUsed
*
sizeof
(
RGBQUAD
)
);
if
(
!
(
brush
->
bits
.
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
get_dib_image_size
(
info
))))
{
HeapFree
(
GetProcessHeap
(),
0
,
info
);
...
...
dlls/gdi32/dib.c
View file @
494bfa86
...
...
@@ -894,11 +894,10 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA
/* Check if currently selected bitmap is a DIB */
if
(
bitmap
->
color_table
)
{
if
(
startpos
<
bitmap
->
nb_colors
)
if
(
startpos
<
bitmap
->
dib
->
dsBmih
.
biClrUsed
)
{
if
(
startpos
+
entries
>
bitmap
->
nb_colors
)
entries
=
bitmap
->
nb_colors
-
startpos
;
memcpy
(
bitmap
->
color_table
+
startpos
,
colors
,
entries
*
sizeof
(
RGBQUAD
));
result
=
entries
;
result
=
min
(
entries
,
bitmap
->
dib
->
dsBmih
.
biClrUsed
-
startpos
);
memcpy
(
bitmap
->
color_table
+
startpos
,
colors
,
result
*
sizeof
(
RGBQUAD
));
}
}
GDI_ReleaseObj
(
dc
->
hBitmap
);
...
...
@@ -925,11 +924,10 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col
/* Check if currently selected bitmap is a DIB */
if
(
bitmap
->
color_table
)
{
if
(
startpos
<
bitmap
->
nb_colors
)
if
(
startpos
<
bitmap
->
dib
->
dsBmih
.
biClrUsed
)
{
if
(
startpos
+
entries
>
bitmap
->
nb_colors
)
entries
=
bitmap
->
nb_colors
-
startpos
;
memcpy
(
colors
,
bitmap
->
color_table
+
startpos
,
entries
*
sizeof
(
RGBQUAD
));
result
=
entries
;
result
=
min
(
entries
,
bitmap
->
dib
->
dsBmih
.
biClrUsed
-
startpos
);
memcpy
(
colors
,
bitmap
->
color_table
+
startpos
,
result
*
sizeof
(
RGBQUAD
));
}
}
GDI_ReleaseObj
(
dc
->
hBitmap
);
...
...
@@ -1534,7 +1532,6 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
bmp
->
dib
=
dib
;
bmp
->
funcs
=
physdev
->
funcs
;
bmp
->
color_table
=
color_table
;
bmp
->
nb_colors
=
dib
->
dsBmih
.
biClrUsed
;
GDI_ReleaseObj
(
ret
);
if
(
!
physdev
->
funcs
->
pCreateDIBSection
(
physdev
,
ret
,
info
,
usage
))
...
...
dlls/gdi32/dibdrv/dc.c
View file @
494bfa86
...
...
@@ -206,7 +206,7 @@ BOOL init_dib_info_from_bitmapobj(dib_info *dib, BITMAPOBJ *bmp, enum dib_info_f
flags
|
private_color_table
);
}
return
init_dib_info
(
dib
,
&
bmp
->
dib
->
dsBmih
,
bmp
->
dib
->
dsBitfields
,
bmp
->
color_table
,
bmp
->
nb_colors
,
bmp
->
dib
->
dsBm
.
bmBits
,
flags
);
bmp
->
color_table
,
bmp
->
dib
->
dsBmih
.
biClrUsed
,
bmp
->
dib
->
dsBm
.
bmBits
,
flags
);
}
static
void
clear_dib_info
(
dib_info
*
dib
)
...
...
dlls/gdi32/gdi_private.h
View file @
494bfa86
...
...
@@ -179,8 +179,7 @@ typedef struct tagBITMAPOBJ
const
struct
gdi_dc_funcs
*
funcs
;
/* DC function table */
/* For device-independent bitmaps: */
DIBSECTION
*
dib
;
RGBQUAD
*
color_table
;
/* DIB color table if <= 8bpp */
UINT
nb_colors
;
/* number of colors in table */
RGBQUAD
*
color_table
;
/* DIB color table if <= 8bpp (always 1 << bpp in size) */
}
BITMAPOBJ
;
/* bidi.c */
...
...
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