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
a3a574fa
Commit
a3a574fa
authored
Oct 14, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Implement a BlendImage entry point in the DIB driver.
parent
7a4349bb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
1 deletion
+77
-1
bitblt.c
dlls/gdi32/dibdrv/bitblt.c
+72
-0
dc.c
dlls/gdi32/dibdrv/dc.c
+1
-1
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+4
-0
primitives.c
dlls/gdi32/dibdrv/primitives.c
+0
-0
No files found.
dlls/gdi32/dibdrv/bitblt.c
View file @
a3a574fa
...
@@ -572,6 +572,35 @@ static DWORD copy_rect( dib_info *dst, const RECT *dst_rect, const dib_info *src
...
@@ -572,6 +572,35 @@ static DWORD copy_rect( dib_info *dst, const RECT *dst_rect, const dib_info *src
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
static
DWORD
blend_rect
(
dib_info
*
dst
,
const
RECT
*
dst_rect
,
const
dib_info
*
src
,
const
RECT
*
src_rect
,
HRGN
clip
,
BLENDFUNCTION
blend
)
{
POINT
origin
;
RECT
clipped_rect
;
const
WINEREGION
*
clip_data
;
int
i
;
origin
.
x
=
src_rect
->
left
;
origin
.
y
=
src_rect
->
top
;
if
(
clip
==
NULL
)
dst
->
funcs
->
blend_rect
(
dst
,
dst_rect
,
src
,
&
origin
,
blend
);
else
{
clip_data
=
get_wine_region
(
clip
);
for
(
i
=
0
;
i
<
clip_data
->
numRects
;
i
++
)
{
if
(
intersect_rect
(
&
clipped_rect
,
dst_rect
,
clip_data
->
rects
+
i
))
{
origin
.
x
=
src_rect
->
left
+
clipped_rect
.
left
-
dst_rect
->
left
;
origin
.
y
=
src_rect
->
top
+
clipped_rect
.
top
-
dst_rect
->
top
;
dst
->
funcs
->
blend_rect
(
dst
,
&
clipped_rect
,
src
,
&
origin
,
blend
);
}
}
release_wine_region
(
clip
);
}
return
ERROR_SUCCESS
;
}
static
DWORD
copy_src_bits
(
dib_info
*
src
,
RECT
*
src_rect
)
static
DWORD
copy_src_bits
(
dib_info
*
src
,
RECT
*
src_rect
)
{
{
int
y
,
stride
=
get_dib_stride
(
src
->
width
,
src
->
bit_count
);
int
y
,
stride
=
get_dib_stride
(
src
->
width
,
src
->
bit_count
);
...
@@ -906,6 +935,49 @@ done:
...
@@ -906,6 +935,49 @@ done:
return
ret
;
return
ret
;
}
}
/***********************************************************************
* dibdrv_BlendImage
*/
DWORD
dibdrv_BlendImage
(
PHYSDEV
dev
,
BITMAPINFO
*
info
,
const
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
,
struct
bitblt_coords
*
dst
,
BLENDFUNCTION
blend
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dib_info
src_dib
;
DWORD
ret
;
TRACE
(
"%p %p
\n
"
,
dev
,
info
);
if
(
info
->
bmiHeader
.
biPlanes
!=
1
)
goto
update_format
;
if
(
info
->
bmiHeader
.
biBitCount
!=
32
)
goto
update_format
;
if
(
info
->
bmiHeader
.
biCompression
==
BI_BITFIELDS
)
{
DWORD
*
masks
=
(
DWORD
*
)
info
->
bmiColors
;
if
(
masks
[
0
]
!=
0xff0000
||
masks
[
1
]
!=
0x00ff00
||
masks
[
2
]
!=
0x0000ff
)
goto
update_format
;
}
if
(
!
bits
)
return
ERROR_SUCCESS
;
if
((
src
->
width
!=
dst
->
width
)
||
(
src
->
height
!=
dst
->
height
))
return
ERROR_TRANSFORM_NOT_SUPPORTED
;
init_dib_info_from_bitmapinfo
(
&
src_dib
,
info
,
bits
->
ptr
,
0
);
src_dib
.
bits
.
is_copy
=
bits
->
is_copy
;
ret
=
blend_rect
(
&
pdev
->
dib
,
&
dst
->
visrect
,
&
src_dib
,
&
src
->
visrect
,
pdev
->
clip
,
blend
);
free_dib_info
(
&
src_dib
);
return
ret
;
update_format:
if
(
blend
.
AlphaFormat
&
AC_SRC_ALPHA
)
/* source alpha requires A8R8G8B8 format */
return
ERROR_INVALID_PARAMETER
;
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biBitCount
=
32
;
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
info
->
bmiHeader
.
biClrUsed
=
0
;
return
ERROR_BAD_FORMAT
;
}
/****************************************************************************
/****************************************************************************
* calc_1d_stretch_params (helper for stretch_bitmapinfo)
* calc_1d_stretch_params (helper for stretch_bitmapinfo)
*
*
...
...
dlls/gdi32/dibdrv/dc.c
View file @
a3a574fa
...
@@ -518,7 +518,7 @@ const DC_FUNCTIONS dib_driver =
...
@@ -518,7 +518,7 @@ const DC_FUNCTIONS dib_driver =
NULL
,
/* pArc */
NULL
,
/* pArc */
NULL
,
/* pArcTo */
NULL
,
/* pArcTo */
NULL
,
/* pBeginPath */
NULL
,
/* pBeginPath */
NULL
,
/* pBlendImage */
dibdrv_BlendImage
,
/* pBlendImage */
NULL
,
/* pChoosePixelFormat */
NULL
,
/* pChoosePixelFormat */
NULL
,
/* pChord */
NULL
,
/* pChord */
NULL
,
/* pCloseFigure */
NULL
,
/* pCloseFigure */
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
a3a574fa
...
@@ -102,6 +102,8 @@ typedef struct dibdrv_physdev
...
@@ -102,6 +102,8 @@ typedef struct dibdrv_physdev
extern
BOOL
dibdrv_AlphaBlend
(
PHYSDEV
dst_dev
,
struct
bitblt_coords
*
dst
,
extern
BOOL
dibdrv_AlphaBlend
(
PHYSDEV
dst_dev
,
struct
bitblt_coords
*
dst
,
PHYSDEV
src_dev
,
struct
bitblt_coords
*
src
,
BLENDFUNCTION
blend
)
DECLSPEC_HIDDEN
;
PHYSDEV
src_dev
,
struct
bitblt_coords
*
src
,
BLENDFUNCTION
blend
)
DECLSPEC_HIDDEN
;
extern
DWORD
dibdrv_BlendImage
(
PHYSDEV
dev
,
BITMAPINFO
*
info
,
const
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
,
struct
bitblt_coords
*
dst
,
BLENDFUNCTION
func
)
DECLSPEC_HIDDEN
;
extern
DWORD
dibdrv_GetImage
(
PHYSDEV
dev
,
HBITMAP
hbitmap
,
BITMAPINFO
*
info
,
extern
DWORD
dibdrv_GetImage
(
PHYSDEV
dev
,
HBITMAP
hbitmap
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
)
DECLSPEC_HIDDEN
;
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
)
DECLSPEC_HIDDEN
;
extern
BOOL
dibdrv_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
DECLSPEC_HIDDEN
;
extern
BOOL
dibdrv_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
DECLSPEC_HIDDEN
;
...
@@ -140,6 +142,8 @@ typedef struct primitive_funcs
...
@@ -140,6 +142,8 @@ typedef struct primitive_funcs
const
dib_info
*
brush
,
void
*
and_bits
,
void
*
xor_bits
);
const
dib_info
*
brush
,
void
*
and_bits
,
void
*
xor_bits
);
void
(
*
copy_rect
)(
const
dib_info
*
dst
,
const
RECT
*
rc
,
const
dib_info
*
src
,
void
(
*
copy_rect
)(
const
dib_info
*
dst
,
const
RECT
*
rc
,
const
dib_info
*
src
,
const
POINT
*
origin
,
int
rop2
,
int
overlap
);
const
POINT
*
origin
,
int
rop2
,
int
overlap
);
void
(
*
blend_rect
)(
const
dib_info
*
dst
,
const
RECT
*
rc
,
const
dib_info
*
src
,
const
POINT
*
origin
,
BLENDFUNCTION
blend
);
DWORD
(
*
colorref_to_pixel
)(
const
dib_info
*
dib
,
COLORREF
color
);
DWORD
(
*
colorref_to_pixel
)(
const
dib_info
*
dib
,
COLORREF
color
);
void
(
*
convert_to
)(
dib_info
*
dst
,
const
dib_info
*
src
,
const
RECT
*
src_rect
);
void
(
*
convert_to
)(
dib_info
*
dst
,
const
dib_info
*
src
,
const
RECT
*
src_rect
);
BOOL
(
*
create_rop_masks
)(
const
dib_info
*
dib
,
const
dib_info
*
hatch
,
BOOL
(
*
create_rop_masks
)(
const
dib_info
*
dib
,
const
dib_info
*
hatch
,
...
...
dlls/gdi32/dibdrv/primitives.c
View file @
a3a574fa
This diff is collapsed.
Click to expand it.
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