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
cfde8331
Commit
cfde8331
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_CreateSolidColorBrush().
parent
6b947701
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
172 additions
and
2 deletions
+172
-2
Makefile.in
dlls/d2d1/Makefile.in
+1
-0
brush.c
dlls/d2d1/brush.c
+150
-0
d2d1_private.h
dlls/d2d1/d2d1_private.h
+9
-0
render_target.c
dlls/d2d1/render_target.c
+12
-2
No files found.
dlls/d2d1/Makefile.in
View file @
cfde8331
...
...
@@ -3,6 +3,7 @@ IMPORTLIB = d2d1
IMPORTS
=
uuid
C_SRCS
=
\
brush.c
\
factory.c
\
render_target.c
...
...
dlls/d2d1/brush.c
0 → 100644
View file @
cfde8331
/*
* Copyright 2014 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include "d2d1_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d2d
);
static
inline
struct
d2d_brush
*
impl_from_ID2D1SolidColorBrush
(
ID2D1SolidColorBrush
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d2d_brush
,
ID2D1Brush_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_solid_color_brush_QueryInterface
(
ID2D1SolidColorBrush
*
iface
,
REFIID
iid
,
void
**
out
)
{
TRACE
(
"iface %p, iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualGUID
(
iid
,
&
IID_ID2D1SolidColorBrush
)
||
IsEqualGUID
(
iid
,
&
IID_ID2D1Brush
)
||
IsEqualGUID
(
iid
,
&
IID_ID2D1Resource
)
||
IsEqualGUID
(
iid
,
&
IID_IUnknown
))
{
ID2D1SolidColorBrush_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_solid_color_brush_AddRef
(
ID2D1SolidColorBrush
*
iface
)
{
struct
d2d_brush
*
brush
=
impl_from_ID2D1SolidColorBrush
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
brush
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
d2d_solid_color_brush_Release
(
ID2D1SolidColorBrush
*
iface
)
{
struct
d2d_brush
*
brush
=
impl_from_ID2D1SolidColorBrush
(
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_solid_color_brush_GetFactory
(
ID2D1SolidColorBrush
*
iface
,
ID2D1Factory
**
factory
)
{
FIXME
(
"iface %p, factory %p stub!
\n
"
,
iface
,
factory
);
*
factory
=
NULL
;
}
static
void
STDMETHODCALLTYPE
d2d_solid_color_brush_SetOpacity
(
ID2D1SolidColorBrush
*
iface
,
float
opacity
)
{
FIXME
(
"iface %p, opacity %.8e stub!
\n
"
,
iface
,
opacity
);
}
static
void
STDMETHODCALLTYPE
d2d_solid_color_brush_SetTransform
(
ID2D1SolidColorBrush
*
iface
,
const
D2D1_MATRIX_3X2_F
*
transform
)
{
FIXME
(
"iface %p, transform %p stub!
\n
"
,
iface
,
transform
);
}
static
float
STDMETHODCALLTYPE
d2d_solid_color_brush_GetOpacity
(
ID2D1SolidColorBrush
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
0
.
0
f
;
}
static
void
STDMETHODCALLTYPE
d2d_solid_color_brush_GetTransform
(
ID2D1SolidColorBrush
*
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_solid_color_brush_SetColor
(
ID2D1SolidColorBrush
*
iface
,
const
D2D1_COLOR_F
*
color
)
{
FIXME
(
"iface %p, color %p stub!
\n
"
,
iface
,
color
);
}
static
D2D1_COLOR_F
STDMETHODCALLTYPE
d2d_solid_color_brush_GetColor
(
ID2D1SolidColorBrush
*
iface
)
{
static
const
D2D1_COLOR_F
black
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
};
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
black
;
}
static
const
struct
ID2D1SolidColorBrushVtbl
d2d_solid_color_brush_vtbl
=
{
d2d_solid_color_brush_QueryInterface
,
d2d_solid_color_brush_AddRef
,
d2d_solid_color_brush_Release
,
d2d_solid_color_brush_GetFactory
,
d2d_solid_color_brush_SetOpacity
,
d2d_solid_color_brush_SetTransform
,
d2d_solid_color_brush_GetOpacity
,
d2d_solid_color_brush_GetTransform
,
d2d_solid_color_brush_SetColor
,
d2d_solid_color_brush_GetColor
,
};
void
d2d_solid_color_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1RenderTarget
*
render_target
,
const
D2D1_COLOR_F
*
color
,
const
D2D1_BRUSH_PROPERTIES
*
desc
)
{
FIXME
(
"Ignoring brush properties.
\n
"
);
brush
->
ID2D1Brush_iface
.
lpVtbl
=
(
ID2D1BrushVtbl
*
)
&
d2d_solid_color_brush_vtbl
;
brush
->
refcount
=
1
;
}
dlls/d2d1/d2d1_private.h
View file @
cfde8331
...
...
@@ -33,4 +33,13 @@ struct d2d_d3d_render_target
void
d2d_d3d_render_target_init
(
struct
d2d_d3d_render_target
*
render_target
,
ID2D1Factory
*
factory
,
IDXGISurface
*
surface
,
const
D2D1_RENDER_TARGET_PROPERTIES
*
desc
)
DECLSPEC_HIDDEN
;
struct
d2d_brush
{
ID2D1Brush
ID2D1Brush_iface
;
LONG
refcount
;
};
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
;
#endif
/* __WINE_D2D1_PRIVATE_H */
dlls/d2d1/render_target.c
View file @
cfde8331
...
...
@@ -117,9 +117,19 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapBrush(ID2D1Re
static
HRESULT
STDMETHODCALLTYPE
d2d_d3d_render_target_CreateSolidColorBrush
(
ID2D1RenderTarget
*
iface
,
const
D2D1_COLOR_F
*
color
,
const
D2D1_BRUSH_PROPERTIES
*
desc
,
ID2D1SolidColorBrush
**
brush
)
{
FIXME
(
"iface %p, color %p, desc %p, brush %p stub!
\n
"
,
iface
,
color
,
desc
,
brush
)
;
struct
d2d_brush
*
object
;
return
E_NOTIMPL
;
TRACE
(
"iface %p, color %p, desc %p, brush %p.
\n
"
,
iface
,
color
,
desc
,
brush
);
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
d2d_solid_color_brush_init
(
object
,
iface
,
color
,
desc
);
TRACE
(
"Created brush %p.
\n
"
,
object
);
*
brush
=
(
ID2D1SolidColorBrush
*
)
&
object
->
ID2D1Brush_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_d3d_render_target_CreateGradientStopCollection
(
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