Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
5cce70dd
Commit
5cce70dd
authored
14 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
windowscodecs: Use an iface instead of a vtbl pointer in BmpFrameEncode.
parent
0eff947c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/windowscodecs/bmpencode.c
+19
-14
19 additions, 14 deletions
dlls/windowscodecs/bmpencode.c
with
19 additions
and
14 deletions
dlls/windowscodecs/bmpencode.c
+
19
−
14
View file @
5cce70dd
...
...
@@ -58,7 +58,7 @@ static const struct bmp_pixelformat formats[] = {
};
typedef
struct
BmpFrameEncode
{
const
IWICBitmapFrameEncode
Vtbl
*
lpVtbl
;
IWICBitmapFrameEncode
IWICBitmapFrameEncode
_iface
;
LONG
ref
;
IStream
*
stream
;
BOOL
initialized
;
...
...
@@ -71,10 +71,15 @@ typedef struct BmpFrameEncode {
BOOL
committed
;
}
BmpFrameEncode
;
static
inline
BmpFrameEncode
*
impl_from_IWICBitmapFrameEncode
(
IWICBitmapFrameEncode
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
BmpFrameEncode
,
IWICBitmapFrameEncode_iface
);
}
static
HRESULT
WINAPI
BmpFrameEncode_QueryInterface
(
IWICBitmapFrameEncode
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
...
...
@@ -96,7 +101,7 @@ static HRESULT WINAPI BmpFrameEncode_QueryInterface(IWICBitmapFrameEncode *iface
static
ULONG
WINAPI
BmpFrameEncode_AddRef
(
IWICBitmapFrameEncode
*
iface
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -106,7 +111,7 @@ static ULONG WINAPI BmpFrameEncode_AddRef(IWICBitmapFrameEncode *iface)
static
ULONG
WINAPI
BmpFrameEncode_Release
(
IWICBitmapFrameEncode
*
iface
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -124,7 +129,7 @@ static ULONG WINAPI BmpFrameEncode_Release(IWICBitmapFrameEncode *iface)
static
HRESULT
WINAPI
BmpFrameEncode_Initialize
(
IWICBitmapFrameEncode
*
iface
,
IPropertyBag2
*
pIEncoderOptions
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIEncoderOptions
);
if
(
This
->
initialized
)
return
WINCODEC_ERR_WRONGSTATE
;
...
...
@@ -137,7 +142,7 @@ static HRESULT WINAPI BmpFrameEncode_Initialize(IWICBitmapFrameEncode *iface,
static
HRESULT
WINAPI
BmpFrameEncode_SetSize
(
IWICBitmapFrameEncode
*
iface
,
UINT
uiWidth
,
UINT
uiHeight
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
TRACE
(
"(%p,%u,%u)
\n
"
,
iface
,
uiWidth
,
uiHeight
);
if
(
!
This
->
initialized
||
This
->
bits
)
return
WINCODEC_ERR_WRONGSTATE
;
...
...
@@ -151,7 +156,7 @@ static HRESULT WINAPI BmpFrameEncode_SetSize(IWICBitmapFrameEncode *iface,
static
HRESULT
WINAPI
BmpFrameEncode_SetResolution
(
IWICBitmapFrameEncode
*
iface
,
double
dpiX
,
double
dpiY
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
TRACE
(
"(%p,%0.2f,%0.2f)
\n
"
,
iface
,
dpiX
,
dpiY
);
if
(
!
This
->
initialized
||
This
->
bits
)
return
WINCODEC_ERR_WRONGSTATE
;
...
...
@@ -165,7 +170,7 @@ static HRESULT WINAPI BmpFrameEncode_SetResolution(IWICBitmapFrameEncode *iface,
static
HRESULT
WINAPI
BmpFrameEncode_SetPixelFormat
(
IWICBitmapFrameEncode
*
iface
,
WICPixelFormatGUID
*
pPixelFormat
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
int
i
;
TRACE
(
"(%p,%s)
\n
"
,
iface
,
debugstr_guid
(
pPixelFormat
));
...
...
@@ -224,7 +229,7 @@ static HRESULT BmpFrameEncode_AllocateBits(BmpFrameEncode *This)
static
HRESULT
WINAPI
BmpFrameEncode_WritePixels
(
IWICBitmapFrameEncode
*
iface
,
UINT
lineCount
,
UINT
cbStride
,
UINT
cbBufferSize
,
BYTE
*
pbPixels
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
HRESULT
hr
;
WICRect
rc
;
TRACE
(
"(%p,%u,%u,%u,%p)
\n
"
,
iface
,
lineCount
,
cbStride
,
cbBufferSize
,
pbPixels
);
...
...
@@ -253,7 +258,7 @@ static HRESULT WINAPI BmpFrameEncode_WritePixels(IWICBitmapFrameEncode *iface,
static
HRESULT
WINAPI
BmpFrameEncode_WriteSource
(
IWICBitmapFrameEncode
*
iface
,
IWICBitmapSource
*
pIBitmapSource
,
WICRect
*
prc
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
HRESULT
hr
;
WICRect
rc
;
WICPixelFormatGUID
guid
;
...
...
@@ -316,7 +321,7 @@ static HRESULT WINAPI BmpFrameEncode_WriteSource(IWICBitmapFrameEncode *iface,
static
HRESULT
WINAPI
BmpFrameEncode_Commit
(
IWICBitmapFrameEncode
*
iface
)
{
BmpFrameEncode
*
This
=
(
Bm
pFrameEncode
*
)
iface
;
BmpFrameEncode
*
This
=
impl_from_IWICBitma
pFrameEncode
(
iface
)
;
BITMAPFILEHEADER
bfh
;
BITMAPV5HEADER
bih
;
UINT
info_size
;
...
...
@@ -456,7 +461,7 @@ static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface)
if
(
ref
==
0
)
{
if
(
This
->
stream
)
IStream_Release
(
This
->
stream
);
if
(
This
->
frame
)
IWICBitmapFrameEncode_Release
(
(
IWICBitmapFrameEncode
*
)
This
->
fram
e
);
if
(
This
->
frame
)
IWICBitmapFrameEncode_Release
(
&
This
->
frame
->
IWICBitmapFrameEncode
_ifac
e
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -538,7 +543,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
*
ppIEncoderOptions
=
NULL
;
return
E_OUTOFMEMORY
;
}
encode
->
lpVtbl
=
&
BmpFrameEncode_Vtbl
;
encode
->
IWICBitmapFrameEncode_iface
.
lpVtbl
=
&
BmpFrameEncode_Vtbl
;
encode
->
ref
=
2
;
IStream_AddRef
(
This
->
stream
);
encode
->
stream
=
This
->
stream
;
...
...
@@ -552,7 +557,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
encode
->
lineswritten
=
0
;
encode
->
committed
=
FALSE
;
*
ppIFrameEncode
=
(
IWICBitmapFrameEncode
*
)
encod
e
;
*
ppIFrameEncode
=
&
encode
->
IWICBitmapFrameEncode
_ifac
e
;
This
->
frame
=
encode
;
return
S_OK
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment