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
a16df86d
Commit
a16df86d
authored
Jan 10, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Avoid an iface -> impl conversion from a non-method.
parent
b00c2979
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
22 deletions
+40
-22
bmpdecode.c
dlls/windowscodecs/bmpdecode.c
+31
-18
icoformat.c
dlls/windowscodecs/icoformat.c
+4
-2
wincodecs_private.h
dlls/windowscodecs/wincodecs_private.h
+5
-2
No files found.
dlls/windowscodecs/bmpdecode.c
View file @
a16df86d
...
...
@@ -59,10 +59,9 @@ typedef struct {
DWORD
bc2AppData
;
}
BITMAPCOREHEADER2
;
struct
BmpDecoder
;
typedef
HRESULT
(
*
ReadDataFunc
)(
struct
BmpDecoder
*
This
);
typedef
HRESULT
(
*
ReadDataFunc
)(
BmpDecoder
*
This
);
typedef
struct
BmpDecoder
{
struct
BmpDecoder
{
const
IWICBitmapDecoderVtbl
*
lpVtbl
;
const
IWICBitmapFrameDecodeVtbl
*
lpFrameVtbl
;
LONG
ref
;
...
...
@@ -80,7 +79,7 @@ typedef struct BmpDecoder {
CRITICAL_SECTION
lock
;
/* must be held when initialized/imagedata is set or stream is accessed */
int
packed
;
/* If TRUE, don't look for a file header and assume a packed DIB. */
int
icoframe
;
/* If TRUE, this is a frame of a .ico file. */
}
BmpDecoder
;
};
static
inline
BmpDecoder
*
impl_from_frame
(
IWICBitmapFrameDecode
*
iface
)
{
...
...
@@ -1142,16 +1141,9 @@ static const IWICBitmapDecoderVtbl BmpDecoder_Vtbl = {
BmpDecoder_GetFrame
};
static
HRESULT
BmpDecoder_C
onstruct
(
int
packed
,
int
icoframe
,
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
static
HRESULT
BmpDecoder_C
reate
(
int
packed
,
int
icoframe
,
BmpDecoder
**
ppDecoder
)
{
BmpDecoder
*
This
;
HRESULT
ret
;
TRACE
(
"(%p,%s,%p)
\n
"
,
pUnkOuter
,
debugstr_guid
(
iid
),
ppv
);
*
ppv
=
NULL
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BmpDecoder
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
...
...
@@ -1167,6 +1159,25 @@ static HRESULT BmpDecoder_Construct(int packed, int icoframe, IUnknown *pUnkOute
This
->
packed
=
packed
;
This
->
icoframe
=
icoframe
;
*
ppDecoder
=
This
;
return
S_OK
;
}
static
HRESULT
BmpDecoder_Construct
(
int
packed
,
int
icoframe
,
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
{
BmpDecoder
*
This
;
HRESULT
ret
;
TRACE
(
"(%p,%s,%p)
\n
"
,
pUnkOuter
,
debugstr_guid
(
iid
),
ppv
);
*
ppv
=
NULL
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
ret
=
BmpDecoder_Create
(
packed
,
icoframe
,
&
This
);
if
(
FAILED
(
ret
))
return
ret
;
ret
=
IUnknown_QueryInterface
((
IUnknown
*
)
This
,
iid
,
ppv
);
IUnknown_Release
((
IUnknown
*
)
This
);
...
...
@@ -1183,17 +1194,19 @@ HRESULT DibDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
return
BmpDecoder_Construct
(
TRUE
,
FALSE
,
pUnkOuter
,
iid
,
ppv
);
}
HRESULT
IcoDibDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
HRESULT
IcoDibDecoder_CreateInstance
(
BmpDecoder
**
ppDecoder
)
{
return
BmpDecoder_C
onstruct
(
TRUE
,
TRUE
,
pUnkOuter
,
iid
,
ppv
);
return
BmpDecoder_C
reate
(
TRUE
,
TRUE
,
ppDecoder
);
}
/* Return the offset where the mask of an icon might be, or 0 for failure. */
void
BmpDecoder_FindIconMask
(
IWICBitmapDecoder
*
decoder
,
ULONG
*
mask_offset
,
int
*
topdown
)
void
BmpDecoder_GetWICDecoder
(
BmpDecoder
*
This
,
IWICBitmapDecoder
**
ppDecoder
)
{
BmpDecoder
*
This
=
(
BmpDecoder
*
)
decoder
;
*
ppDecoder
=
(
IWICBitmapDecoder
*
)
This
;
}
assert
(
This
->
lpVtbl
==
&
BmpDecoder_Vtbl
);
/* Return the offset where the mask of an icon might be, or 0 for failure. */
void
BmpDecoder_FindIconMask
(
BmpDecoder
*
This
,
ULONG
*
mask_offset
,
int
*
topdown
)
{
assert
(
This
->
stream
!=
NULL
);
if
(
This
->
read_data_func
==
BmpFrameDecode_ReadUncompressed
)
...
...
dlls/windowscodecs/icoformat.c
View file @
a16df86d
...
...
@@ -220,6 +220,7 @@ static inline void pixel_set_trans(DWORD* pixel, BOOL transparent)
static
HRESULT
ReadIcoDib
(
IStream
*
stream
,
IcoFrameDecode
*
result
)
{
HRESULT
hr
;
BmpDecoder
*
bmp_decoder
;
IWICBitmapDecoder
*
decoder
;
IWICBitmapFrameDecode
*
framedecode
;
WICPixelFormatGUID
pixelformat
;
...
...
@@ -227,9 +228,10 @@ static HRESULT ReadIcoDib(IStream *stream, IcoFrameDecode *result)
int
has_alpha
=
FALSE
;
/* if TRUE, alpha data might be in the image data */
WICRect
rc
;
hr
=
IcoDibDecoder_CreateInstance
(
NULL
,
&
IID_IWICBitmapDecoder
,
(
void
**
)
&
decoder
);
hr
=
IcoDibDecoder_CreateInstance
(
&
bmp_
decoder
);
if
(
SUCCEEDED
(
hr
))
{
BmpDecoder_GetWICDecoder
(
bmp_decoder
,
&
decoder
);
hr
=
IWICBitmapDecoder_Initialize
(
decoder
,
stream
,
WICDecodeMetadataCacheOnLoad
);
if
(
SUCCEEDED
(
hr
))
...
...
@@ -317,7 +319,7 @@ static HRESULT ReadIcoDib(IStream *stream, IcoFrameDecode *result)
LARGE_INTEGER
seek
;
int
topdown
;
BmpDecoder_FindIconMask
(
decoder
,
&
offset
,
&
topdown
);
BmpDecoder_FindIconMask
(
bmp_
decoder
,
&
offset
,
&
topdown
);
if
(
offset
)
{
...
...
dlls/windowscodecs/wincodecs_private.h
View file @
a16df86d
...
...
@@ -40,7 +40,6 @@ extern HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void*
extern
HRESULT
TiffDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
IcnsEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
IcoDibDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
TgaDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
FlipRotator_Create
(
IWICBitmapFlipRotator
**
fliprotator
);
...
...
@@ -58,6 +57,10 @@ extern HRESULT CreatePropertyBag2(IPropertyBag2 **ppPropertyBag2);
extern
HRESULT
CreateComponentInfo
(
REFCLSID
clsid
,
IWICComponentInfo
**
ppIInfo
);
extern
HRESULT
CreateComponentEnumerator
(
DWORD
componentTypes
,
DWORD
options
,
IEnumUnknown
**
ppIEnumUnknown
);
void
BmpDecoder_FindIconMask
(
IWICBitmapDecoder
*
decoder
,
ULONG
*
mask_offset
,
int
*
topdown
);
typedef
struct
BmpDecoder
BmpDecoder
;
extern
HRESULT
IcoDibDecoder_CreateInstance
(
BmpDecoder
**
ppDecoder
);
extern
void
BmpDecoder_GetWICDecoder
(
BmpDecoder
*
This
,
IWICBitmapDecoder
**
ppDecoder
);
extern
void
BmpDecoder_FindIconMask
(
BmpDecoder
*
This
,
ULONG
*
mask_offset
,
int
*
topdown
);
#endif
/* WINCODECS_PRIVATE_H */
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