Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1e83fd00
Commit
1e83fd00
authored
Aug 19, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Aug 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use the gdi_image_bits structure to maintain the dib driver's bits.
parent
2e908e06
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
23 deletions
+31
-23
dc.c
dlls/gdi32/dibdrv/dc.c
+13
-10
objects.c
dlls/gdi32/dibdrv/objects.c
+10
-4
primitives.c
dlls/gdi32/dibdrv/primitives.c
+7
-7
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-2
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
1e83fd00
...
...
@@ -73,8 +73,10 @@ static BOOL init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD
dib
->
width
=
bi
->
biWidth
;
dib
->
height
=
bi
->
biHeight
;
dib
->
stride
=
get_dib_stride
(
dib
->
width
,
dib
->
bit_count
);
dib
->
bits
=
bits
;
dib
->
ptr_to_free
=
NULL
;
dib
->
bits
.
ptr
=
bits
;
dib
->
bits
.
is_copy
=
FALSE
;
dib
->
bits
.
free
=
NULL
;
dib
->
bits
.
param
=
NULL
;
dib
->
flags
=
flags
;
if
(
dib
->
height
<
0
)
/* top-down */
...
...
@@ -84,7 +86,7 @@ static BOOL init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD
else
/* bottom-up */
{
/* bits always points to the top-left corner and the stride is -ve */
dib
->
bits
=
(
BYTE
*
)
dib
->
bits
+
(
dib
->
height
-
1
)
*
dib
->
stride
;
dib
->
bits
.
ptr
=
(
BYTE
*
)
dib
->
bits
.
ptr
+
(
dib
->
height
-
1
)
*
dib
->
stride
;
dib
->
stride
=
-
dib
->
stride
;
}
...
...
@@ -211,8 +213,9 @@ BOOL init_dib_info_from_bitmapinfo(dib_info *dib, const BITMAPINFO *info, void *
static
void
clear_dib_info
(
dib_info
*
dib
)
{
dib
->
color_table
=
NULL
;
dib
->
bits
=
NULL
;
dib
->
ptr_to_free
=
NULL
;
dib
->
bits
.
ptr
=
NULL
;
dib
->
bits
.
free
=
NULL
;
dib
->
bits
.
param
=
NULL
;
}
/**********************************************************************
...
...
@@ -224,11 +227,9 @@ void free_dib_info(dib_info *dib)
{
if
(
dib
->
flags
&
private_color_table
)
HeapFree
(
GetProcessHeap
(),
0
,
dib
->
color_table
);
dib
->
color_table
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
dib
->
ptr_to_free
);
dib
->
ptr_to_free
=
NULL
;
dib
->
bits
=
NULL
;
if
(
dib
->
bits
.
free
)
dib
->
bits
.
free
(
&
dib
->
bits
);
clear_dib_info
(
dib
);
}
void
copy_dib_color_info
(
dib_info
*
dst
,
const
dib_info
*
src
)
...
...
@@ -423,7 +424,7 @@ static DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
if
(
bits
)
{
bits
->
ptr
=
dib
->
bits
;
bits
->
ptr
=
dib
->
bits
.
ptr
;
if
(
dib
->
stride
<
0
)
bits
->
ptr
=
(
char
*
)
bits
->
ptr
+
(
dib
->
height
-
1
)
*
dib
->
stride
;
bits
->
is_copy
=
FALSE
;
...
...
@@ -479,6 +480,7 @@ static inline BOOL rop_uses_pat(DWORD rop)
return
((
rop
>>
4
)
&
0x0f0000
)
!=
(
rop
&
0x0f0000
);
}
/***********************************************************************
* dibdrv_PutImage
*/
...
...
@@ -541,6 +543,7 @@ static DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINF
}
init_dib_info_from_bitmapinfo
(
&
src_dib
,
info
,
bits
->
ptr
,
0
);
src_dib
.
bits
.
is_copy
=
bits
->
is_copy
;
origin
.
x
=
src
->
visrect
.
left
;
origin
.
y
=
src
->
visrect
.
top
;
...
...
dlls/gdi32/dibdrv/objects.c
View file @
1e83fd00
...
...
@@ -1089,7 +1089,7 @@ void free_pattern_brush( dibdrv_physdev *pdev )
static
BOOL
create_pattern_brush_bits
(
dibdrv_physdev
*
pdev
)
{
DWORD
size
=
pdev
->
brush_dib
.
height
*
abs
(
pdev
->
brush_dib
.
stride
);
DWORD
*
brush_bits
=
pdev
->
brush_dib
.
bits
;
DWORD
*
brush_bits
=
pdev
->
brush_dib
.
bits
.
ptr
;
DWORD
*
and_bits
,
*
xor_bits
;
assert
(
pdev
->
brush_and_bits
==
NULL
);
...
...
@@ -1161,7 +1161,9 @@ static BOOL create_hatch_brush_bits(dibdrv_physdev *pdev)
hatch
.
bit_count
=
1
;
hatch
.
height
=
hatch
.
width
=
8
;
hatch
.
stride
=
4
;
hatch
.
bits
=
(
void
*
)
hatches
[
pdev
->
brush_hatch
];
hatch
.
bits
.
ptr
=
(
void
*
)
hatches
[
pdev
->
brush_hatch
];
hatch
.
bits
.
free
=
hatch
.
bits
.
param
=
NULL
;
hatch
.
bits
.
is_copy
=
FALSE
;
fg_mask
.
and
=
pdev
->
brush_and
;
fg_mask
.
xor
=
pdev
->
brush_xor
;
...
...
@@ -1306,8 +1308,12 @@ HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
pdev
->
brush_dib
.
height
=
orig_dib
.
height
;
pdev
->
brush_dib
.
width
=
orig_dib
.
width
;
pdev
->
brush_dib
.
stride
=
get_dib_stride
(
pdev
->
brush_dib
.
width
,
pdev
->
brush_dib
.
bit_count
);
pdev
->
brush_dib
.
ptr_to_free
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pdev
->
brush_dib
.
height
*
pdev
->
brush_dib
.
stride
);
pdev
->
brush_dib
.
bits
=
pdev
->
brush_dib
.
ptr_to_free
;
pdev
->
brush_dib
.
bits
.
param
=
NULL
;
pdev
->
brush_dib
.
bits
.
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pdev
->
brush_dib
.
height
*
pdev
->
brush_dib
.
stride
);
pdev
->
brush_dib
.
bits
.
is_copy
=
TRUE
;
pdev
->
brush_dib
.
bits
.
free
=
free_heap_bits
;
rect
.
left
=
rect
.
top
=
0
;
rect
.
right
=
orig_dib
.
width
;
...
...
dlls/gdi32/dibdrv/primitives.c
View file @
1e83fd00
...
...
@@ -29,37 +29,37 @@ WINE_DEFAULT_DEBUG_CHANNEL(dib);
static
inline
DWORD
*
get_pixel_ptr_32
(
const
dib_info
*
dib
,
int
x
,
int
y
)
{
return
(
DWORD
*
)((
BYTE
*
)
dib
->
bits
+
y
*
dib
->
stride
+
x
*
4
);
return
(
DWORD
*
)((
BYTE
*
)
dib
->
bits
.
ptr
+
y
*
dib
->
stride
+
x
*
4
);
}
static
inline
DWORD
*
get_pixel_ptr_24_dword
(
const
dib_info
*
dib
,
int
x
,
int
y
)
{
return
(
DWORD
*
)((
BYTE
*
)
dib
->
bits
+
y
*
dib
->
stride
)
+
x
*
3
/
4
;
return
(
DWORD
*
)((
BYTE
*
)
dib
->
bits
.
ptr
+
y
*
dib
->
stride
)
+
x
*
3
/
4
;
}
static
inline
BYTE
*
get_pixel_ptr_24
(
const
dib_info
*
dib
,
int
x
,
int
y
)
{
return
(
BYTE
*
)
dib
->
bits
+
y
*
dib
->
stride
+
x
*
3
;
return
(
BYTE
*
)
dib
->
bits
.
ptr
+
y
*
dib
->
stride
+
x
*
3
;
}
static
inline
WORD
*
get_pixel_ptr_16
(
const
dib_info
*
dib
,
int
x
,
int
y
)
{
return
(
WORD
*
)((
BYTE
*
)
dib
->
bits
+
y
*
dib
->
stride
+
x
*
2
);
return
(
WORD
*
)((
BYTE
*
)
dib
->
bits
.
ptr
+
y
*
dib
->
stride
+
x
*
2
);
}
static
inline
BYTE
*
get_pixel_ptr_8
(
const
dib_info
*
dib
,
int
x
,
int
y
)
{
return
(
BYTE
*
)
dib
->
bits
+
y
*
dib
->
stride
+
x
;
return
(
BYTE
*
)
dib
->
bits
.
ptr
+
y
*
dib
->
stride
+
x
;
}
static
inline
BYTE
*
get_pixel_ptr_4
(
const
dib_info
*
dib
,
int
x
,
int
y
)
{
return
(
BYTE
*
)
dib
->
bits
+
y
*
dib
->
stride
+
x
/
2
;
return
(
BYTE
*
)
dib
->
bits
.
ptr
+
y
*
dib
->
stride
+
x
/
2
;
}
static
inline
BYTE
*
get_pixel_ptr_1
(
const
dib_info
*
dib
,
int
x
,
int
y
)
{
return
(
BYTE
*
)
dib
->
bits
+
y
*
dib
->
stride
+
x
/
8
;
return
(
BYTE
*
)
dib
->
bits
.
ptr
+
y
*
dib
->
stride
+
x
/
8
;
}
static
const
BYTE
pixel_masks_1
[
8
]
=
{
0x80
,
0x40
,
0x20
,
0x10
,
0x08
,
0x04
,
0x02
,
0x01
};
...
...
dlls/gdi32/gdi_private.h
View file @
1e83fd00
...
...
@@ -83,8 +83,7 @@ typedef struct
{
int
bit_count
,
width
,
height
;
int
stride
;
/* stride in bytes. Will be -ve for bottom-up dibs (see bits). */
void
*
bits
;
/* points to the top-left corner of the dib. */
void
*
ptr_to_free
;
struct
gdi_image_bits
bits
;
/* bits.ptr points to the top-left corner of the dib. */
DWORD
red_mask
,
green_mask
,
blue_mask
;
int
red_shift
,
green_shift
,
blue_shift
;
...
...
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