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
a16df86d
Commit
a16df86d
authored
14 years ago
by
Esme Povirk
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
windowscodecs: Avoid an iface -> impl conversion from a non-method.
parent
b00c2979
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/windowscodecs/bmpdecode.c
+31
-18
31 additions, 18 deletions
dlls/windowscodecs/bmpdecode.c
dlls/windowscodecs/icoformat.c
+4
-2
4 additions, 2 deletions
dlls/windowscodecs/icoformat.c
dlls/windowscodecs/wincodecs_private.h
+5
-2
5 additions, 2 deletions
dlls/windowscodecs/wincodecs_private.h
with
40 additions
and
22 deletions
dlls/windowscodecs/bmpdecode.c
+
31
−
18
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
**
pp
v
)
static
HRESULT
BmpDecoder_C
reate
(
int
packed
,
int
icoframe
,
BmpDecoder
**
pp
Decoder
)
{
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
**
pp
v
)
HRESULT
IcoDibDecoder_CreateInstance
(
BmpDecoder
**
pp
Decoder
)
{
return
BmpDecoder_C
onstruct
(
TRUE
,
TRUE
,
p
UnkOuter
,
iid
,
ppv
);
return
BmpDecoder_C
reate
(
TRUE
,
TRUE
,
p
pDecoder
);
}
/* 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
)
...
...
This diff is collapsed.
Click to expand it.
dlls/windowscodecs/icoformat.c
+
4
−
2
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
)
{
...
...
This diff is collapsed.
Click to expand it.
dlls/windowscodecs/wincodecs_private.h
+
5
−
2
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 */
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