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
a95ed154
Commit
a95ed154
authored
May 29, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Create staging texture with read access for bitmaps with D2D1_BITMAP_OPTIONS_CPU_READ.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
9cdf2a6e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
bitmap.c
dlls/d2d1/bitmap.c
+4
-0
d2d1.c
dlls/d2d1/tests/d2d1.c
+1
-3
No files found.
dlls/d2d1/bitmap.c
View file @
a95ed154
...
...
@@ -374,12 +374,16 @@ HRESULT d2d_bitmap_create(struct d2d_device_context *context, D2D1_SIZE_U size,
texture_desc
.
SampleDesc
.
Count
=
1
;
texture_desc
.
SampleDesc
.
Quality
=
0
;
texture_desc
.
Usage
=
D3D11_USAGE_DEFAULT
;
if
(
desc
->
bitmapOptions
&
D2D1_BITMAP_OPTIONS_CPU_READ
)
texture_desc
.
Usage
=
D3D11_USAGE_STAGING
;
texture_desc
.
BindFlags
=
0
;
if
(
desc
->
bitmapOptions
&
D2D1_BITMAP_OPTIONS_TARGET
)
texture_desc
.
BindFlags
|=
D3D11_BIND_RENDER_TARGET
;
if
(
!
(
desc
->
bitmapOptions
&
D2D1_BITMAP_OPTIONS_CANNOT_DRAW
))
texture_desc
.
BindFlags
|=
D3D11_BIND_SHADER_RESOURCE
;
texture_desc
.
CPUAccessFlags
=
0
;
if
(
desc
->
bitmapOptions
&
D2D1_BITMAP_OPTIONS_CPU_READ
)
texture_desc
.
CPUAccessFlags
|=
D3D11_CPU_ACCESS_READ
;
texture_desc
.
MiscFlags
=
0
;
if
(
desc
->
bitmapOptions
&
D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE
)
texture_desc
.
MiscFlags
|=
D3D11_RESOURCE_MISC_GDI_COMPATIBLE
;
...
...
dlls/d2d1/tests/d2d1.c
View file @
a95ed154
...
...
@@ -11709,10 +11709,8 @@ static void test_bitmap_map(BOOL d3d11)
hr
=
IDXGISurface_QueryInterface
(
surface
,
&
IID_ID3D11Texture2D
,
(
void
**
)
&
texture
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ID3D11Texture2D_GetDesc
(
texture
,
&
texture_desc
);
todo_wine
ok
(
texture_desc
.
Usage
==
D3D11_USAGE_STAGING
,
"Unexpected usage %u.
\n
"
,
texture_desc
.
Usage
);
ok
(
!
texture_desc
.
BindFlags
,
"Unexpected bind flags %#x.
\n
"
,
texture_desc
.
BindFlags
);
todo_wine
ok
(
texture_desc
.
CPUAccessFlags
==
D3D11_CPU_ACCESS_READ
,
"Unexpected CPU access flags %#x.
\n
"
,
texture_desc
.
CPUAccessFlags
);
ok
(
!
texture_desc
.
MiscFlags
,
"Unexpected misc flags %#x.
\n
"
,
texture_desc
.
MiscFlags
);
...
...
@@ -11822,7 +11820,7 @@ static void test_bitmap_create(BOOL d3d11)
bitmap_desc
.
bitmapOptions
=
invalid_options
[
i
].
options
;
bitmap_desc
.
colorContext
=
NULL
;
hr
=
ID2D1DeviceContext_CreateBitmap
(
ctx
.
context
,
size
,
NULL
,
0
,
&
bitmap_desc
,
&
bitmap
);
todo_wine
todo_wine
_if
(
i
!=
1
)
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ID2D1Bitmap1_Release
(
bitmap
);
...
...
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