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
5ac51cd2
Commit
5ac51cd2
authored
May 12, 2011
by
Huw Davies
Committed by
Alexandre Julliard
May 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add helpers to clear and free dib_info structures.
parent
735657d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
13 deletions
+35
-13
dc.c
dlls/gdi32/dibdrv/dc.c
+35
-13
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
5ac51cd2
...
...
@@ -27,17 +27,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dib
);
/***********************************************************************
* dibdrv_DeleteDC
*/
static
BOOL
CDECL
dibdrv_DeleteDC
(
PHYSDEV
dev
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
TRACE
(
"(%p)
\n
"
,
dev
);
DeleteObject
(
pdev
->
clip
);
return
0
;
}
static
void
calc_shift_and_len
(
DWORD
mask
,
int
*
shift
,
int
*
len
)
{
int
s
,
l
;
...
...
@@ -74,7 +63,7 @@ static void init_bit_fields(dib_info *dib, const DWORD *bit_fields)
calc_shift_and_len
(
dib
->
blue_mask
,
&
dib
->
blue_shift
,
&
dib
->
blue_len
);
}
static
BOOL
init_dib
(
dib_info
*
dib
,
const
BITMAPINFOHEADER
*
bi
,
const
DWORD
*
bit_fields
,
void
*
bits
)
static
BOOL
init_dib
_info
(
dib_info
*
dib
,
const
BITMAPINFOHEADER
*
bi
,
const
DWORD
*
bit_fields
,
void
*
bits
)
{
static
const
DWORD
bit_fields_888
[
3
]
=
{
0xff0000
,
0x00ff00
,
0x0000ff
};
...
...
@@ -119,6 +108,37 @@ static BOOL init_dib(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit
return
TRUE
;
}
static
void
clear_dib_info
(
dib_info
*
dib
)
{
dib
->
bits
=
NULL
;
}
/**********************************************************************
* free_dib_info
*
* Free the resources associated with a dib and optionally the bits
*/
static
void
free_dib_info
(
dib_info
*
dib
,
BOOL
free_bits
)
{
if
(
free_bits
)
{
HeapFree
(
GetProcessHeap
(),
0
,
dib
->
bits
);
dib
->
bits
=
NULL
;
}
}
/***********************************************************************
* dibdrv_DeleteDC
*/
static
BOOL
CDECL
dibdrv_DeleteDC
(
PHYSDEV
dev
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
TRACE
(
"(%p)
\n
"
,
dev
);
DeleteObject
(
pdev
->
clip
);
free_dib_info
(
&
pdev
->
dib
,
FALSE
);
return
0
;
}
/***********************************************************************
* dibdrv_SelectBitmap
*/
...
...
@@ -135,7 +155,9 @@ static HBITMAP CDECL dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
pdev
->
clip
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
pdev
->
defer
=
0
;
if
(
!
init_dib
(
&
pdev
->
dib
,
&
bmp
->
dib
->
dsBmih
,
bmp
->
dib
->
dsBitfields
,
bmp
->
dib
->
dsBm
.
bmBits
))
clear_dib_info
(
&
pdev
->
dib
);
if
(
!
init_dib_info
(
&
pdev
->
dib
,
&
bmp
->
dib
->
dsBmih
,
bmp
->
dib
->
dsBitfields
,
bmp
->
dib
->
dsBm
.
bmBits
))
pdev
->
defer
|=
DEFER_FORMAT
;
GDI_ReleaseObj
(
bitmap
);
...
...
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