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
0cb87228
Commit
0cb87228
authored
Dec 01, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement d2d_d3d_render_target_CreateBitmapBrush().
parent
ac4bd550
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
190 additions
and
3 deletions
+190
-3
brush.c
dlls/d2d1/brush.c
+174
-1
d2d1_private.h
dlls/d2d1/d2d1_private.h
+4
-0
render_target.c
dlls/d2d1/render_target.c
+12
-2
No files found.
dlls/d2d1/brush.c
View file @
0cb87228
...
...
@@ -448,11 +448,184 @@ void d2d_linear_gradient_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *
(
ID2D1BrushVtbl
*
)
&
d2d_linear_gradient_brush_vtbl
);
}
static
inline
struct
d2d_brush
*
impl_from_ID2D1BitmapBrush
(
ID2D1BitmapBrush
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d2d_brush
,
ID2D1Brush_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_bitmap_brush_QueryInterface
(
ID2D1BitmapBrush
*
iface
,
REFIID
iid
,
void
**
out
)
{
TRACE
(
"iface %p, iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualGUID
(
iid
,
&
IID_ID2D1BitmapBrush
)
||
IsEqualGUID
(
iid
,
&
IID_ID2D1Brush
)
||
IsEqualGUID
(
iid
,
&
IID_ID2D1Resource
)
||
IsEqualGUID
(
iid
,
&
IID_IUnknown
))
{
ID2D1BitmapBrush_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_bitmap_brush_AddRef
(
ID2D1BitmapBrush
*
iface
)
{
struct
d2d_brush
*
brush
=
impl_from_ID2D1BitmapBrush
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
brush
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
d2d_bitmap_brush_Release
(
ID2D1BitmapBrush
*
iface
)
{
struct
d2d_brush
*
brush
=
impl_from_ID2D1BitmapBrush
(
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_bitmap_brush_GetFactory
(
ID2D1BitmapBrush
*
iface
,
ID2D1Factory
**
factory
)
{
FIXME
(
"iface %p, factory %p stub!
\n
"
,
iface
,
factory
);
*
factory
=
NULL
;
}
static
void
STDMETHODCALLTYPE
d2d_bitmap_brush_SetOpacity
(
ID2D1BitmapBrush
*
iface
,
float
opacity
)
{
struct
d2d_brush
*
brush
=
impl_from_ID2D1BitmapBrush
(
iface
);
TRACE
(
"iface %p, opacity %.8e.
\n
"
,
iface
,
opacity
);
brush
->
opacity
=
opacity
;
}
static
void
STDMETHODCALLTYPE
d2d_bitmap_brush_SetTransform
(
ID2D1BitmapBrush
*
iface
,
const
D2D1_MATRIX_3X2_F
*
transform
)
{
FIXME
(
"iface %p, transform %p stub!
\n
"
,
iface
,
transform
);
}
static
float
STDMETHODCALLTYPE
d2d_bitmap_brush_GetOpacity
(
ID2D1BitmapBrush
*
iface
)
{
struct
d2d_brush
*
brush
=
impl_from_ID2D1BitmapBrush
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
brush
->
opacity
;
}
static
void
STDMETHODCALLTYPE
d2d_bitmap_brush_GetTransform
(
ID2D1BitmapBrush
*
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_bitmap_brush_SetExtendModeX
(
ID2D1BitmapBrush
*
iface
,
D2D1_EXTEND_MODE
mode
)
{
FIXME
(
"iface %p, mode %#x stub!
\n
"
,
iface
,
mode
);
}
static
void
STDMETHODCALLTYPE
d2d_bitmap_brush_SetExtendModeY
(
ID2D1BitmapBrush
*
iface
,
D2D1_EXTEND_MODE
mode
)
{
FIXME
(
"iface %p, mode %#x stub!
\n
"
,
iface
,
mode
);
}
static
void
STDMETHODCALLTYPE
d2d_bitmap_brush_SetInterpolationMode
(
ID2D1BitmapBrush
*
iface
,
D2D1_BITMAP_INTERPOLATION_MODE
mode
)
{
FIXME
(
"iface %p, mode %#x stub!
\n
"
,
iface
,
mode
);
}
static
void
STDMETHODCALLTYPE
d2d_bitmap_brush_SetBitmap
(
ID2D1BitmapBrush
*
iface
,
ID2D1Bitmap
*
bitmap
)
{
FIXME
(
"iface %p, bitmap %p stub!
\n
"
,
iface
,
bitmap
);
}
static
D2D1_EXTEND_MODE
STDMETHODCALLTYPE
d2d_bitmap_brush_GetExtendModeX
(
ID2D1BitmapBrush
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
D2D1_EXTEND_MODE_CLAMP
;
}
static
D2D1_EXTEND_MODE
STDMETHODCALLTYPE
d2d_bitmap_brush_GetExtendModeY
(
ID2D1BitmapBrush
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
D2D1_EXTEND_MODE_CLAMP
;
}
static
D2D1_BITMAP_INTERPOLATION_MODE
STDMETHODCALLTYPE
d2d_bitmap_brush_GetInterpolationMode
(
ID2D1BitmapBrush
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR
;
}
static
void
STDMETHODCALLTYPE
d2d_bitmap_brush_GetBitmap
(
ID2D1BitmapBrush
*
iface
,
ID2D1Bitmap
**
bitmap
)
{
FIXME
(
"iface %p, bitmap %p stub!
\n
"
,
iface
,
bitmap
);
}
static
const
struct
ID2D1BitmapBrushVtbl
d2d_bitmap_brush_vtbl
=
{
d2d_bitmap_brush_QueryInterface
,
d2d_bitmap_brush_AddRef
,
d2d_bitmap_brush_Release
,
d2d_bitmap_brush_GetFactory
,
d2d_bitmap_brush_SetOpacity
,
d2d_bitmap_brush_SetTransform
,
d2d_bitmap_brush_GetOpacity
,
d2d_bitmap_brush_GetTransform
,
d2d_bitmap_brush_SetExtendModeX
,
d2d_bitmap_brush_SetExtendModeY
,
d2d_bitmap_brush_SetInterpolationMode
,
d2d_bitmap_brush_SetBitmap
,
d2d_bitmap_brush_GetExtendModeX
,
d2d_bitmap_brush_GetExtendModeY
,
d2d_bitmap_brush_GetInterpolationMode
,
d2d_bitmap_brush_GetBitmap
,
};
void
d2d_bitmap_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1RenderTarget
*
render_target
,
const
ID2D1Bitmap
*
bitmap
,
const
D2D1_BITMAP_BRUSH_PROPERTIES
*
bitmap_brush_desc
,
const
D2D1_BRUSH_PROPERTIES
*
brush_desc
)
{
FIXME
(
"Ignoring brush properties.
\n
"
);
d2d_brush_init
(
brush
,
render_target
,
D2D_BRUSH_TYPE_BITMAP
,
brush_desc
,
(
ID2D1BrushVtbl
*
)
&
d2d_bitmap_brush_vtbl
);
}
struct
d2d_brush
*
unsafe_impl_from_ID2D1Brush
(
ID2D1Brush
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
(
const
ID2D1BrushVtbl
*
)
&
d2d_solid_color_brush_vtbl
||
iface
->
lpVtbl
==
(
const
ID2D1BrushVtbl
*
)
&
d2d_linear_gradient_brush_vtbl
);
||
iface
->
lpVtbl
==
(
const
ID2D1BrushVtbl
*
)
&
d2d_linear_gradient_brush_vtbl
||
iface
->
lpVtbl
==
(
const
ID2D1BrushVtbl
*
)
&
d2d_bitmap_brush_vtbl
);
return
CONTAINING_RECORD
(
iface
,
struct
d2d_brush
,
ID2D1Brush_iface
);
}
dlls/d2d1/d2d1_private.h
View file @
0cb87228
...
...
@@ -34,6 +34,7 @@ enum d2d_brush_type
{
D2D_BRUSH_TYPE_SOLID
,
D2D_BRUSH_TYPE_LINEAR
,
D2D_BRUSH_TYPE_BITMAP
,
};
struct
d2d_clip_stack
...
...
@@ -124,6 +125,9 @@ void d2d_solid_color_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *rend
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
;
void
d2d_bitmap_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1RenderTarget
*
render_target
,
const
ID2D1Bitmap
*
bitmap
,
const
D2D1_BITMAP_BRUSH_PROPERTIES
*
bitmap_brush_desc
,
const
D2D1_BRUSH_PROPERTIES
*
brush_desc
)
DECLSPEC_HIDDEN
;
struct
d2d_brush
*
unsafe_impl_from_ID2D1Brush
(
ID2D1Brush
*
iface
)
DECLSPEC_HIDDEN
;
struct
d2d_stroke_style
...
...
dlls/d2d1/render_target.c
View file @
0cb87228
...
...
@@ -364,10 +364,20 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapBrush(ID2D1Re
ID2D1Bitmap
*
bitmap
,
const
D2D1_BITMAP_BRUSH_PROPERTIES
*
bitmap_brush_desc
,
const
D2D1_BRUSH_PROPERTIES
*
brush_desc
,
ID2D1BitmapBrush
**
brush
)
{
FIXME
(
"iface %p, bitmap %p, bitmap_brush_desc %p, brush_desc %p, brush %p stub!
\n
"
,
struct
d2d_brush
*
object
;
TRACE
(
"iface %p, bitmap %p, bitmap_brush_desc %p, brush_desc %p, brush %p.
\n
"
,
iface
,
bitmap
,
bitmap_brush_desc
,
brush_desc
,
brush
);
return
E_NOTIMPL
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
d2d_bitmap_brush_init
(
object
,
iface
,
bitmap
,
bitmap_brush_desc
,
brush_desc
);
TRACE
(
"Created brush %p.
\n
"
,
object
);
*
brush
=
(
ID2D1BitmapBrush
*
)
&
object
->
ID2D1Brush_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_d3d_render_target_CreateSolidColorBrush
(
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