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
59eef10f
Commit
59eef10f
authored
Mar 13, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fixed palette flags setting.
parent
d6e2b5b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
10 deletions
+47
-10
image.c
dlls/gdiplus/image.c
+24
-10
image.c
dlls/gdiplus/tests/image.c
+23
-0
No files found.
dlls/gdiplus/image.c
View file @
59eef10f
...
@@ -87,22 +87,36 @@ static ColorPalette *get_palette(IWICBitmapFrameDecode *frame, WICBitmapPaletteT
...
@@ -87,22 +87,36 @@ static ColorPalette *get_palette(IWICBitmapFrameDecode *frame, WICBitmapPaletteT
}
}
if
(
hr
==
S_OK
)
if
(
hr
==
S_OK
)
{
{
WICBitmapPaletteType
type
;
BOOL
alpha
;
UINT
count
;
UINT
count
;
BOOL
mono
,
gray
;
IWICPalette_IsBlackWhite
(
wic_palette
,
&
mono
);
IWICPalette_IsGrayscale
(
wic_palette
,
&
gray
);
IWICPalette_GetColorCount
(
wic_palette
,
&
count
);
IWICPalette_GetColorCount
(
wic_palette
,
&
count
);
palette
=
HeapAlloc
(
GetProcessHeap
(),
0
,
2
*
sizeof
(
UINT
)
+
count
*
sizeof
(
ARGB
));
palette
=
HeapAlloc
(
GetProcessHeap
(),
0
,
2
*
sizeof
(
UINT
)
+
count
*
sizeof
(
ARGB
));
IWICPalette_GetColors
(
wic_palette
,
count
,
palette
->
Entries
,
&
palette
->
Count
);
IWICPalette_GetColors
(
wic_palette
,
count
,
palette
->
Entries
,
&
palette
->
Count
);
if
(
mono
)
IWICPalette_GetType
(
wic_palette
,
&
type
);
palette
->
Flags
=
0
;
switch
(
type
)
{
else
if
(
gray
)
case
WICBitmapPaletteTypeFixedGray4
:
palette
->
Flags
=
PaletteFlagsGrayScale
;
case
WICBitmapPaletteTypeFixedGray16
:
else
case
WICBitmapPaletteTypeFixedGray256
:
palette
->
Flags
=
PaletteFlagsHalftone
;
palette
->
Flags
=
PaletteFlagsGrayScale
;
break
;
case
WICBitmapPaletteTypeFixedHalftone8
:
case
WICBitmapPaletteTypeFixedHalftone27
:
case
WICBitmapPaletteTypeFixedHalftone64
:
case
WICBitmapPaletteTypeFixedHalftone125
:
case
WICBitmapPaletteTypeFixedHalftone216
:
case
WICBitmapPaletteTypeFixedHalftone252
:
case
WICBitmapPaletteTypeFixedHalftone256
:
palette
->
Flags
=
PaletteFlagsHalftone
;
break
;
default:
palette
->
Flags
=
0
;
}
IWICPalette_HasAlpha
(
wic_palette
,
&
alpha
);
if
(
alpha
)
palette
->
Flags
|=
PaletteFlagsHasAlpha
;
}
}
IWICPalette_Release
(
wic_palette
);
IWICPalette_Release
(
wic_palette
);
}
}
...
...
dlls/gdiplus/tests/image.c
View file @
59eef10f
...
@@ -2487,6 +2487,9 @@ static void test_multiframegif(void)
...
@@ -2487,6 +2487,9 @@ static void test_multiframegif(void)
GUID
dimension
;
GUID
dimension
;
PixelFormat
pixel_format
;
PixelFormat
pixel_format
;
INT
palette_size
,
i
,
j
;
INT
palette_size
,
i
,
j
;
char
palette_buf
[
256
];
ColorPalette
*
palette
;
ARGB
*
palette_entries
;
/* Test frame functions with an animated GIF */
/* Test frame functions with an animated GIF */
hglob
=
GlobalAlloc
(
0
,
sizeof
(
gifanimation
));
hglob
=
GlobalAlloc
(
0
,
sizeof
(
gifanimation
));
...
@@ -2644,6 +2647,26 @@ static void test_multiframegif(void)
...
@@ -2644,6 +2647,26 @@ static void test_multiframegif(void)
expect
(
Ok
,
stat
);
expect
(
Ok
,
stat
);
expect
(
PixelFormat8bppIndexed
,
pixel_format
);
expect
(
PixelFormat8bppIndexed
,
pixel_format
);
stat
=
GdipBitmapGetPixel
(
bmp
,
0
,
0
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0
,
color
);
stat
=
GdipGetImagePaletteSize
((
GpImage
*
)
bmp
,
&
palette_size
);
expect
(
Ok
,
stat
);
ok
(
palette_size
==
sizeof
(
ColorPalette
)
+
sizeof
(
ARGB
),
"palette_size = %d
\n
"
,
palette_size
);
memset
(
palette_buf
,
0xfe
,
sizeof
(
palette_buf
));
palette
=
(
ColorPalette
*
)
palette_buf
;
stat
=
GdipGetImagePalette
((
GpImage
*
)
bmp
,
palette
,
sizeof
(
ColorPalette
)
+
sizeof
(
ARGB
));
palette_entries
=
palette
->
Entries
;
expect
(
Ok
,
stat
);
expect
(
PaletteFlagsHasAlpha
,
palette
->
Flags
);
expect
(
2
,
palette
->
Count
);
expect
(
0
,
palette_entries
[
0
]);
expect
(
0xff000000
,
palette_entries
[
1
]);
count
=
12345
;
count
=
12345
;
stat
=
GdipImageGetFrameCount
((
GpImage
*
)
bmp
,
&
dimension
,
&
count
);
stat
=
GdipImageGetFrameCount
((
GpImage
*
)
bmp
,
&
dimension
,
&
count
);
expect
(
Ok
,
stat
);
expect
(
Ok
,
stat
);
...
...
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