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
1e46722c
Commit
1e46722c
authored
Jun 06, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineandroid: Implement LOCK/UNLOCK perform() functions on top of the buffer management calls.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f856e102
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
device.c
dlls/wineandroid.drv/device.c
+51
-0
No files found.
dlls/wineandroid.drv/device.c
View file @
1e46722c
...
...
@@ -1210,7 +1210,58 @@ static int perform( ANativeWindow *window, int operation, ... )
break
;
}
case
NATIVE_WINDOW_LOCK
:
{
struct
ANativeWindowBuffer
*
buffer
;
struct
ANativeWindow_Buffer
*
buffer_ret
=
va_arg
(
args
,
ANativeWindow_Buffer
*
);
ARect
*
bounds
=
va_arg
(
args
,
ARect
*
);
int
ret
=
window
->
dequeueBuffer_DEPRECATED
(
window
,
&
buffer
);
if
(
!
ret
)
{
if
(
gralloc_module
)
{
if
((
ret
=
gralloc_module
->
lock
(
gralloc_module
,
buffer
->
handle
,
GRALLOC_USAGE_SW_READ_OFTEN
|
GRALLOC_USAGE_SW_WRITE_OFTEN
,
0
,
0
,
buffer
->
width
,
buffer
->
height
,
&
buffer_ret
->
bits
)))
{
WARN
(
"gralloc->lock %p failed %d %s
\n
"
,
win
->
hwnd
,
ret
,
strerror
(
-
ret
)
);
window
->
cancelBuffer
(
window
,
buffer
,
-
1
);
}
}
else
buffer_ret
->
bits
=
((
struct
native_buffer_wrapper
*
)
buffer
)
->
bits
;
}
if
(
!
ret
)
{
buffer_ret
->
width
=
buffer
->
width
;
buffer_ret
->
height
=
buffer
->
height
;
buffer_ret
->
stride
=
buffer
->
stride
;
buffer_ret
->
format
=
buffer
->
format
;
win
->
locked_buffer
=
buffer
;
if
(
bounds
)
{
bounds
->
left
=
0
;
bounds
->
top
=
0
;
bounds
->
right
=
buffer
->
width
;
bounds
->
bottom
=
buffer
->
height
;
}
}
va_end
(
args
);
TRACE
(
"hwnd %p %s bits %p ret %d %s
\n
"
,
win
->
hwnd
,
names
[
operation
],
buffer_ret
->
bits
,
ret
,
strerror
(
-
ret
)
);
return
ret
;
}
case
NATIVE_WINDOW_UNLOCK_AND_POST
:
{
int
ret
=
-
EINVAL
;
if
(
win
->
locked_buffer
)
{
if
(
gralloc_module
)
gralloc_module
->
unlock
(
gralloc_module
,
win
->
locked_buffer
->
handle
);
ret
=
window
->
queueBuffer
(
window
,
win
->
locked_buffer
,
-
1
);
win
->
locked_buffer
=
NULL
;
}
va_end
(
args
);
TRACE
(
"hwnd %p %s ret %d
\n
"
,
win
->
hwnd
,
names
[
operation
],
ret
);
return
ret
;
}
case
NATIVE_WINDOW_CONNECT
:
case
NATIVE_WINDOW_DISCONNECT
:
TRACE
(
"hwnd %p %s
\n
"
,
win
->
hwnd
,
names
[
operation
]
);
...
...
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