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
1f4e3765
Commit
1f4e3765
authored
Jul 14, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 14, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Also bind the pixel shader and blend state in d2d_brush_bind_resources().
parent
391fda75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
17 deletions
+21
-17
brush.c
dlls/d2d1/brush.c
+14
-2
d2d1_private.h
dlls/d2d1/d2d1_private.h
+1
-1
render_target.c
dlls/d2d1/render_target.c
+6
-14
No files found.
dlls/d2d1/brush.c
View file @
1f4e3765
...
...
@@ -709,12 +709,20 @@ static D3D10_TEXTURE_ADDRESS_MODE texture_addres_mode_from_extend_mode(D2D1_EXTE
}
}
void
d2d_brush_bind_resources
(
struct
d2d_brush
*
brush
,
ID3D10Device
*
device
)
void
d2d_brush_bind_resources
(
struct
d2d_brush
*
brush
,
struct
d2d_d3d_render_target
*
render_target
)
{
static
const
float
blend_factor
[]
=
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
};
ID3D10Device
*
device
=
render_target
->
device
;
HRESULT
hr
;
if
(
brush
->
type
==
D2D_BRUSH_TYPE_BITMAP
)
ID3D10Device_OMSetBlendState
(
device
,
render_target
->
bs
,
blend_factor
,
D3D10_DEFAULT_SAMPLE_MASK
);
if
(
brush
->
type
==
D2D_BRUSH_TYPE_SOLID
)
{
ID3D10Device_PSSetShader
(
device
,
render_target
->
rect_solid_ps
);
}
else
if
(
brush
->
type
==
D2D_BRUSH_TYPE_BITMAP
)
{
ID3D10Device_PSSetShader
(
device
,
render_target
->
rect_bitmap_ps
);
ID3D10Device_PSSetShaderResources
(
device
,
0
,
1
,
&
brush
->
u
.
bitmap
.
bitmap
->
view
);
if
(
!
brush
->
u
.
bitmap
.
sampler_state
)
{
...
...
@@ -743,4 +751,8 @@ void d2d_brush_bind_resources(struct d2d_brush *brush, ID3D10Device *device)
}
ID3D10Device_PSSetSamplers
(
device
,
0
,
1
,
&
brush
->
u
.
bitmap
.
sampler_state
);
}
else
{
FIXME
(
"Unhandled brush type %#x.
\n
"
,
brush
->
type
);
}
}
dlls/d2d1/d2d1_private.h
View file @
1f4e3765
...
...
@@ -141,7 +141,7 @@ void d2d_linear_gradient_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *
HRESULT
d2d_bitmap_brush_init
(
struct
d2d_brush
*
brush
,
struct
d2d_d3d_render_target
*
render_target
,
ID2D1Bitmap
*
bitmap
,
const
D2D1_BITMAP_BRUSH_PROPERTIES
*
bitmap_brush_desc
,
const
D2D1_BRUSH_PROPERTIES
*
brush_desc
)
DECLSPEC_HIDDEN
;
void
d2d_brush_bind_resources
(
struct
d2d_brush
*
brush
,
ID3D10Device
*
device
)
DECLSPEC_HIDDEN
;
void
d2d_brush_bind_resources
(
struct
d2d_brush
*
brush
,
struct
d2d_d3d_render_target
*
render_target
)
DECLSPEC_HIDDEN
;
struct
d2d_brush
*
unsafe_impl_from_ID2D1Brush
(
ID2D1Brush
*
iface
)
DECLSPEC_HIDDEN
;
struct
d2d_stroke_style
...
...
dlls/d2d1/render_target.c
View file @
1f4e3765
...
...
@@ -140,13 +140,12 @@ static void d2d_clip_stack_pop(struct d2d_clip_stack *stack)
}
static
void
d2d_draw
(
struct
d2d_d3d_render_target
*
render_target
,
ID3D10Buffer
*
vs_cb
,
ID3D10
PixelShader
*
ps
,
ID3D10
Buffer
*
ps_cb
,
struct
d2d_brush
*
brush
)
ID3D10Buffer
*
ps_cb
,
struct
d2d_brush
*
brush
)
{
ID3D10Device
*
device
=
render_target
->
device
;
unsigned
int
offset
;
D3D10_VIEWPORT
vp
;
HRESULT
hr
;
static
const
float
blend_factor
[]
=
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
};
vp
.
TopLeftX
=
0
;
vp
.
TopLeftY
=
0
;
...
...
@@ -171,7 +170,6 @@ static void d2d_draw(struct d2d_d3d_render_target *render_target, ID3D10Buffer *
ID3D10Device_VSSetConstantBuffers
(
device
,
0
,
1
,
&
vs_cb
);
ID3D10Device_VSSetShader
(
device
,
render_target
->
vs
);
ID3D10Device_PSSetConstantBuffers
(
device
,
0
,
1
,
&
ps_cb
);
ID3D10Device_PSSetShader
(
device
,
ps
);
ID3D10Device_RSSetViewports
(
device
,
1
,
&
vp
);
if
(
render_target
->
clip_stack
.
count
)
{
...
...
@@ -188,10 +186,9 @@ static void d2d_draw(struct d2d_d3d_render_target *render_target, ID3D10Buffer *
}
ID3D10Device_OMSetRenderTargets
(
device
,
1
,
&
render_target
->
view
,
NULL
);
if
(
brush
)
{
ID3D10Device_OMSetBlendState
(
device
,
render_target
->
bs
,
blend_factor
,
D3D10_DEFAULT_SAMPLE_MASK
);
d2d_brush_bind_resources
(
brush
,
device
);
}
d2d_brush_bind_resources
(
brush
,
render_target
);
else
ID3D10Device_PSSetShader
(
device
,
render_target
->
rect_solid_ps
);
ID3D10Device_Draw
(
device
,
4
,
0
);
...
...
@@ -553,7 +550,6 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1RenderTar
D3D10_SUBRESOURCE_DATA
buffer_data
;
D3D10_BUFFER_DESC
buffer_desc
;
ID3D10Buffer
*
vs_cb
,
*
ps_cb
;
ID3D10PixelShader
*
ps
;
D2D1_COLOR_F
color
;
float
tmp_x
,
tmp_y
;
HRESULT
hr
;
...
...
@@ -619,8 +615,6 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1RenderTar
D2D_MATRIX_3X2_F
w
,
b
;
float
dpi_scale
,
d
;
ps
=
render_target
->
rect_bitmap_ps
;
/* Scale for dpi. */
w
=
render_target
->
drawing_state
.
transform
;
dpi_scale
=
render_target
->
dpi_x
/
96
.
0
f
;
...
...
@@ -663,8 +657,6 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1RenderTar
}
else
{
ps
=
render_target
->
rect_solid_ps
;
color
=
brush_impl
->
u
.
solid
.
color
;
color
.
a
*=
brush_impl
->
opacity
;
...
...
@@ -679,7 +671,7 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1RenderTar
return
;
}
d2d_draw
(
render_target
,
vs_cb
,
ps
,
ps
_cb
,
brush_impl
);
d2d_draw
(
render_target
,
vs_cb
,
ps_cb
,
brush_impl
);
ID3D10Buffer_Release
(
ps_cb
);
ID3D10Buffer_Release
(
vs_cb
);
...
...
@@ -1145,7 +1137,7 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_Clear(ID2D1RenderTarget *ifa
return
;
}
d2d_draw
(
render_target
,
vs_cb
,
render_target
->
rect_solid_ps
,
ps_cb
,
NULL
);
d2d_draw
(
render_target
,
vs_cb
,
ps_cb
,
NULL
);
ID3D10Buffer_Release
(
ps_cb
);
ID3D10Buffer_Release
(
vs_cb
);
...
...
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