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
414d04e2
Commit
414d04e2
authored
Aug 02, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement d2d_bitmap_brush_GetFactory().
parent
47f9f09c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
18 deletions
+30
-18
brush.c
dlls/d2d1/brush.c
+21
-12
d2d1_private.h
dlls/d2d1/d2d1_private.h
+4
-3
render_target.c
dlls/d2d1/render_target.c
+5
-3
No files found.
dlls/d2d1/brush.c
View file @
414d04e2
...
...
@@ -144,7 +144,13 @@ HRESULT d2d_gradient_init(struct d2d_gradient *gradient, ID2D1RenderTarget *rend
return
S_OK
;
}
static
void
d2d_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1RenderTarget
*
render_target
,
static
void
d2d_brush_destroy
(
struct
d2d_brush
*
brush
)
{
ID2D1Factory_Release
(
brush
->
factory
);
HeapFree
(
GetProcessHeap
(),
0
,
brush
);
}
static
void
d2d_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1Factory
*
factory
,
enum
d2d_brush_type
type
,
const
D2D1_BRUSH_PROPERTIES
*
desc
,
const
struct
ID2D1BrushVtbl
*
vtbl
)
{
static
const
D2D1_MATRIX_3X2_F
identity
=
...
...
@@ -156,6 +162,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *render_ta
brush
->
ID2D1Brush_iface
.
lpVtbl
=
vtbl
;
brush
->
refcount
=
1
;
ID2D1Factory_AddRef
(
brush
->
factory
=
factory
);
brush
->
opacity
=
desc
?
desc
->
opacity
:
1
.
0
f
;
brush
->
transform
=
desc
?
desc
->
transform
:
identity
;
brush
->
type
=
type
;
...
...
@@ -205,7 +212,7 @@ static ULONG STDMETHODCALLTYPE d2d_solid_color_brush_Release(ID2D1SolidColorBrus
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
HeapFree
(
GetProcessHeap
(),
0
,
brush
);
d2d_brush_destroy
(
brush
);
return
refcount
;
}
...
...
@@ -288,12 +295,12 @@ static const struct ID2D1SolidColorBrushVtbl d2d_solid_color_brush_vtbl =
d2d_solid_color_brush_GetColor
,
};
void
d2d_solid_color_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1
RenderTarget
*
render_target
,
void
d2d_solid_color_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1
Factory
*
factory
,
const
D2D1_COLOR_F
*
color
,
const
D2D1_BRUSH_PROPERTIES
*
desc
)
{
FIXME
(
"Ignoring brush properties.
\n
"
);
d2d_brush_init
(
brush
,
render_target
,
D2D_BRUSH_TYPE_SOLID
,
desc
,
d2d_brush_init
(
brush
,
factory
,
D2D_BRUSH_TYPE_SOLID
,
desc
,
(
ID2D1BrushVtbl
*
)
&
d2d_solid_color_brush_vtbl
);
brush
->
u
.
solid
.
color
=
*
color
;
}
...
...
@@ -342,7 +349,7 @@ static ULONG STDMETHODCALLTYPE d2d_linear_gradient_brush_Release(ID2D1LinearGrad
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
HeapFree
(
GetProcessHeap
(),
0
,
brush
);
d2d_brush_destroy
(
brush
);
return
refcount
;
}
...
...
@@ -444,13 +451,13 @@ static const struct ID2D1LinearGradientBrushVtbl d2d_linear_gradient_brush_vtbl
d2d_linear_gradient_brush_GetGradientStopCollection
,
};
void
d2d_linear_gradient_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1
RenderTarget
*
render_target
,
void
d2d_linear_gradient_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1
Factory
*
factory
,
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
,
D2D_BRUSH_TYPE_LINEAR
,
brush_desc
,
d2d_brush_init
(
brush
,
factory
,
D2D_BRUSH_TYPE_LINEAR
,
brush_desc
,
(
ID2D1BrushVtbl
*
)
&
d2d_linear_gradient_brush_vtbl
);
}
...
...
@@ -503,7 +510,7 @@ static ULONG STDMETHODCALLTYPE d2d_bitmap_brush_Release(ID2D1BitmapBrush *iface)
ID3D10SamplerState_Release
(
brush
->
u
.
bitmap
.
sampler_state
);
if
(
brush
->
u
.
bitmap
.
bitmap
)
ID2D1Bitmap_Release
(
&
brush
->
u
.
bitmap
.
bitmap
->
ID2D1Bitmap_iface
);
HeapFree
(
GetProcessHeap
(),
0
,
brush
);
d2d_brush_destroy
(
brush
);
}
return
refcount
;
...
...
@@ -512,9 +519,11 @@ static ULONG STDMETHODCALLTYPE d2d_bitmap_brush_Release(ID2D1BitmapBrush *iface)
static
void
STDMETHODCALLTYPE
d2d_bitmap_brush_GetFactory
(
ID2D1BitmapBrush
*
iface
,
ID2D1Factory
**
factory
)
{
FIXME
(
"iface %p, factory %p stub!
\n
"
,
iface
,
factory
);
struct
d2d_brush
*
brush
=
impl_from_ID2D1BitmapBrush
(
iface
);
*
factory
=
NULL
;
TRACE
(
"iface %p, factory %p.
\n
"
,
iface
,
factory
);
ID2D1Factory_AddRef
(
*
factory
=
brush
->
factory
);
}
static
void
STDMETHODCALLTYPE
d2d_bitmap_brush_SetOpacity
(
ID2D1BitmapBrush
*
iface
,
float
opacity
)
...
...
@@ -668,13 +677,13 @@ static const struct ID2D1BitmapBrushVtbl d2d_bitmap_brush_vtbl =
d2d_bitmap_brush_GetBitmap
,
};
HRESULT
d2d_bitmap_brush_init
(
struct
d2d_brush
*
brush
,
struct
d2d_d3d_render_target
*
render_target
,
ID2D1Bitmap
*
bitmap
,
HRESULT
d2d_bitmap_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1Factory
*
factory
,
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
->
ID2D1RenderTarget_iface
,
D2D_BRUSH_TYPE_BITMAP
,
d2d_brush_init
(
brush
,
factory
,
D2D_BRUSH_TYPE_BITMAP
,
brush_desc
,
(
ID2D1BrushVtbl
*
)
&
d2d_bitmap_brush_vtbl
);
if
((
brush
->
u
.
bitmap
.
bitmap
=
unsafe_impl_from_ID2D1Bitmap
(
bitmap
)))
ID2D1Bitmap_AddRef
(
&
brush
->
u
.
bitmap
.
bitmap
->
ID2D1Bitmap_iface
);
...
...
dlls/d2d1/d2d1_private.h
View file @
414d04e2
...
...
@@ -125,6 +125,7 @@ struct d2d_brush
ID2D1Brush
ID2D1Brush_iface
;
LONG
refcount
;
ID2D1Factory
*
factory
;
float
opacity
;
D2D1_MATRIX_3X2_F
transform
;
...
...
@@ -146,12 +147,12 @@ struct d2d_brush
}
u
;
};
void
d2d_solid_color_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1
RenderTarget
*
render_target
,
void
d2d_solid_color_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1
Factory
*
factory
,
const
D2D1_COLOR_F
*
color
,
const
D2D1_BRUSH_PROPERTIES
*
desc
)
DECLSPEC_HIDDEN
;
void
d2d_linear_gradient_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1
RenderTarget
*
render_target
,
void
d2d_linear_gradient_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1
Factory
*
factory
,
const
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
*
gradient_brush_desc
,
const
D2D1_BRUSH_PROPERTIES
*
brush_desc
,
ID2D1GradientStopCollection
*
gradient
)
DECLSPEC_HIDDEN
;
HRESULT
d2d_bitmap_brush_init
(
struct
d2d_brush
*
brush
,
struct
d2d_d3d_render_target
*
render_target
,
HRESULT
d2d_bitmap_brush_init
(
struct
d2d_brush
*
brush
,
ID2D1Factory
*
factory
,
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
,
struct
d2d_d3d_render_target
*
render_target
,
...
...
dlls/d2d1/render_target.c
View file @
414d04e2
...
...
@@ -426,7 +426,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapBrush(ID2D1Re
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d2d_bitmap_brush_init
(
object
,
render_target
,
bitmap
,
bitmap_brush_desc
,
brush_desc
)))
if
(
FAILED
(
hr
=
d2d_bitmap_brush_init
(
object
,
render_target
->
factory
,
bitmap
,
bitmap_brush_desc
,
brush_desc
)))
{
WARN
(
"Failed to initialize brush, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
...
...
@@ -442,6 +442,7 @@ 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
)
{
struct
d2d_d3d_render_target
*
render_target
=
impl_from_ID2D1RenderTarget
(
iface
);
struct
d2d_brush
*
object
;
TRACE
(
"iface %p, color %p, desc %p, brush %p.
\n
"
,
iface
,
color
,
desc
,
brush
);
...
...
@@ -449,7 +450,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSolidColorBrush(ID2
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
d2d_solid_color_brush_init
(
object
,
iface
,
color
,
desc
);
d2d_solid_color_brush_init
(
object
,
render_target
->
factory
,
color
,
desc
);
TRACE
(
"Created brush %p.
\n
"
,
object
);
*
brush
=
(
ID2D1SolidColorBrush
*
)
&
object
->
ID2D1Brush_iface
;
...
...
@@ -487,6 +488,7 @@ 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
)
{
struct
d2d_d3d_render_target
*
render_target
=
impl_from_ID2D1RenderTarget
(
iface
);
struct
d2d_brush
*
object
;
TRACE
(
"iface %p, gradient_brush_desc %p, brush_desc %p, gradient %p, brush %p.
\n
"
,
...
...
@@ -495,7 +497,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLinearGradientBrush
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
);
d2d_linear_gradient_brush_init
(
object
,
render_target
->
factory
,
gradient_brush_desc
,
brush_desc
,
gradient
);
TRACE
(
"Created brush %p.
\n
"
,
object
);
*
brush
=
(
ID2D1LinearGradientBrush
*
)
&
object
->
ID2D1Brush_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