Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8583fc4a
Commit
8583fc4a
authored
Jun 16, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement d2d_d3d_render_target_CreateLinearGradientBrush().
parent
22a20e40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
4 deletions
+177
-4
brush.c
dlls/d2d1/brush.c
+162
-2
d2d1_private.h
dlls/d2d1/d2d1_private.h
+3
-0
render_target.c
dlls/d2d1/render_target.c
+12
-2
No files found.
dlls/d2d1/brush.c
View file @
8583fc4a
...
...
@@ -126,6 +126,13 @@ void d2d_gradient_init(struct d2d_gradient *gradient, ID2D1RenderTarget *render_
gradient
->
refcount
=
1
;
}
static
void
d2d_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1RenderTarget
*
render_target
,
const
D2D1_BRUSH_PROPERTIES
*
desc
,
const
struct
ID2D1BrushVtbl
*
vtbl
)
{
brush
->
ID2D1Brush_iface
.
lpVtbl
=
vtbl
;
brush
->
refcount
=
1
;
}
static
inline
struct
d2d_brush
*
impl_from_ID2D1SolidColorBrush
(
ID2D1SolidColorBrush
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d2d_brush
,
ID2D1Brush_iface
);
...
...
@@ -248,6 +255,159 @@ void d2d_solid_color_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *rend
{
FIXME
(
"Ignoring brush properties.
\n
"
);
brush
->
ID2D1Brush_iface
.
lpVtbl
=
(
ID2D1BrushVtbl
*
)
&
d2d_solid_color_brush_vtbl
;
brush
->
refcount
=
1
;
d2d_brush_init
(
brush
,
render_target
,
desc
,
(
ID2D1BrushVtbl
*
)
&
d2d_solid_color_brush_vtbl
);
}
static
inline
struct
d2d_brush
*
impl_from_ID2D1LinearGradientBrush
(
ID2D1LinearGradientBrush
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d2d_brush
,
ID2D1Brush_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_linear_gradient_brush_QueryInterface
(
ID2D1LinearGradientBrush
*
iface
,
REFIID
iid
,
void
**
out
)
{
TRACE
(
"iface %p, iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualGUID
(
iid
,
&
IID_ID2D1LinearGradientBrush
)
||
IsEqualGUID
(
iid
,
&
IID_ID2D1Brush
)
||
IsEqualGUID
(
iid
,
&
IID_ID2D1Resource
)
||
IsEqualGUID
(
iid
,
&
IID_IUnknown
))
{
ID2D1LinearGradientBrush_AddRef
(
iface
);
*
out
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
));
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
d2d_linear_gradient_brush_AddRef
(
ID2D1LinearGradientBrush
*
iface
)
{
struct
d2d_brush
*
brush
=
impl_from_ID2D1LinearGradientBrush
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
brush
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
d2d_linear_gradient_brush_Release
(
ID2D1LinearGradientBrush
*
iface
)
{
struct
d2d_brush
*
brush
=
impl_from_ID2D1LinearGradientBrush
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
brush
->
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
HeapFree
(
GetProcessHeap
(),
0
,
brush
);
return
refcount
;
}
static
void
STDMETHODCALLTYPE
d2d_linear_gradient_brush_GetFactory
(
ID2D1LinearGradientBrush
*
iface
,
ID2D1Factory
**
factory
)
{
FIXME
(
"iface %p, factory %p stub!
\n
"
,
iface
,
factory
);
*
factory
=
NULL
;
}
static
void
STDMETHODCALLTYPE
d2d_linear_gradient_brush_SetOpacity
(
ID2D1LinearGradientBrush
*
iface
,
float
opacity
)
{
FIXME
(
"iface %p, opacity %.8e stub!
\n
"
,
iface
,
opacity
);
}
static
void
STDMETHODCALLTYPE
d2d_linear_gradient_brush_SetTransform
(
ID2D1LinearGradientBrush
*
iface
,
const
D2D1_MATRIX_3X2_F
*
transform
)
{
FIXME
(
"iface %p, transform %p stub!
\n
"
,
iface
,
transform
);
}
static
float
STDMETHODCALLTYPE
d2d_linear_gradient_brush_GetOpacity
(
ID2D1LinearGradientBrush
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
0
.
0
f
;
}
static
void
STDMETHODCALLTYPE
d2d_linear_gradient_brush_GetTransform
(
ID2D1LinearGradientBrush
*
iface
,
D2D1_MATRIX_3X2_F
*
transform
)
{
static
const
D2D1_MATRIX_3X2_F
identity
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
};
FIXME
(
"iface %p, transform %p stub!
\n
"
,
iface
,
transform
);
*
transform
=
identity
;
}
static
void
STDMETHODCALLTYPE
d2d_linear_gradient_brush_SetStartPoint
(
ID2D1LinearGradientBrush
*
iface
,
D2D1_POINT_2F
start_point
)
{
FIXME
(
"iface %p, start_point {%.8e, %.8e} stub!
\n
"
,
iface
,
start_point
.
x
,
start_point
.
y
);
}
static
void
STDMETHODCALLTYPE
d2d_linear_gradient_brush_SetEndPoint
(
ID2D1LinearGradientBrush
*
iface
,
D2D1_POINT_2F
end_point
)
{
FIXME
(
"iface %p, end_point {%.8e, %.8e} stub!
\n
"
,
iface
,
end_point
.
x
,
end_point
.
y
);
}
static
D2D1_POINT_2F
STDMETHODCALLTYPE
d2d_linear_gradient_brush_GetStartPoint
(
ID2D1LinearGradientBrush
*
iface
)
{
static
const
D2D1_POINT_2F
point
=
{
0
.
0
f
,
0
.
0
f
};
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
point
;
}
static
D2D1_POINT_2F
STDMETHODCALLTYPE
d2d_linear_gradient_brush_GetEndPoint
(
ID2D1LinearGradientBrush
*
iface
)
{
static
const
D2D1_POINT_2F
point
=
{
0
.
0
f
,
0
.
0
f
};
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
point
;
}
static
void
STDMETHODCALLTYPE
d2d_linear_gradient_brush_GetGradientStopCollection
(
ID2D1LinearGradientBrush
*
iface
,
ID2D1GradientStopCollection
**
gradient
)
{
FIXME
(
"iface %p, gradient %p stub!
\n
"
,
iface
,
gradient
);
*
gradient
=
NULL
;
}
static
const
struct
ID2D1LinearGradientBrushVtbl
d2d_linear_gradient_brush_vtbl
=
{
d2d_linear_gradient_brush_QueryInterface
,
d2d_linear_gradient_brush_AddRef
,
d2d_linear_gradient_brush_Release
,
d2d_linear_gradient_brush_GetFactory
,
d2d_linear_gradient_brush_SetOpacity
,
d2d_linear_gradient_brush_SetTransform
,
d2d_linear_gradient_brush_GetOpacity
,
d2d_linear_gradient_brush_GetTransform
,
d2d_linear_gradient_brush_SetStartPoint
,
d2d_linear_gradient_brush_SetEndPoint
,
d2d_linear_gradient_brush_GetStartPoint
,
d2d_linear_gradient_brush_GetEndPoint
,
d2d_linear_gradient_brush_GetGradientStopCollection
,
};
void
d2d_linear_gradient_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1RenderTarget
*
render_target
,
const
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
*
gradient_brush_desc
,
const
D2D1_BRUSH_PROPERTIES
*
brush_desc
,
ID2D1GradientStopCollection
*
gradient
)
{
FIXME
(
"Ignoring brush properties.
\n
"
);
d2d_brush_init
(
brush
,
render_target
,
brush_desc
,
(
ID2D1BrushVtbl
*
)
&
d2d_solid_color_brush_vtbl
);
}
dlls/d2d1/d2d1_private.h
View file @
8583fc4a
...
...
@@ -51,5 +51,8 @@ struct d2d_brush
void
d2d_solid_color_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1RenderTarget
*
render_target
,
const
D2D1_COLOR_F
*
color
,
const
D2D1_BRUSH_PROPERTIES
*
desc
)
DECLSPEC_HIDDEN
;
void
d2d_linear_gradient_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1RenderTarget
*
render_target
,
const
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
*
gradient_brush_desc
,
const
D2D1_BRUSH_PROPERTIES
*
brush_desc
,
ID2D1GradientStopCollection
*
gradient
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_D2D1_PRIVATE_H */
dlls/d2d1/render_target.c
View file @
8583fc4a
...
...
@@ -156,10 +156,20 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLinearGradientBrush
const
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
*
gradient_brush_desc
,
const
D2D1_BRUSH_PROPERTIES
*
brush_desc
,
ID2D1GradientStopCollection
*
gradient
,
ID2D1LinearGradientBrush
**
brush
)
{
FIXME
(
"iface %p, gradient_brush_desc %p, brush_desc %p, gradient %p, brush %p stub!
\n
"
,
struct
d2d_brush
*
object
;
TRACE
(
"iface %p, gradient_brush_desc %p, brush_desc %p, gradient %p, brush %p.
\n
"
,
iface
,
gradient_brush_desc
,
brush_desc
,
gradient
,
brush
);
return
E_NOTIMPL
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
d2d_linear_gradient_brush_init
(
object
,
iface
,
gradient_brush_desc
,
brush_desc
,
gradient
);
TRACE
(
"Created brush %p.
\n
"
,
object
);
*
brush
=
(
ID2D1LinearGradientBrush
*
)
&
object
->
ID2D1Brush_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_d3d_render_target_CreateRadialGradientBrush
(
ID2D1RenderTarget
*
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