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
56238cd7
Commit
56238cd7
authored
Feb 25, 2010
by
Justin Chevrier
Committed by
Alexandre Julliard
Feb 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/test: Add GdipGetNearestColor test.
parent
52a05108
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
153 additions
and
0 deletions
+153
-0
graphics.c
dlls/gdiplus/tests/graphics.c
+153
-0
No files found.
dlls/gdiplus/tests/graphics.c
View file @
56238cd7
...
...
@@ -2270,6 +2270,158 @@ static void test_GdipIsVisibleRect(void)
ReleaseDC
(
0
,
hdc
);
}
static
void
test_GdipGetNearestColor
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
;
GpBitmap
*
bitmap
;
ARGB
color
=
0xdeadbeef
;
HDC
hdc
=
GetDC
(
0
);
/* create a graphics object */
ok
(
hdc
!=
NULL
,
"Expected HDC to be initialized
\n
"
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
ok
(
graphics
!=
NULL
,
"Expected graphics to be initialized
\n
"
);
status
=
GdipGetNearestColor
(
graphics
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetNearestColor
(
NULL
,
&
color
);
expect
(
InvalidParameter
,
status
);
GdipDeleteGraphics
(
graphics
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat1bppIndexed
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
ok
(
broken
(
status
==
OutOfMemory
)
/* winver < Win7 */
||
status
==
Ok
,
"status=%u
\n
"
,
status
);
if
(
status
==
Ok
)
{
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
}
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat4bppIndexed
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
ok
(
broken
(
status
==
OutOfMemory
)
/* winver < Win7 */
||
status
==
Ok
,
"status=%u
\n
"
,
status
);
if
(
status
==
Ok
)
{
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
}
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat8bppIndexed
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
ok
(
broken
(
status
==
OutOfMemory
)
/* winver < Win7 */
||
status
==
Ok
,
"status=%u
\n
"
,
status
);
if
(
status
==
Ok
)
{
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
}
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat16bppGrayScale
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
todo_wine
expect
(
OutOfMemory
,
status
);
if
(
status
==
Ok
)
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat24bppRGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat32bppRGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat32bppARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat48bppRGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat64bppARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat64bppPARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat16bppRGB565
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
todo_wine
expect
(
0xffa8bce8
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat16bppRGB555
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
todo_wine
expect
(
Ok
,
status
);
todo_wine
expect
(
0xffa8b8e8
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
ReleaseDC
(
0
,
hdc
);
}
START_TEST
(
graphics
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -2296,6 +2448,7 @@ START_TEST(graphics)
test_GdipDrawLineI
();
test_GdipDrawLinesI
();
test_GdipDrawString
();
test_GdipGetNearestColor
();
test_GdipGetVisibleClipBounds
();
test_GdipIsVisiblePoint
();
test_GdipIsVisibleRect
();
...
...
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