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
a3822f97
Commit
a3822f97
authored
Mar 12, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/tests: Add gif frames composition tests.
parent
821932da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
1 deletion
+94
-1
image.c
dlls/gdiplus/tests/image.c
+94
-1
No files found.
dlls/gdiplus/tests/image.c
View file @
a3822f97
...
...
@@ -2423,6 +2423,51 @@ static const unsigned char gifanimation[72] = {
0x00
,
0x00
,
0x02
,
0x02
,
0x44
,
0x01
,
0x00
,
0x3b
};
/* Generated with ImageMagick:
* convert -transparent black -delay 100 -size 8x2 xc:black \
* -dispose none -page +0+0 -size 2x2 xc:red \
* -dispose background -page +2+0 -size 2x2 xc:blue \
* -dispose previous -page +4+0 -size 2x2 xc:green \
* -dispose undefined -page +6+0 -size 2x2 xc:gray \
* test.gif
*/
static
const
unsigned
char
gifanimation2
[]
=
{
0x47
,
0x49
,
0x46
,
0x38
,
0x39
,
0x61
,
0x08
,
0x00
,
0x02
,
0x00
,
0xf0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x01
,
0x64
,
0x00
,
0x00
,
0x00
,
0x21
,
0xff
,
0x0b
,
0x4e
,
0x45
,
0x54
,
0x53
,
0x43
,
0x41
,
0x50
,
0x45
,
0x32
,
0x2e
,
0x30
,
0x03
,
0x01
,
0x00
,
0x00
,
0x00
,
0x2c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x08
,
0x00
,
0x02
,
0x00
,
0x00
,
0x02
,
0x04
,
0x84
,
0x8f
,
0x09
,
0x05
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x04
,
0x64
,
0x00
,
0x00
,
0x00
,
0x2c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x02
,
0x00
,
0x81
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0x02
,
0x03
,
0x44
,
0x34
,
0x05
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x08
,
0x64
,
0x00
,
0x00
,
0x00
,
0x2c
,
0x02
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x02
,
0x00
,
0x81
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x00
,
0x00
,
0xff
,
0x02
,
0x03
,
0x44
,
0x34
,
0x05
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x0c
,
0x64
,
0x00
,
0x00
,
0x00
,
0x2c
,
0x04
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x02
,
0x00
,
0x81
,
0x00
,
0x80
,
0x00
,
0x00
,
0x80
,
0x00
,
0x00
,
0x80
,
0x00
,
0x00
,
0x80
,
0x00
,
0x02
,
0x03
,
0x44
,
0x34
,
0x05
,
0x00
,
0x21
,
0xf9
,
0x04
,
0x00
,
0x64
,
0x00
,
0x00
,
0x00
,
0x2c
,
0x06
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x02
,
0x00
,
0x80
,
0x7e
,
0x7e
,
0x7e
,
0x00
,
0x00
,
0x00
,
0x02
,
0x02
,
0x84
,
0x51
,
0x00
,
0x3b
};
static
ARGB
gifanimation2_pixels
[
5
][
4
]
=
{
{
0
,
0
,
0
,
0
},
{
0xffff0000
,
0
,
0
,
0
},
{
0xffff0000
,
0xff0000ff
,
0
,
0
},
{
0xffff0000
,
0
,
0xff008000
,
0
},
{
0xffff0000
,
0
,
0
,
0xff7e7e7e
}
};
static
void
test_multiframegif
(
void
)
{
LPSTREAM
stream
;
...
...
@@ -2435,7 +2480,7 @@ static void test_multiframegif(void)
UINT
count
;
GUID
dimension
;
PixelFormat
pixel_format
;
INT
palette_size
;
INT
palette_size
,
i
,
j
;
/* Test frame functions with an animated GIF */
hglob
=
GlobalAlloc
(
0
,
sizeof
(
gifanimation
));
...
...
@@ -2575,6 +2620,54 @@ static void test_multiframegif(void)
GdipDisposeImage
((
GpImage
*
)
bmp
);
IStream_Release
(
stream
);
/* Test frame dispose methods */
hglob
=
GlobalAlloc
(
0
,
sizeof
(
gifanimation2
));
data
=
GlobalLock
(
hglob
);
memcpy
(
data
,
gifanimation2
,
sizeof
(
gifanimation2
));
GlobalUnlock
(
hglob
);
hres
=
CreateStreamOnHGlobal
(
hglob
,
TRUE
,
&
stream
);
ok
(
hres
==
S_OK
,
"Failed to create a stream
\n
"
);
stat
=
GdipCreateBitmapFromStream
(
stream
,
&
bmp
);
ok
(
stat
==
Ok
,
"Failed to create a Bitmap
\n
"
);
IStream_Release
(
stream
);
stat
=
GdipImageGetFrameDimensionsList
((
GpImage
*
)
bmp
,
&
dimension
,
1
);
expect
(
Ok
,
stat
);
expect_guid
(
&
FrameDimensionTime
,
&
dimension
,
__LINE__
,
FALSE
);
stat
=
GdipImageGetFrameCount
((
GpImage
*
)
bmp
,
&
dimension
,
&
count
);
expect
(
Ok
,
stat
);
expect
(
5
,
count
);
stat
=
GdipBitmapGetPixel
(
bmp
,
0
,
0
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0
,
color
);
stat
=
GdipImageSelectActiveFrame
((
GpImage
*
)
bmp
,
&
dimension
,
3
);
stat
=
GdipBitmapGetPixel
(
bmp
,
2
,
0
,
&
color
);
expect
(
Ok
,
stat
);
ok
(
color
==
0
||
broken
(
color
==
0xff0000ff
),
"color = %x
\n
"
,
color
);
if
(
color
!=
0
)
{
win_skip
(
"broken animated gif support
\n
"
);
GdipDisposeImage
((
GpImage
*
)
bmp
);
return
;
}
for
(
i
=
0
;
i
<
6
;
i
++
)
{
stat
=
GdipImageSelectActiveFrame
((
GpImage
*
)
bmp
,
&
dimension
,
i
%
5
);
expect
(
Ok
,
stat
);
for
(
j
=
0
;
j
<
4
;
j
++
)
{
stat
=
GdipBitmapGetPixel
(
bmp
,
j
*
2
,
0
,
&
color
);
expect
(
Ok
,
stat
);
ok
(
gifanimation2_pixels
[
i
%
5
][
j
]
==
color
,
"at %d,%d got %x, expected %x
\n
"
,
i
,
j
,
color
,
gifanimation2_pixels
[
i
%
5
][
j
]);
}
}
GdipDisposeImage
((
GpImage
*
)
bmp
);
}
static
void
test_rotateflip
(
void
)
...
...
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