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
08be8fd5
Commit
08be8fd5
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: Derive bitmap options from surface description in CreateBitmapFromDxgiSurface().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
828a7aa0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
2 deletions
+26
-2
bitmap.c
dlls/d2d1/bitmap.c
+24
-0
d2d1_private.h
dlls/d2d1/d2d1_private.h
+1
-0
device.c
dlls/d2d1/device.c
+1
-1
d2d1.c
dlls/d2d1/tests/d2d1.c
+0
-1
No files found.
dlls/d2d1/bitmap.c
View file @
08be8fd5
...
...
@@ -495,6 +495,30 @@ HRESULT d2d_bitmap_create(struct d2d_device_context *context, D2D1_SIZE_U size,
return
*
bitmap
?
S_OK
:
E_OUTOFMEMORY
;
}
unsigned
int
d2d_get_bitmap_options_for_surface
(
IDXGISurface
*
surface
)
{
D3D11_TEXTURE2D_DESC
desc
;
unsigned
int
options
=
0
;
ID3D11Texture2D
*
texture
;
if
(
FAILED
(
IDXGISurface_QueryInterface
(
surface
,
&
IID_ID3D11Texture2D
,
(
void
**
)
&
texture
)))
return
0
;
ID3D11Texture2D_GetDesc
(
texture
,
&
desc
);
ID3D11Texture2D_Release
(
texture
);
if
(
desc
.
BindFlags
&
D3D11_BIND_RENDER_TARGET
)
options
|=
D2D1_BITMAP_OPTIONS_TARGET
;
if
(
!
(
desc
.
BindFlags
&
D3D11_BIND_SHADER_RESOURCE
))
options
|=
D2D1_BITMAP_OPTIONS_CANNOT_DRAW
;
if
(
desc
.
MiscFlags
&
D3D11_RESOURCE_MISC_GDI_COMPATIBLE
)
options
|=
D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE
;
if
(
desc
.
Usage
==
D3D11_USAGE_STAGING
&&
desc
.
CPUAccessFlags
&
D3D11_CPU_ACCESS_READ
)
options
|=
D2D1_BITMAP_OPTIONS_CPU_READ
;
return
options
;
}
HRESULT
d2d_bitmap_create_shared
(
struct
d2d_device_context
*
context
,
REFIID
iid
,
void
*
data
,
const
D2D1_BITMAP_PROPERTIES1
*
desc
,
struct
d2d_bitmap
**
bitmap
)
{
...
...
dlls/d2d1/d2d1_private.h
View file @
08be8fd5
...
...
@@ -409,6 +409,7 @@ HRESULT d2d_bitmap_create_shared(struct d2d_device_context *context, REFIID iid,
const
D2D1_BITMAP_PROPERTIES1
*
desc
,
struct
d2d_bitmap
**
bitmap
)
DECLSPEC_HIDDEN
;
HRESULT
d2d_bitmap_create_from_wic_bitmap
(
struct
d2d_device_context
*
context
,
IWICBitmapSource
*
bitmap_source
,
const
D2D1_BITMAP_PROPERTIES1
*
desc
,
struct
d2d_bitmap
**
bitmap
)
DECLSPEC_HIDDEN
;
unsigned
int
d2d_get_bitmap_options_for_surface
(
IDXGISurface
*
surface
)
DECLSPEC_HIDDEN
;
struct
d2d_bitmap
*
unsafe_impl_from_ID2D1Bitmap
(
ID2D1Bitmap
*
iface
)
DECLSPEC_HIDDEN
;
struct
d2d_state_block
...
...
dlls/d2d1/device.c
View file @
08be8fd5
...
...
@@ -1876,7 +1876,7 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmapFromDxgiSurface(
memset
(
&
bitmap_desc
,
0
,
sizeof
(
bitmap_desc
));
bitmap_desc
.
pixelFormat
.
format
=
surface_desc
.
Format
;
bitmap_desc
.
pixelFormat
.
alphaMode
=
D2D1_ALPHA_MODE_PREMULTIPLIED
;
bitmap_desc
.
bitmapOptions
=
D2D1_BITMAP_OPTIONS_TARGET
|
D2D1_BITMAP_OPTIONS_CANNOT_DRAW
;
bitmap_desc
.
bitmapOptions
=
d2d_get_bitmap_options_for_surface
(
surface
)
;
desc
=
&
bitmap_desc
;
}
...
...
dlls/d2d1/tests/d2d1.c
View file @
08be8fd5
...
...
@@ -11782,7 +11782,6 @@ static void test_bitmap_map(BOOL d3d11)
hr
=
ID2D1DeviceContext_CreateBitmapFromDxgiSurface
(
ctx
.
context
,
surface
,
NULL
,
&
bitmap
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
options
=
ID2D1Bitmap1_GetOptions
(
bitmap
);
todo_wine
ok
(
options
==
(
D2D1_BITMAP_OPTIONS_CANNOT_DRAW
|
D2D1_BITMAP_OPTIONS_CPU_READ
),
"Unexpected options %#x.
\n
"
,
options
);
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