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
8db1df50
Commit
8db1df50
authored
Nov 03, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement d2d_gradient_GetGradientStops().
parent
5279ad5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
brush.c
dlls/d2d1/brush.c
+16
-2
d2d1_private.h
dlls/d2d1/d2d1_private.h
+2
-1
render_target.c
dlls/d2d1/render_target.c
+7
-1
No files found.
dlls/d2d1/brush.c
View file @
8db1df50
...
...
@@ -66,7 +66,10 @@ static ULONG STDMETHODCALLTYPE d2d_gradient_Release(ID2D1GradientStopCollection
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
{
HeapFree
(
GetProcessHeap
(),
0
,
gradient
->
stops
);
HeapFree
(
GetProcessHeap
(),
0
,
gradient
);
}
return
refcount
;
}
...
...
@@ -90,7 +93,13 @@ static UINT32 STDMETHODCALLTYPE d2d_gradient_GetGradientStopCount(ID2D1GradientS
static
void
STDMETHODCALLTYPE
d2d_gradient_GetGradientStops
(
ID2D1GradientStopCollection
*
iface
,
D2D1_GRADIENT_STOP
*
stops
,
UINT32
stop_count
)
{
FIXME
(
"iface %p, stops %p, stop_count %u stub!
\n
"
,
iface
,
stops
,
stop_count
);
struct
d2d_gradient
*
gradient
=
impl_from_ID2D1GradientStopCollection
(
iface
);
TRACE
(
"iface %p, stops %p, stop_count %u.
\n
"
,
iface
,
stops
,
stop_count
);
memcpy
(
stops
,
gradient
->
stops
,
min
(
gradient
->
stop_count
,
stop_count
)
*
sizeof
(
*
stops
));
if
(
stop_count
>
gradient
->
stop_count
)
memset
(
stops
,
0
,
(
stop_count
-
gradient
->
stop_count
)
*
sizeof
(
*
stops
));
}
static
D2D1_GAMMA
STDMETHODCALLTYPE
d2d_gradient_GetColorInterpolationGamma
(
ID2D1GradientStopCollection
*
iface
)
...
...
@@ -119,7 +128,7 @@ static const struct ID2D1GradientStopCollectionVtbl d2d_gradient_vtbl =
d2d_gradient_GetExtendMode
,
};
void
d2d_gradient_init
(
struct
d2d_gradient
*
gradient
,
ID2D1RenderTarget
*
render_target
,
HRESULT
d2d_gradient_init
(
struct
d2d_gradient
*
gradient
,
ID2D1RenderTarget
*
render_target
,
const
D2D1_GRADIENT_STOP
*
stops
,
UINT32
stop_count
,
D2D1_GAMMA
gamma
,
D2D1_EXTEND_MODE
extend_mode
)
{
FIXME
(
"Ignoring gradient properties.
\n
"
);
...
...
@@ -128,6 +137,11 @@ void d2d_gradient_init(struct d2d_gradient *gradient, ID2D1RenderTarget *render_
gradient
->
refcount
=
1
;
gradient
->
stop_count
=
stop_count
;
if
(
!
(
gradient
->
stops
=
HeapAlloc
(
GetProcessHeap
(),
0
,
stop_count
*
sizeof
(
*
stops
))))
return
E_OUTOFMEMORY
;
memcpy
(
gradient
->
stops
,
stops
,
stop_count
*
sizeof
(
*
stops
));
return
S_OK
;
}
static
void
d2d_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1RenderTarget
*
render_target
,
...
...
dlls/d2d1/d2d1_private.h
View file @
8db1df50
...
...
@@ -86,10 +86,11 @@ struct d2d_gradient
ID2D1GradientStopCollection
ID2D1GradientStopCollection_iface
;
LONG
refcount
;
D2D1_GRADIENT_STOP
*
stops
;
UINT32
stop_count
;
};
void
d2d_gradient_init
(
struct
d2d_gradient
*
gradient
,
ID2D1RenderTarget
*
render_target
,
HRESULT
d2d_gradient_init
(
struct
d2d_gradient
*
gradient
,
ID2D1RenderTarget
*
render_target
,
const
D2D1_GRADIENT_STOP
*
stops
,
UINT32
stop_count
,
D2D1_GAMMA
gamma
,
D2D1_EXTEND_MODE
extend_mode
)
DECLSPEC_HIDDEN
;
...
...
dlls/d2d1/render_target.c
View file @
8db1df50
...
...
@@ -335,6 +335,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateGradientStopCollect
ID2D1GradientStopCollection
**
gradient
)
{
struct
d2d_gradient
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, stops %p, stop_count %u, gamma %#x, extend_mode %#x, gradient %p.
\n
"
,
iface
,
stops
,
stop_count
,
gamma
,
extend_mode
,
gradient
);
...
...
@@ -342,7 +343,12 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateGradientStopCollect
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
d2d_gradient_init
(
object
,
iface
,
stops
,
stop_count
,
gamma
,
extend_mode
);
if
(
FAILED
(
hr
=
d2d_gradient_init
(
object
,
iface
,
stops
,
stop_count
,
gamma
,
extend_mode
)))
{
WARN
(
"Failed to initialize gradient, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created gradient %p.
\n
"
,
object
);
*
gradient
=
&
object
->
ID2D1GradientStopCollection_iface
;
...
...
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