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
cbee3a56
Commit
cbee3a56
authored
Dec 08, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Use an iface instead of a vtbl pointer in FormatConverter.
parent
f25a867c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
converter.c
dlls/windowscodecs/converter.c
+16
-11
No files found.
dlls/windowscodecs/converter.c
View file @
cbee3a56
...
...
@@ -66,7 +66,7 @@ struct pixelformatinfo {
};
typedef
struct
FormatConverter
{
const
IWICFormatConverterVtbl
*
lpVtbl
;
IWICFormatConverter
IWICFormatConverter_iface
;
LONG
ref
;
IWICBitmapSource
*
source
;
const
struct
pixelformatinfo
*
dst_format
,
*
src_format
;
...
...
@@ -76,6 +76,11 @@ typedef struct FormatConverter {
CRITICAL_SECTION
lock
;
/* must be held when initialized */
}
FormatConverter
;
static
inline
FormatConverter
*
impl_from_IWICFormatConverter
(
IWICFormatConverter
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
FormatConverter
,
IWICFormatConverter_iface
);
}
static
void
make_grayscale_palette
(
WICColor
*
colors
,
UINT
num_colors
)
{
int
i
,
v
;
...
...
@@ -799,7 +804,7 @@ static const struct pixelformatinfo *get_formatinfo(const WICPixelFormatGUID *fo
static
HRESULT
WINAPI
FormatConverter_QueryInterface
(
IWICFormatConverter
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
FormatConverter
*
This
=
impl_from_IWICFormatConverter
(
iface
)
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
...
...
@@ -822,7 +827,7 @@ static HRESULT WINAPI FormatConverter_QueryInterface(IWICFormatConverter *iface,
static
ULONG
WINAPI
FormatConverter_AddRef
(
IWICFormatConverter
*
iface
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
FormatConverter
*
This
=
impl_from_IWICFormatConverter
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -832,7 +837,7 @@ static ULONG WINAPI FormatConverter_AddRef(IWICFormatConverter *iface)
static
ULONG
WINAPI
FormatConverter_Release
(
IWICFormatConverter
*
iface
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
FormatConverter
*
This
=
impl_from_IWICFormatConverter
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -851,7 +856,7 @@ static ULONG WINAPI FormatConverter_Release(IWICFormatConverter *iface)
static
HRESULT
WINAPI
FormatConverter_GetSize
(
IWICFormatConverter
*
iface
,
UINT
*
puiWidth
,
UINT
*
puiHeight
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
FormatConverter
*
This
=
impl_from_IWICFormatConverter
(
iface
)
;
TRACE
(
"(%p,%p,%p)
\n
"
,
iface
,
puiWidth
,
puiHeight
);
...
...
@@ -864,7 +869,7 @@ static HRESULT WINAPI FormatConverter_GetSize(IWICFormatConverter *iface,
static
HRESULT
WINAPI
FormatConverter_GetPixelFormat
(
IWICFormatConverter
*
iface
,
WICPixelFormatGUID
*
pPixelFormat
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
FormatConverter
*
This
=
impl_from_IWICFormatConverter
(
iface
)
;
TRACE
(
"(%p,%p): stub
\n
"
,
iface
,
pPixelFormat
);
...
...
@@ -879,7 +884,7 @@ static HRESULT WINAPI FormatConverter_GetPixelFormat(IWICFormatConverter *iface,
static
HRESULT
WINAPI
FormatConverter_GetResolution
(
IWICFormatConverter
*
iface
,
double
*
pDpiX
,
double
*
pDpiY
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
FormatConverter
*
This
=
impl_from_IWICFormatConverter
(
iface
)
;
TRACE
(
"(%p,%p,%p): stub
\n
"
,
iface
,
pDpiX
,
pDpiY
);
...
...
@@ -899,7 +904,7 @@ static HRESULT WINAPI FormatConverter_CopyPalette(IWICFormatConverter *iface,
static
HRESULT
WINAPI
FormatConverter_CopyPixels
(
IWICFormatConverter
*
iface
,
const
WICRect
*
prc
,
UINT
cbStride
,
UINT
cbBufferSize
,
BYTE
*
pbBuffer
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
FormatConverter
*
This
=
impl_from_IWICFormatConverter
(
iface
)
;
WICRect
rc
;
HRESULT
hr
;
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
...
...
@@ -929,7 +934,7 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
IWICBitmapSource
*
pISource
,
REFWICPixelFormatGUID
dstFormat
,
WICBitmapDitherType
dither
,
IWICPalette
*
pIPalette
,
double
alphaThresholdPercent
,
WICBitmapPaletteType
paletteTranslate
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
FormatConverter
*
This
=
impl_from_IWICFormatConverter
(
iface
)
;
const
struct
pixelformatinfo
*
srcinfo
,
*
dstinfo
;
static
INT
fixme
=
0
;
GUID
srcFormat
;
...
...
@@ -989,7 +994,7 @@ static HRESULT WINAPI FormatConverter_CanConvert(IWICFormatConverter *iface,
REFWICPixelFormatGUID
srcPixelFormat
,
REFWICPixelFormatGUID
dstPixelFormat
,
BOOL
*
pfCanConvert
)
{
FormatConverter
*
This
=
(
FormatConverter
*
)
iface
;
FormatConverter
*
This
=
impl_from_IWICFormatConverter
(
iface
)
;
const
struct
pixelformatinfo
*
srcinfo
,
*
dstinfo
;
TRACE
(
"(%p,%s,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
srcPixelFormat
),
...
...
@@ -1037,7 +1042,7 @@ HRESULT FormatConverter_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** p
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
FormatConverter
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
lpVtbl
=
&
FormatConverter_Vtbl
;
This
->
IWICFormatConverter_iface
.
lpVtbl
=
&
FormatConverter_Vtbl
;
This
->
ref
=
1
;
This
->
source
=
NULL
;
InitializeCriticalSection
(
&
This
->
lock
);
...
...
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