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
828a7aa0
Commit
828a7aa0
authored
May 30, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Use bitmap options to check if mapping is supported.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
f185a3ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
bitmap.c
dlls/d2d1/bitmap.c
+3
-0
d2d1.c
dlls/d2d1/tests/d2d1.c
+8
-0
No files found.
dlls/d2d1/bitmap.c
View file @
828a7aa0
...
...
@@ -257,6 +257,9 @@ static HRESULT STDMETHODCALLTYPE d2d_bitmap_Map(ID2D1Bitmap1 *iface, D2D1_MAP_OP
TRACE
(
"iface %p, options %#x, mapped_rect %p.
\n
"
,
iface
,
options
,
mapped_rect
);
if
(
!
(
bitmap
->
options
&
D2D1_BITMAP_OPTIONS_CPU_READ
))
return
E_INVALIDARG
;
if
(
bitmap
->
mapped_resource
.
pData
)
return
D2DERR_WRONG_STATE
;
...
...
dlls/d2d1/tests/d2d1.c
View file @
828a7aa0
...
...
@@ -11804,6 +11804,14 @@ static void test_bitmap_map(BOOL d3d11)
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ID2D1Bitmap1_Release
(
bitmap
);
/* Create without D2D1_BITMAP_OPTIONS_CPU_READ, surface supports CPU reads. */
bitmap_desc
.
bitmapOptions
=
D2D1_BITMAP_OPTIONS_CANNOT_DRAW
;
hr
=
ID2D1DeviceContext_CreateBitmapFromDxgiSurface
(
ctx
.
context
,
surface
,
&
bitmap_desc
,
&
bitmap
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Bitmap1_Map
(
bitmap
,
D2D1_MAP_OPTIONS_READ
,
&
mapped_rect
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ID2D1Bitmap1_Release
(
bitmap
);
ID3D11Texture2D_Release
(
texture
);
IDXGISurface_Release
(
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