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
a4579784
Commit
a4579784
authored
Sep 24, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Calculate transparent color index for global GIF palette.
parent
3eb49955
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
gifformat.c
dlls/windowscodecs/gifformat.c
+20
-2
gifformat.c
dlls/windowscodecs/tests/gifformat.c
+0
-3
No files found.
dlls/windowscodecs/gifformat.c
View file @
a4579784
...
...
@@ -582,6 +582,7 @@ typedef struct {
LONG
ref
;
BOOL
initialized
;
GifFileType
*
gif
;
UINT
current_frame
;
CRITICAL_SECTION
lock
;
}
GifDecoder
;
...
...
@@ -1170,7 +1171,8 @@ static HRESULT WINAPI GifDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalet
GifDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
);
WICColor
colors
[
256
];
ColorMapObject
*
cm
;
int
i
;
int
i
,
trans
;
ExtensionBlock
*
eb
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
palette
);
...
...
@@ -1191,7 +1193,21 @@ static HRESULT WINAPI GifDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalet
cm
->
Colors
[
i
].
Blue
;
}
/* FIXME: transparent color? */
/* look for the transparent color extension */
for
(
i
=
0
;
i
<
This
->
gif
->
SavedImages
[
This
->
current_frame
].
Extensions
.
ExtensionBlockCount
;
i
++
)
{
eb
=
This
->
gif
->
SavedImages
[
This
->
current_frame
].
Extensions
.
ExtensionBlocks
+
i
;
if
(
eb
->
Function
==
GRAPHICS_EXT_FUNC_CODE
&&
eb
->
ByteCount
==
8
)
{
if
(
eb
->
Bytes
[
3
]
&
1
)
{
trans
=
(
unsigned
char
)
eb
->
Bytes
[
6
];
colors
[
trans
]
&=
0xffffff
;
/* set alpha to 0 */
break
;
}
}
}
return
IWICPalette_InitializeCustom
(
palette
,
colors
,
cm
->
ColorCount
);
}
...
...
@@ -1258,6 +1274,7 @@ static HRESULT WINAPI GifDecoder_GetFrame(IWICBitmapDecoder *iface,
result
->
frame
=
&
This
->
gif
->
SavedImages
[
index
];
IWICBitmapDecoder_AddRef
(
iface
);
result
->
parent
=
This
;
This
->
current_frame
=
index
;
*
ppIBitmapFrame
=
&
result
->
IWICBitmapFrameDecode_iface
;
...
...
@@ -1396,6 +1413,7 @@ HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
This
->
ref
=
1
;
This
->
initialized
=
FALSE
;
This
->
gif
=
NULL
;
This
->
current_frame
=
0
;
InitializeCriticalSection
(
&
This
->
lock
);
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": GifDecoder.lock"
);
...
...
dlls/windowscodecs/tests/gifformat.c
View file @
a4579784
...
...
@@ -127,7 +127,6 @@ static void test_global_gif_palette(void)
ok
(
hr
==
S_OK
,
"GetColors error %#x
\n
"
,
hr
);
ok
(
ret
==
count
,
"expected %u, got %u
\n
"
,
count
,
ret
);
ok
(
color
[
0
]
==
0xff010203
,
"expected 0xff010203, got %#x
\n
"
,
color
[
0
]);
todo_wine
ok
(
color
[
1
]
==
0x00040506
,
"expected 0x00040506, got %#x
\n
"
,
color
[
1
]);
ok
(
color
[
2
]
==
0xff070809
,
"expected 0xff070809, got %#x
\n
"
,
color
[
2
]);
ok
(
color
[
3
]
==
0xff0a0b0c
,
"expected 0xff0a0b0c, got %#x
\n
"
,
color
[
3
]);
...
...
@@ -193,7 +192,6 @@ static void test_global_gif_palette_2frames(void)
ok
(
hr
==
S_OK
,
"GetColors error %#x
\n
"
,
hr
);
ok
(
ret
==
count
,
"expected %u, got %u
\n
"
,
count
,
ret
);
ok
(
color
[
0
]
==
0xff010203
,
"expected 0xff010203, got %#x
\n
"
,
color
[
0
]);
todo_wine
ok
(
color
[
1
]
==
0x00040506
,
"expected 0x00040506, got %#x
\n
"
,
color
[
1
]);
ok
(
color
[
2
]
==
0xff070809
,
"expected 0xff070809, got %#x
\n
"
,
color
[
2
]);
ok
(
color
[
3
]
==
0xff0a0b0c
,
"expected 0xff0a0b0c, got %#x
\n
"
,
color
[
3
]);
...
...
@@ -238,7 +236,6 @@ todo_wine
ok
(
ret
==
count
,
"expected %u, got %u
\n
"
,
count
,
ret
);
ok
(
color
[
0
]
==
0xff010203
,
"expected 0xff010203, got %#x
\n
"
,
color
[
0
]);
ok
(
color
[
1
]
==
0xff040506
||
broken
(
color
[
1
]
==
0x00040506
)
/* XP */
,
"expected 0xff040506, got %#x
\n
"
,
color
[
1
]);
todo_wine
ok
(
color
[
2
]
==
0x00070809
||
broken
(
color
[
2
]
==
0xff070809
)
/* XP */
,
"expected 0x00070809, got %#x
\n
"
,
color
[
2
]);
ok
(
color
[
3
]
==
0xff0a0b0c
,
"expected 0xff0a0b0c, got %#x
\n
"
,
color
[
3
]);
...
...
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