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
3ea711dd
Commit
3ea711dd
authored
Apr 25, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Store the bounds rectangle as a pointer in the DIB driver.
parent
3009e03d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
36 deletions
+26
-36
bitblt.c
dlls/gdi32/dibdrv/bitblt.c
+5
-5
dc.c
dlls/gdi32/dibdrv/dc.c
+11
-22
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+2
-2
graphics.c
dlls/gdi32/dibdrv/graphics.c
+8
-7
No files found.
dlls/gdi32/dibdrv/bitblt.c
View file @
3ea711dd
...
@@ -964,7 +964,7 @@ DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info
...
@@ -964,7 +964,7 @@ DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info
clip
=
tmp_rgn
;
clip
=
tmp_rgn
;
}
}
else
if
(
!
clip
)
clip
=
pdev
->
clip
;
else
if
(
!
clip
)
clip
=
pdev
->
clip
;
add_clipped_bounds
(
&
pdev
->
bounds
,
&
dst
->
visrect
,
clip
);
add_clipped_bounds
(
pdev
,
&
dst
->
visrect
,
clip
);
}
}
if
(
!
get_clipped_rects
(
dib
,
&
dst
->
visrect
,
clip
,
&
clipped_rects
))
if
(
!
get_clipped_rects
(
dib
,
&
dst
->
visrect
,
clip
,
&
clipped_rects
))
...
@@ -1021,7 +1021,7 @@ DWORD dibdrv_BlendImage( PHYSDEV dev, BITMAPINFO *info, const struct gdi_image_b
...
@@ -1021,7 +1021,7 @@ DWORD dibdrv_BlendImage( PHYSDEV dev, BITMAPINFO *info, const struct gdi_image_b
init_dib_info_from_bitmapinfo
(
&
src_dib
,
info
,
bits
->
ptr
,
0
);
init_dib_info_from_bitmapinfo
(
&
src_dib
,
info
,
bits
->
ptr
,
0
);
src_dib
.
bits
.
is_copy
=
bits
->
is_copy
;
src_dib
.
bits
.
is_copy
=
bits
->
is_copy
;
add_clipped_bounds
(
&
pdev
->
bounds
,
&
dst
->
visrect
,
pdev
->
clip
);
add_clipped_bounds
(
pdev
,
&
dst
->
visrect
,
pdev
->
clip
);
return
blend_rect
(
&
pdev
->
dib
,
&
dst
->
visrect
,
&
src_dib
,
&
src
->
visrect
,
pdev
->
clip
,
blend
);
return
blend_rect
(
&
pdev
->
dib
,
&
dst
->
visrect
,
&
src_dib
,
&
src
->
visrect
,
pdev
->
clip
,
blend
);
update_format:
update_format:
...
@@ -1407,7 +1407,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
...
@@ -1407,7 +1407,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
/* Windows bug: no alpha on a8r8g8b8 created with bitfields */
/* Windows bug: no alpha on a8r8g8b8 created with bitfields */
if
(
pdev
->
dib
.
funcs
==
&
funcs_8888
&&
pdev
->
dib
.
compression
==
BI_BITFIELDS
)
if
(
pdev
->
dib
.
funcs
==
&
funcs_8888
&&
pdev
->
dib
.
compression
==
BI_BITFIELDS
)
vert
[
0
].
Alpha
=
vert
[
1
].
Alpha
=
0
;
vert
[
0
].
Alpha
=
vert
[
1
].
Alpha
=
0
;
add_clipped_bounds
(
&
pdev
->
bounds
,
&
bounds
,
pdev
->
clip
);
add_clipped_bounds
(
pdev
,
&
bounds
,
pdev
->
clip
);
gradient_rect
(
&
pdev
->
dib
,
vert
,
mode
,
pdev
->
clip
,
&
bounds
);
gradient_rect
(
&
pdev
->
dib
,
vert
,
mode
,
pdev
->
clip
,
&
bounds
);
}
}
break
;
break
;
...
@@ -1419,7 +1419,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
...
@@ -1419,7 +1419,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
/* Windows bug: no alpha on a8r8g8b8 created with bitfields */
/* Windows bug: no alpha on a8r8g8b8 created with bitfields */
if
(
pdev
->
dib
.
funcs
==
&
funcs_8888
&&
pdev
->
dib
.
compression
==
BI_BITFIELDS
)
if
(
pdev
->
dib
.
funcs
==
&
funcs_8888
&&
pdev
->
dib
.
compression
==
BI_BITFIELDS
)
vert
[
0
].
Alpha
=
vert
[
1
].
Alpha
=
0
;
vert
[
0
].
Alpha
=
vert
[
1
].
Alpha
=
0
;
add_clipped_bounds
(
&
pdev
->
bounds
,
&
bounds
,
pdev
->
clip
);
add_clipped_bounds
(
pdev
,
&
bounds
,
pdev
->
clip
);
gradient_rect
(
&
pdev
->
dib
,
vert
,
mode
,
pdev
->
clip
,
&
bounds
);
gradient_rect
(
&
pdev
->
dib
,
vert
,
mode
,
pdev
->
clip
,
&
bounds
);
}
}
break
;
break
;
...
@@ -1431,7 +1431,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
...
@@ -1431,7 +1431,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
/* Windows bug: no alpha on a8r8g8b8 created with bitfields */
/* Windows bug: no alpha on a8r8g8b8 created with bitfields */
if
(
pdev
->
dib
.
funcs
==
&
funcs_8888
&&
pdev
->
dib
.
compression
==
BI_BITFIELDS
)
if
(
pdev
->
dib
.
funcs
==
&
funcs_8888
&&
pdev
->
dib
.
compression
==
BI_BITFIELDS
)
vert
[
0
].
Alpha
=
vert
[
1
].
Alpha
=
vert
[
2
].
Alpha
=
0
;
vert
[
0
].
Alpha
=
vert
[
1
].
Alpha
=
vert
[
2
].
Alpha
=
0
;
add_clipped_bounds
(
&
pdev
->
bounds
,
&
bounds
,
pdev
->
clip
);
add_clipped_bounds
(
pdev
,
&
bounds
,
pdev
->
clip
);
if
(
!
gradient_rect
(
&
pdev
->
dib
,
vert
,
mode
,
pdev
->
clip
,
&
bounds
))
ret
=
FALSE
;
if
(
!
gradient_rect
(
&
pdev
->
dib
,
vert
,
mode
,
pdev
->
clip
,
&
bounds
))
ret
=
FALSE
;
}
}
break
;
break
;
...
...
dlls/gdi32/dibdrv/dc.c
View file @
3ea711dd
...
@@ -298,19 +298,22 @@ int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct cl
...
@@ -298,19 +298,22 @@ int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct cl
return
clip_rects
->
count
;
return
clip_rects
->
count
;
}
}
void
add_clipped_bounds
(
RECT
*
bounds
,
const
RECT
*
rect
,
HRGN
clip
)
void
add_clipped_bounds
(
dibdrv_physdev
*
dev
,
const
RECT
*
rect
,
HRGN
clip
)
{
{
const
WINEREGION
*
region
;
const
WINEREGION
*
region
;
RECT
rc
;
RECT
rc
;
if
(
!
dev
->
bounds
)
return
;
if
(
clip
)
if
(
clip
)
{
{
if
(
!
(
region
=
get_wine_region
(
clip
)))
return
;
if
(
!
(
region
=
get_wine_region
(
clip
)))
return
;
if
(
!
rect
)
add_bounds_rect
(
bounds
,
&
region
->
extents
)
;
if
(
!
rect
)
rc
=
region
->
extents
;
else
i
f
(
intersect_rect
(
&
rc
,
rect
,
&
region
->
extents
))
add_bounds_rect
(
bounds
,
&
rc
);
else
i
ntersect_rect
(
&
rc
,
rect
,
&
region
->
extents
);
release_wine_region
(
clip
);
release_wine_region
(
clip
);
}
}
else
if
(
rect
)
add_bounds_rect
(
bounds
,
rect
);
else
rc
=
*
rect
;
add_bounds_rect
(
dev
->
bounds
,
&
rc
);
}
}
/**********************************************************************
/**********************************************************************
...
@@ -325,7 +328,6 @@ static BOOL dibdrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
...
@@ -325,7 +328,6 @@ static BOOL dibdrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
clear_dib_info
(
&
pdev
->
dib
);
clear_dib_info
(
&
pdev
->
dib
);
clear_dib_info
(
&
pdev
->
brush
.
dib
);
clear_dib_info
(
&
pdev
->
brush
.
dib
);
clear_dib_info
(
&
pdev
->
pen_brush
.
dib
);
clear_dib_info
(
&
pdev
->
pen_brush
.
dib
);
reset_bounds
(
&
pdev
->
bounds
);
push_dc_driver
(
dev
,
&
pdev
->
dev
,
&
dib_driver
);
push_dc_driver
(
dev
,
&
pdev
->
dev
,
&
dib_driver
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -395,28 +397,15 @@ static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
...
@@ -395,28 +397,15 @@ static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
}
}
/***********************************************************************
/***********************************************************************
* dibdrv_GetBoundsRect
*/
static
UINT
dibdrv_GetBoundsRect
(
PHYSDEV
dev
,
RECT
*
rect
,
UINT
flags
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
if
(
is_rect_empty
(
&
pdev
->
bounds
))
return
DCB_RESET
;
if
(
rect
)
*
rect
=
pdev
->
bounds
;
if
(
flags
&
DCB_RESET
)
reset_bounds
(
&
pdev
->
bounds
);
return
DCB_SET
;
}
/***********************************************************************
* dibdrv_SetBoundsRect
* dibdrv_SetBoundsRect
*/
*/
static
UINT
dibdrv_SetBoundsRect
(
PHYSDEV
dev
,
RECT
*
rect
,
UINT
flags
)
static
UINT
dibdrv_SetBoundsRect
(
PHYSDEV
dev
,
RECT
*
rect
,
UINT
flags
)
{
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
if
(
is_rect_empty
(
&
pdev
->
bounds
))
return
DCB_RESET
;
if
(
flags
&
DCB_DISABLE
)
pdev
->
bounds
=
NULL
;
if
(
flags
&
DCB_RESET
)
reset_bounds
(
&
pdev
->
bounds
)
;
else
if
(
flags
&
DCB_ENABLE
)
pdev
->
bounds
=
rect
;
return
DCB_
SET
;
return
DCB_
RESET
;
/* we don't have device-specific bounds */
}
}
/***********************************************************************
/***********************************************************************
...
@@ -640,7 +629,7 @@ const struct gdi_dc_funcs dib_driver =
...
@@ -640,7 +629,7 @@ const struct gdi_dc_funcs dib_driver =
NULL
,
/* pFrameRgn */
NULL
,
/* pFrameRgn */
NULL
,
/* pGdiComment */
NULL
,
/* pGdiComment */
NULL
,
/* pGdiRealizationInfo */
NULL
,
/* pGdiRealizationInfo */
dibdrv_GetBoundsRect
,
/* pGetBoundsRect */
NULL
,
/* pGetBoundsRect */
NULL
,
/* pGetCharABCWidths */
NULL
,
/* pGetCharABCWidths */
NULL
,
/* pGetCharABCWidthsI */
NULL
,
/* pGetCharABCWidthsI */
NULL
,
/* pGetCharWidth */
NULL
,
/* pGetCharWidth */
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
3ea711dd
...
@@ -96,7 +96,7 @@ typedef struct dibdrv_physdev
...
@@ -96,7 +96,7 @@ typedef struct dibdrv_physdev
dib_brush
brush
;
dib_brush
brush
;
HRGN
clip
;
HRGN
clip
;
RECT
bounds
;
RECT
*
bounds
;
/* pen */
/* pen */
DWORD
pen_style
,
pen_endcap
,
pen_join
;
DWORD
pen_style
,
pen_endcap
,
pen_join
;
...
@@ -247,7 +247,7 @@ extern COLORREF make_rgb_colorref( HDC hdc, dib_info *dib, COLORREF color, BOOL
...
@@ -247,7 +247,7 @@ extern COLORREF make_rgb_colorref( HDC hdc, dib_info *dib, COLORREF color, BOOL
extern
DWORD
get_pixel_color
(
dibdrv_physdev
*
pdev
,
COLORREF
color
,
BOOL
mono_fixup
)
DECLSPEC_HIDDEN
;
extern
DWORD
get_pixel_color
(
dibdrv_physdev
*
pdev
,
COLORREF
color
,
BOOL
mono_fixup
)
DECLSPEC_HIDDEN
;
extern
BOOL
brush_rect
(
dibdrv_physdev
*
pdev
,
dib_brush
*
brush
,
const
RECT
*
rect
,
HRGN
clip
,
INT
rop
)
DECLSPEC_HIDDEN
;
extern
BOOL
brush_rect
(
dibdrv_physdev
*
pdev
,
dib_brush
*
brush
,
const
RECT
*
rect
,
HRGN
clip
,
INT
rop
)
DECLSPEC_HIDDEN
;
extern
int
get_clipped_rects
(
const
dib_info
*
dib
,
const
RECT
*
rc
,
HRGN
clip
,
struct
clipped_rects
*
clip_rects
)
DECLSPEC_HIDDEN
;
extern
int
get_clipped_rects
(
const
dib_info
*
dib
,
const
RECT
*
rc
,
HRGN
clip
,
struct
clipped_rects
*
clip_rects
)
DECLSPEC_HIDDEN
;
extern
void
add_clipped_bounds
(
RECT
*
bounds
,
const
RECT
*
rect
,
HRGN
clip
)
DECLSPEC_HIDDEN
;
extern
void
add_clipped_bounds
(
dibdrv_physdev
*
dev
,
const
RECT
*
rect
,
HRGN
clip
)
DECLSPEC_HIDDEN
;
extern
int
clip_line
(
const
POINT
*
start
,
const
POINT
*
end
,
const
RECT
*
clip
,
extern
int
clip_line
(
const
POINT
*
start
,
const
POINT
*
end
,
const
RECT
*
clip
,
const
bres_params
*
params
,
POINT
*
pt1
,
POINT
*
pt2
)
DECLSPEC_HIDDEN
;
const
bres_params
*
params
,
POINT
*
pt1
,
POINT
*
pt2
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/dibdrv/graphics.c
View file @
3ea711dd
...
@@ -92,6 +92,7 @@ static void add_pen_lines_bounds( dibdrv_physdev *dev, int count, const POINT *p
...
@@ -92,6 +92,7 @@ static void add_pen_lines_bounds( dibdrv_physdev *dev, int count, const POINT *p
RECT
bounds
,
rect
;
RECT
bounds
,
rect
;
int
width
=
0
;
int
width
=
0
;
if
(
!
dev
->
bounds
)
return
;
reset_bounds
(
&
bounds
);
reset_bounds
(
&
bounds
);
if
(
dev
->
pen_uses_region
)
if
(
dev
->
pen_uses_region
)
...
@@ -127,7 +128,7 @@ static void add_pen_lines_bounds( dibdrv_physdev *dev, int count, const POINT *p
...
@@ -127,7 +128,7 @@ static void add_pen_lines_bounds( dibdrv_physdev *dev, int count, const POINT *p
points
++
;
points
++
;
}
}
add_clipped_bounds
(
&
dev
->
bounds
,
&
bounds
,
dev
->
clip
);
add_clipped_bounds
(
dev
,
&
bounds
,
dev
->
clip
);
}
}
/* compute the points for the first quadrant of an ellipse, counterclockwise from the x axis */
/* compute the points for the first quadrant of an ellipse, counterclockwise from the x axis */
...
@@ -703,7 +704,7 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
...
@@ -703,7 +704,7 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
origin
.
y
+=
metrics
.
gmCellIncY
;
origin
.
y
+=
metrics
.
gmCellIncY
;
}
}
}
}
add_clipped_bounds
(
&
pdev
->
bounds
,
&
bounds
,
pdev
->
clip
);
add_clipped_bounds
(
pdev
,
&
bounds
,
pdev
->
clip
);
done:
done:
free_clipped_rects
(
&
clipped_rects
);
free_clipped_rects
(
&
clipped_rects
);
...
@@ -805,7 +806,7 @@ BOOL dibdrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type )
...
@@ -805,7 +806,7 @@ BOOL dibdrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type )
if
(
!
is_interior
(
&
pdev
->
dib
,
pdev
->
clip
,
x
,
y
,
pixel
,
type
))
return
FALSE
;
if
(
!
is_interior
(
&
pdev
->
dib
,
pdev
->
clip
,
x
,
y
,
pixel
,
type
))
return
FALSE
;
rgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
)
;
if
(
!
(
rgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
return
FALSE
;
row
.
left
=
x
;
row
.
left
=
x
;
row
.
right
=
x
+
1
;
row
.
right
=
x
+
1
;
row
.
top
=
y
;
row
.
top
=
y
;
...
@@ -813,7 +814,7 @@ BOOL dibdrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type )
...
@@ -813,7 +814,7 @@ BOOL dibdrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type )
fill_row
(
&
pdev
->
dib
,
pdev
->
clip
,
&
row
,
pixel
,
type
,
rgn
);
fill_row
(
&
pdev
->
dib
,
pdev
->
clip
,
&
row
,
pixel
,
type
,
rgn
);
add_clipped_bounds
(
&
pdev
->
bounds
,
NULL
,
rgn
);
add_clipped_bounds
(
pdev
,
NULL
,
rgn
);
brush_region
(
pdev
,
rgn
);
brush_region
(
pdev
,
rgn
);
DeleteObject
(
rgn
);
DeleteObject
(
rgn
);
...
@@ -908,7 +909,7 @@ BOOL dibdrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
...
@@ -908,7 +909,7 @@ BOOL dibdrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
TRACE
(
"(%p, %d, %d, %d, %d, %06x)
\n
"
,
dev
,
dst
->
x
,
dst
->
y
,
dst
->
width
,
dst
->
height
,
rop
);
TRACE
(
"(%p, %d, %d, %d, %d, %06x)
\n
"
,
dev
,
dst
->
x
,
dst
->
y
,
dst
->
width
,
dst
->
height
,
rop
);
add_
bounds_rect
(
&
pdev
->
bounds
,
&
dst
->
visrect
);
add_
clipped_bounds
(
pdev
,
&
dst
->
visrect
,
0
);
return
brush_rect
(
pdev
,
&
pdev
->
brush
,
&
dst
->
visrect
,
pdev
->
clip
,
get_rop2_from_rop
(
rop
)
);
return
brush_rect
(
pdev
,
&
pdev
->
brush
,
&
dst
->
visrect
,
pdev
->
clip
,
get_rop2_from_rop
(
rop
)
);
}
}
...
@@ -938,7 +939,7 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn )
...
@@ -938,7 +939,7 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn )
}
}
release_wine_region
(
rgn
);
release_wine_region
(
rgn
);
add_clipped_bounds
(
&
pdev
->
bounds
,
&
bounds
,
pdev
->
clip
);
add_clipped_bounds
(
pdev
,
&
bounds
,
pdev
->
clip
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -1277,7 +1278,7 @@ COLORREF dibdrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
...
@@ -1277,7 +1278,7 @@ COLORREF dibdrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
rect
.
top
=
pt
.
y
;
rect
.
top
=
pt
.
y
;
rect
.
right
=
rect
.
left
+
1
;
rect
.
right
=
rect
.
left
+
1
;
rect
.
bottom
=
rect
.
top
+
1
;
rect
.
bottom
=
rect
.
top
+
1
;
add_clipped_bounds
(
&
pdev
->
bounds
,
&
rect
,
pdev
->
clip
);
add_clipped_bounds
(
pdev
,
&
rect
,
pdev
->
clip
);
/* SetPixel doesn't do the 1bpp massaging like other fg colors */
/* SetPixel doesn't do the 1bpp massaging like other fg colors */
pixel
=
get_pixel_color
(
pdev
,
color
,
FALSE
);
pixel
=
get_pixel_color
(
pdev
,
color
,
FALSE
);
...
...
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