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
8b3271c3
Commit
8b3271c3
authored
Dec 27, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Avoid making a copy of the device clipping region in the DIB driver.
parent
56373bc4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
41 deletions
+10
-41
bitblt.c
dlls/gdi32/dibdrv/bitblt.c
+9
-4
dc.c
dlls/gdi32/dibdrv/dc.c
+1
-35
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+0
-2
No files found.
dlls/gdi32/dibdrv/bitblt.c
View file @
8b3271c3
...
...
@@ -929,7 +929,7 @@ DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info
struct
clipped_rects
clipped_rects
;
DWORD
ret
;
dib_info
src_dib
;
HRGN
saved_clip
=
NULL
;
HRGN
tmp_rgn
=
0
;
dibdrv_physdev
*
pdev
=
NULL
;
TRACE
(
"%p %p %p
\n
"
,
dev
,
hbitmap
,
info
);
...
...
@@ -972,8 +972,13 @@ DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info
if
(
!
hbitmap
)
{
if
(
clip
)
saved_clip
=
add_extra_clipping_region
(
pdev
,
clip
);
clip
=
pdev
->
clip
;
if
(
clip
&&
pdev
->
clip
)
{
tmp_rgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
CombineRgn
(
tmp_rgn
,
clip
,
pdev
->
clip
,
RGN_AND
);
clip
=
tmp_rgn
;
}
else
if
(
!
clip
)
clip
=
pdev
->
clip
;
}
if
(
!
get_clipped_rects
(
dib
,
&
dst
->
visrect
,
clip
,
&
clipped_rects
))
...
...
@@ -1000,7 +1005,7 @@ update_format:
ret
=
ERROR_BAD_FORMAT
;
done:
if
(
saved_clip
)
restore_clipping_region
(
pdev
,
saved_clip
);
if
(
tmp_rgn
)
DeleteObject
(
tmp_rgn
);
if
(
hbitmap
)
GDI_ReleaseObj
(
hbitmap
);
return
ret
;
}
...
...
dlls/gdi32/dibdrv/dc.c
View file @
8b3271c3
...
...
@@ -298,33 +298,6 @@ int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct cl
return
clip_rects
->
count
;
}
/***********************************************************************
* add_extra_clipping_region
*
* Temporarily add a region to the current clipping region.
* The returned region must be restored with restore_clipping_region.
*/
HRGN
add_extra_clipping_region
(
dibdrv_physdev
*
pdev
,
HRGN
rgn
)
{
HRGN
ret
,
clip
;
if
(
!
(
clip
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
return
0
;
CombineRgn
(
clip
,
pdev
->
clip
,
rgn
,
RGN_AND
);
ret
=
pdev
->
clip
;
pdev
->
clip
=
clip
;
return
ret
;
}
/***********************************************************************
* restore_clipping_region
*/
void
restore_clipping_region
(
dibdrv_physdev
*
pdev
,
HRGN
rgn
)
{
if
(
!
rgn
)
return
;
DeleteObject
(
pdev
->
clip
);
pdev
->
clip
=
rgn
;
}
/**********************************************************************
* dibdrv_CreateDC
*/
...
...
@@ -334,11 +307,6 @@ static BOOL dibdrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
dibdrv_physdev
*
pdev
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
pdev
)
);
if
(
!
pdev
)
return
FALSE
;
if
(
!
(
pdev
->
clip
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
pdev
);
return
FALSE
;
}
clear_dib_info
(
&
pdev
->
dib
);
clear_dib_info
(
&
pdev
->
brush_dib
);
push_dc_driver
(
dev
,
&
pdev
->
dev
,
&
dib_driver
);
...
...
@@ -352,7 +320,6 @@ static BOOL dibdrv_DeleteDC( PHYSDEV dev )
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
TRACE
(
"(%p)
\n
"
,
dev
);
DeleteObject
(
pdev
->
clip
);
free_pattern_brush
(
pdev
);
HeapFree
(
GetProcessHeap
(),
0
,
pdev
);
return
TRUE
;
...
...
@@ -409,8 +376,7 @@ static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
TRACE
(
"(%p, %p)
\n
"
,
dev
,
rgn
);
SetRectRgn
(
pdev
->
clip
,
0
,
0
,
pdev
->
dib
.
width
,
pdev
->
dib
.
height
);
if
(
rgn
)
CombineRgn
(
pdev
->
clip
,
pdev
->
clip
,
rgn
,
RGN_AND
);
pdev
->
clip
=
rgn
;
return
next
->
funcs
->
pSetDeviceClipping
(
next
,
rgn
);
}
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
8b3271c3
...
...
@@ -232,8 +232,6 @@ 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
BOOL
brush_rect
(
dibdrv_physdev
*
pdev
,
const
RECT
*
rect
)
DECLSPEC_HIDDEN
;
extern
int
get_clipped_rects
(
const
dib_info
*
dib
,
const
RECT
*
rc
,
HRGN
clip
,
struct
clipped_rects
*
clip_rects
)
DECLSPEC_HIDDEN
;
extern
HRGN
add_extra_clipping_region
(
dibdrv_physdev
*
pdev
,
HRGN
rgn
)
DECLSPEC_HIDDEN
;
extern
void
restore_clipping_region
(
dibdrv_physdev
*
pdev
,
HRGN
rgn
)
DECLSPEC_HIDDEN
;
extern
int
clip_line
(
const
POINT
*
start
,
const
POINT
*
end
,
const
RECT
*
clip
,
const
bres_params
*
params
,
POINT
*
pt1
,
POINT
*
pt2
)
DECLSPEC_HIDDEN
;
...
...
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