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
d341bea6
Commit
d341bea6
authored
Jan 11, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Use an iface instead of a vtbl pointer in BmpEncoder.
parent
346e766d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
bmpencode.c
dlls/windowscodecs/bmpencode.c
+15
-10
No files found.
dlls/windowscodecs/bmpencode.c
View file @
d341bea6
...
...
@@ -412,16 +412,21 @@ static const IWICBitmapFrameEncodeVtbl BmpFrameEncode_Vtbl = {
};
typedef
struct
BmpEncoder
{
const
IWICBitmapEncoderVtbl
*
lpVtbl
;
IWICBitmapEncoder
IWICBitmapEncoder_iface
;
LONG
ref
;
IStream
*
stream
;
BmpFrameEncode
*
frame
;
}
BmpEncoder
;
static
inline
BmpEncoder
*
impl_from_IWICBitmapEncoder
(
IWICBitmapEncoder
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
BmpEncoder
,
IWICBitmapEncoder_iface
);
}
static
HRESULT
WINAPI
BmpEncoder_QueryInterface
(
IWICBitmapEncoder
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
BmpEncoder
*
This
=
(
BmpEncoder
*
)
iface
;
BmpEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
)
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
...
...
@@ -443,7 +448,7 @@ static HRESULT WINAPI BmpEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID
static
ULONG
WINAPI
BmpEncoder_AddRef
(
IWICBitmapEncoder
*
iface
)
{
BmpEncoder
*
This
=
(
BmpEncoder
*
)
iface
;
BmpEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -453,7 +458,7 @@ static ULONG WINAPI BmpEncoder_AddRef(IWICBitmapEncoder *iface)
static
ULONG
WINAPI
BmpEncoder_Release
(
IWICBitmapEncoder
*
iface
)
{
BmpEncoder
*
This
=
(
BmpEncoder
*
)
iface
;
BmpEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -471,7 +476,7 @@ static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface)
static
HRESULT
WINAPI
BmpEncoder_Initialize
(
IWICBitmapEncoder
*
iface
,
IStream
*
pIStream
,
WICBitmapEncoderCacheOption
cacheOption
)
{
BmpEncoder
*
This
=
(
BmpEncoder
*
)
iface
;
BmpEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
)
;
TRACE
(
"(%p,%p,%u)
\n
"
,
iface
,
pIStream
,
cacheOption
);
...
...
@@ -523,7 +528,7 @@ static HRESULT WINAPI BmpEncoder_SetPreview(IWICBitmapEncoder *iface, IWICBitmap
static
HRESULT
WINAPI
BmpEncoder_CreateNewFrame
(
IWICBitmapEncoder
*
iface
,
IWICBitmapFrameEncode
**
ppIFrameEncode
,
IPropertyBag2
**
ppIEncoderOptions
)
{
BmpEncoder
*
This
=
(
BmpEncoder
*
)
iface
;
BmpEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
)
;
BmpFrameEncode
*
encode
;
HRESULT
hr
;
...
...
@@ -565,7 +570,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
static
HRESULT
WINAPI
BmpEncoder_Commit
(
IWICBitmapEncoder
*
iface
)
{
BmpEncoder
*
This
=
(
BmpEncoder
*
)
iface
;
BmpEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
)
;
TRACE
(
"(%p)
\n
"
,
iface
);
if
(
!
This
->
frame
||
!
This
->
frame
->
committed
)
return
WINCODEC_ERR_WRONGSTATE
;
...
...
@@ -610,13 +615,13 @@ HRESULT BmpEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BmpEncoder
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
lpVtbl
=
&
BmpEncoder_Vtbl
;
This
->
IWICBitmapEncoder_iface
.
lpVtbl
=
&
BmpEncoder_Vtbl
;
This
->
ref
=
1
;
This
->
stream
=
NULL
;
This
->
frame
=
NULL
;
ret
=
I
Unknown_QueryInterface
((
IUnknown
*
)
This
,
iid
,
ppv
);
I
Unknown_Release
((
IUnknown
*
)
This
);
ret
=
I
WICBitmapEncoder_QueryInterface
(
&
This
->
IWICBitmapEncoder_iface
,
iid
,
ppv
);
I
WICBitmapEncoder_Release
(
&
This
->
IWICBitmapEncoder_iface
);
return
ret
;
}
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