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
4e13c06f
Commit
4e13c06f
authored
Jul 13, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add a helper function for copying bits from a window surface.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4f88a57c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
21 deletions
+33
-21
painting.c
dlls/user32/painting.c
+31
-19
user_private.h
dlls/user32/user_private.h
+1
-1
winpos.c
dlls/user32/winpos.c
+1
-1
No files found.
dlls/user32/painting.c
View file @
4e13c06f
...
@@ -760,6 +760,32 @@ void erase_now( HWND hwnd, UINT rdw_flags )
...
@@ -760,6 +760,32 @@ void erase_now( HWND hwnd, UINT rdw_flags )
/***********************************************************************
/***********************************************************************
* copy_bits_from_surface
*
* Copy bits from a window surface; helper for move_window_bits and move_window_bits_parent.
*/
static
void
copy_bits_from_surface
(
HWND
hwnd
,
struct
window_surface
*
surface
,
const
RECT
*
dst
,
const
RECT
*
src
)
{
char
buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)];
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
buffer
;
void
*
bits
;
UINT
flags
=
UPDATE_NOCHILDREN
;
HRGN
rgn
=
get_update_region
(
hwnd
,
&
flags
,
NULL
);
HDC
hdc
=
GetDCEx
(
hwnd
,
rgn
,
DCX_CACHE
|
DCX_WINDOW
|
DCX_EXCLUDERGN
);
bits
=
surface
->
funcs
->
get_info
(
surface
,
info
);
surface
->
funcs
->
lock
(
surface
);
SetDIBitsToDevice
(
hdc
,
dst
->
left
,
dst
->
top
,
dst
->
right
-
dst
->
left
,
dst
->
bottom
-
dst
->
top
,
src
->
left
-
surface
->
rect
.
left
,
surface
->
rect
.
bottom
-
src
->
bottom
,
0
,
surface
->
rect
.
bottom
-
surface
->
rect
.
top
,
bits
,
info
,
DIB_RGB_COLORS
);
surface
->
funcs
->
unlock
(
surface
);
ReleaseDC
(
hwnd
,
hdc
);
}
/***********************************************************************
* move_window_bits
* move_window_bits
*
*
* Move the window bits when a window is resized or its surface recreated.
* Move the window bits when a window is resized or its surface recreated.
...
@@ -767,7 +793,7 @@ void erase_now( HWND hwnd, UINT rdw_flags )
...
@@ -767,7 +793,7 @@ void erase_now( HWND hwnd, UINT rdw_flags )
void
move_window_bits
(
HWND
hwnd
,
struct
window_surface
*
old_surface
,
void
move_window_bits
(
HWND
hwnd
,
struct
window_surface
*
old_surface
,
struct
window_surface
*
new_surface
,
struct
window_surface
*
new_surface
,
const
RECT
*
visible_rect
,
const
RECT
*
old_visible_rect
,
const
RECT
*
visible_rect
,
const
RECT
*
old_visible_rect
,
const
RECT
*
client
_rect
,
const
RECT
*
valid_rects
)
const
RECT
*
window
_rect
,
const
RECT
*
valid_rects
)
{
{
RECT
dst
=
valid_rects
[
0
];
RECT
dst
=
valid_rects
[
0
];
RECT
src
=
valid_rects
[
1
];
RECT
src
=
valid_rects
[
1
];
...
@@ -776,24 +802,10 @@ void move_window_bits( HWND hwnd, struct window_surface *old_surface,
...
@@ -776,24 +802,10 @@ void move_window_bits( HWND hwnd, struct window_surface *old_surface,
src
.
left
-
old_visible_rect
->
left
!=
dst
.
left
-
visible_rect
->
left
||
src
.
left
-
old_visible_rect
->
left
!=
dst
.
left
-
visible_rect
->
left
||
src
.
top
-
old_visible_rect
->
top
!=
dst
.
top
-
visible_rect
->
top
)
src
.
top
-
old_visible_rect
->
top
!=
dst
.
top
-
visible_rect
->
top
)
{
{
char
buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)];
TRACE
(
"copying %s -> %s
\n
"
,
wine_dbgstr_rect
(
&
src
),
wine_dbgstr_rect
(
&
dst
));
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
buffer
;
OffsetRect
(
&
src
,
-
old_visible_rect
->
left
,
-
old_visible_rect
->
top
);
void
*
bits
;
OffsetRect
(
&
dst
,
-
window_rect
->
left
,
-
window_rect
->
top
);
UINT
flags
=
UPDATE_NOCHILDREN
;
copy_bits_from_surface
(
hwnd
,
old_surface
,
&
dst
,
&
src
);
HRGN
rgn
=
get_update_region
(
hwnd
,
&
flags
,
NULL
);
HDC
hdc
=
GetDCEx
(
hwnd
,
rgn
,
DCX_CACHE
|
DCX_EXCLUDERGN
);
OffsetRect
(
&
dst
,
-
client_rect
->
left
,
-
client_rect
->
top
);
TRACE
(
"copying %s -> %s
\n
"
,
wine_dbgstr_rect
(
&
src
),
wine_dbgstr_rect
(
&
dst
)
);
bits
=
old_surface
->
funcs
->
get_info
(
old_surface
,
info
);
old_surface
->
funcs
->
lock
(
old_surface
);
SetDIBitsToDevice
(
hdc
,
dst
.
left
,
dst
.
top
,
dst
.
right
-
dst
.
left
,
dst
.
bottom
-
dst
.
top
,
src
.
left
-
old_visible_rect
->
left
-
old_surface
->
rect
.
left
,
old_surface
->
rect
.
bottom
-
(
src
.
bottom
-
old_visible_rect
->
top
),
0
,
old_surface
->
rect
.
bottom
-
old_surface
->
rect
.
top
,
bits
,
info
,
DIB_RGB_COLORS
);
old_surface
->
funcs
->
unlock
(
old_surface
);
ReleaseDC
(
hwnd
,
hdc
);
}
}
}
}
...
...
dlls/user32/user_private.h
View file @
4e13c06f
...
@@ -231,7 +231,7 @@ extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN;
...
@@ -231,7 +231,7 @@ extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN;
extern
void
move_window_bits
(
HWND
hwnd
,
struct
window_surface
*
old_surface
,
extern
void
move_window_bits
(
HWND
hwnd
,
struct
window_surface
*
old_surface
,
struct
window_surface
*
new_surface
,
struct
window_surface
*
new_surface
,
const
RECT
*
visible_rect
,
const
RECT
*
old_visible_rect
,
const
RECT
*
visible_rect
,
const
RECT
*
old_visible_rect
,
const
RECT
*
client
_rect
,
const
RECT
*
valid_rects
)
DECLSPEC_HIDDEN
;
const
RECT
*
window
_rect
,
const
RECT
*
valid_rects
)
DECLSPEC_HIDDEN
;
extern
void
*
get_hook_proc
(
void
*
proc
,
const
WCHAR
*
module
,
HMODULE
*
free_module
)
DECLSPEC_HIDDEN
;
extern
void
*
get_hook_proc
(
void
*
proc
,
const
WCHAR
*
module
,
HMODULE
*
free_module
)
DECLSPEC_HIDDEN
;
extern
RECT
get_virtual_screen_rect
(
void
)
DECLSPEC_HIDDEN
;
extern
RECT
get_virtual_screen_rect
(
void
)
DECLSPEC_HIDDEN
;
extern
LRESULT
call_current_hook
(
HHOOK
hhook
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
)
DECLSPEC_HIDDEN
;
extern
LRESULT
call_current_hook
(
HHOOK
hhook
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/winpos.c
View file @
4e13c06f
...
@@ -2151,7 +2151,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
...
@@ -2151,7 +2151,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
if
(
!
IsRectEmpty
(
valid_rects
))
if
(
!
IsRectEmpty
(
valid_rects
))
{
{
move_window_bits
(
hwnd
,
old_surface
,
new_surface
,
&
visible_rect
,
move_window_bits
(
hwnd
,
old_surface
,
new_surface
,
&
visible_rect
,
&
old_visible_rect
,
client
_rect
,
valid_rects
);
&
old_visible_rect
,
window
_rect
,
valid_rects
);
valid_rects
=
NULL
;
/* prevent the driver from trying to also move the bits */
valid_rects
=
NULL
;
/* prevent the driver from trying to also move the bits */
}
}
window_surface_release
(
old_surface
);
window_surface_release
(
old_surface
);
...
...
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