27#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
28#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
39 ok(brush !=
NULL,
"Expected brush to be initialized\n");
55 ok(brush !=
NULL,
"Expected the brush to be initialized.\n");
61 ok(brush !=
NULL,
"Expected the brush to be initialized.\n");
200 blends[0] = (
REAL)0xdeadbeef;
487 expectf(1.414214, elements[0]);
488 expectf(2.828427, elements[1]);
489 expectf(-0.353553, elements[2]);
490 expectf(0.707107, elements[3]);
491 expectf(5.303300, elements[4]);
492 expectf(-3.535534, elements[5]);
533 rectf.
X = rectf.
Y = 10.0;
636 {
LinearGradientModeVertical, { 0.0f, 0.0f, 100.0f, 10.0f }, { 0.0f, 0.1f, -10.0f, -0.0f, 100.0f, 0.0f } },
637 {
LinearGradientModeVertical, { 10.0f, -12.0f, 100.0f, 105.0f }, { 0.0f, 1.05f, -0.952f, 0.0f, 98.571f, -22.5f } },
647 { { 1.0f, 1.0f }, { 100.0f, 100.0f }, { 1.0f, 1.0f, 99.0f, 99.0f }, { 1.0f, 1.0f, -1.0f, 1.0f, 50.50f, -50.50f } },
648 { { 0.0f, 0.0f }, { 0.0f, 10.0f }, { -5.0f, 0.0f, 10.0f, 10.0f }, { 0.0f, 1.0f, -1.0f, 0.0f, 5.0f, 5.0f } },
649 { { 0.0f, 0.0f }, { 10.0f, 0.0f }, { 0.0f, -5.0f, 10.0f, 10.0f }, { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f } },
651 { { 0.0f, 0.0f }, { 20.0f, -20.0f }, { 0.0f, -20.0f, 20.0f, 20.0f }, { 1.0f, -1.0f, 1.0f, 1.0f, 10.0f, 10.0f } },
653 { { 0.0f, 0.0f }, { 100.0f, 1.0f }, { 0.0f, 0.0f, 100.0f, 1.0f }, { 1.0f, 0.01f, -0.02f, 2.0f, 0.01f, -1.0f } },
654 { { 10.0f, 10.0f }, { -90.0f, 10.0f }, { -90.0f, -40.0f, 100.0f, 100.0f }, { -1.0f, 0.0f, 0.0f, -1.0f, -80.0f, 20.0f } },
663 create_with_angle[] =
665 { { 10.0f, 10.0f, -100.0f, -100.0f }, 0.0f,
TRUE },
666 { { 10.0f, 10.0f, -100.0f, -100.0f }, 0.0f,
FALSE },
667 { { 10.0f, 10.0f, 100.0f, 100.0f }, 0.0f,
FALSE },
668 { { 10.0f, 10.0f, 100.0f, 100.0f }, 0.0f,
TRUE },
669 { { 10.0f, -5.0f, 100.0f, 50.0f }, 0.0f,
FALSE },
670 { { 10.0f, -5.0f, 100.0f, 50.0f }, 0.0f,
TRUE },
671 { { -5.0f, 10.0f, 100.0f, 50.0f }, 0.0f,
FALSE },
672 { { -5.0f, 10.0f, 100.0f, 50.0f }, 0.0f,
TRUE },
673 { { 0.0f, 0.0f, 100.0f, 10.0f }, -90.0f,
TRUE, { 0.0f, -0.1f, 10.0f, 0.0f, 0.0f, 10.0f } },
674 { { 10.0f, -12.0f, 100.0f, 105.0f }, -90.0f,
TRUE, { 0.0f, -1.05f, 0.952f, 0.0f, 21.429f, 103.5f } },
675 { { 0.0f, 0.0f, 100.0f, 10.0f }, -90.0f,
FALSE, { 0.0f, -0.1f, 10.0f, -0.0f, 0.0f, 10.0f } },
676 { { 10.0f, -12.0f, 100.0f, 105.0f }, -90.0f,
FALSE, { 0.0f, -1.05f, 0.952f, 0.0f, 21.429f, 103.5f } },
694 memset(&rectf, 0,
sizeof(rectf));
697 ok(!
memcmp(&rectf, &create_from_pt[
i].
rect,
sizeof(rectf)),
"Unexpected brush rect.\n");
705#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
716 ok(colors[0] == 0x1 && colors[1] == 0x2,
"Unexpected brush colors.\n");
723 rectf.
X = rectf.
Y = 10.0;
731 rectf.
X = rectf.
Y = 10.0;
747 memset(&rectf, 0,
sizeof(rectf));
750 ok(!
memcmp(&rectf, &create_from_rect[
i].
rect,
sizeof(rectf)),
"Unexpected brush rect.\n");
765#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
777 ok(colors[0] == 0x1 && colors[1] == 0x2,
"Unexpected brush colors.\n");
792 memset(&rectf, 0,
sizeof(rectf));
795 ok(!
memcmp(&rectf, &create_with_angle[
i].
rect,
sizeof(rectf)),
"%u: unexpected brush rect {%f,%f,%f,%f}.\n",
801 if (create_with_angle[
i].
angle == 0.0f)
811#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
823 ok(colors[0] == 0x1 && colors[1] == 0x2,
"Unexpected brush colors.\n");
839 const REAL factors[5] = {0.0f, 0.1f, 0.5f, 0.9f, 1.0f};
840 const REAL positions[5] = {0.0f, 0.2f, 0.5f, 0.8f, 1.0f};
841 const REAL two_positions[2] = {0.0f, 1.0f};
842 const ARGB colors[5] = {0xff0000ff, 0xff00ff00, 0xff00ffff, 0xffff0000, 0xffffffff};
843 REAL res_factors[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
844 REAL res_positions[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
845 ARGB res_colors[6] = {0xdeadbeef, 0, 0, 0, 0};
847 pt1.
X = pt1.
Y = pt2.
Y = pt2.
X = 1.0;
852 pt2.
X = pt2.
Y = 100.0;
1015 expectf(positions[
i], res_positions[
i]);
1034 REAL res_factors[3] = {0.3f};
1035 REAL res_positions[3] = {0.3f};
1040 pt1.
X = pt1.
Y = 1.0;
1041 pt2.
X = pt2.
Y = 100.0;
1056 expectf(0.0, res_positions[0]);
1058 expectf(0.6, res_positions[1]);
1060 expectf(1.0, res_positions[2]);
1073 expectf(0.0, res_positions[0]);
1075 expectf(1.0, res_positions[1]);
1088 expectf(0.0, res_positions[0]);
1090 expectf(1.0, res_positions[1]);
1153 color[0] = 0x00ff0000;
1154 color[1] = 0x0000ff00;
1300 static const GpPointF path_points[] = {{0,0}, {3,0}, {0,4}};
1353 static const GpPointF path_points[] = {{0,0}, {3,0}, {0,4}};
1358 const REAL positions[5] = {0.0f, 0.2f, 0.5f, 0.8f, 1.0f};
1359 const REAL two_positions[2] = {0.0f, 1.0f};
1360 const ARGB colors[5] = {0xff0000ff, 0xff00ff00, 0xff00ffff, 0xffff0000, 0xffffffff};
1361 REAL res_positions[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
1362 ARGB res_colors[6] = {0xdeadbeef, 0, 0, 0, 0};
1441 res_colors[0] = 0xdeadbeef;
1442 res_positions[0] = 0.3;
1447 expect(0xdeadbeef, res_colors[0]);
1448 expectf(0.3, res_positions[0]);
1453 expectf(positions[
i], res_positions[
i]);
1461 expect(colors[
i], res_colors[
i+1]);
1462 expectf(positions[
i], res_positions[
i+1]);
1472 expectf(positions[
i], res_positions[
i]);
1493 static const GpPointF path_points[] = {{0,0}, {3,0}, {0,4}};
1497 const REAL factors[5] = {0.0f, 0.1f, 0.5f, 0.9f, 1.0f};
1498 const REAL positions[5] = {0.0f, 0.2f, 0.5f, 0.8f, 1.0f};
1499 REAL res_factors[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
1500 REAL res_positions[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
1575 expectf(positions[
i], res_positions[
i]);
1629 memset( &
class, 0,
sizeof(
class) );
1630 class.lpszClassName =
"gdiplus_test";
1640 ok(
hwnd !=
NULL,
"Expected window to be created\n");
int CDECL _controlfp_s(unsigned int *cur, unsigned int newval, unsigned int mask)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define GetProcAddress(x, y)
GpStatus WINGDIPAPI GdipScaleLineTransform(GpLineGradient *brush, REAL sx, REAL sy, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipGetTextureTransform(GpTexture *brush, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF *rect, ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, GpLineGradient **line)
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF *rect, ARGB startcolor, ARGB endcolor, REAL angle, BOOL isAngleScalable, GpWrapMode wrap, GpLineGradient **line)
GpStatus WINGDIPAPI GdipMultiplyLineTransform(GpLineGradient *brush, GDIPCONST GpMatrix *matrix, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient *brush, ARGB *colors)
GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
GpStatus WINGDIPAPI GdipGetLinePresetBlendCount(GpLineGradient *brush, INT *count)
GpStatus WINGDIPAPI GdipCreateHatchBrush(GpHatchStyle hatchstyle, ARGB forecol, ARGB backcol, GpHatch **brush)
GpStatus WINGDIPAPI GdipGetLineGammaCorrection(GpLineGradient *line, BOOL *usinggamma)
GpStatus WINGDIPAPI GdipGetTextureWrapMode(GpTexture *brush, GpWrapMode *wrapmode)
GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *texture, GDIPCONST GpMatrix *matrix)
GpStatus WINGDIPAPI GdipGetPathGradientPresetBlend(GpPathGradient *brush, ARGB *blend, REAL *pos, INT count)
GpStatus WINGDIPAPI GdipGetPathGradientBlendCount(GpPathGradient *brush, INT *count)
GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient *grad, ARGB *argb, INT *count)
GpStatus WINGDIPAPI GdipResetLineTransform(GpLineGradient *brush)
GpStatus WINGDIPAPI GdipGetPathGradientRect(GpPathGradient *brush, GpRectF *rect)
GpStatus WINGDIPAPI GdipSetPathGradientBlend(GpPathGradient *brush, GDIPCONST REAL *blend, GDIPCONST REAL *pos, INT count)
GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad, GpPointF *point)
GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF *points, INT count, GpWrapMode wrap, GpPathGradient **grad)
GpStatus WINGDIPAPI GdipGetLineTransform(GpLineGradient *brush, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF *startpoint, GDIPCONST GpPointF *endpoint, ARGB startcolor, ARGB endcolor, GpWrapMode wrap, GpLineGradient **line)
GpStatus WINGDIPAPI GdipSetLinePresetBlend(GpLineGradient *brush, GDIPCONST ARGB *blend, GDIPCONST REAL *positions, INT count)
GpStatus WINGDIPAPI GdipGetPathGradientBlend(GpPathGradient *brush, REAL *blend, REAL *positions, INT count)
GpStatus WINGDIPAPI GdipSetLineTransform(GpLineGradient *brush, GDIPCONST GpMatrix *matrix)
GpStatus WINGDIPAPI GdipGetHatchStyle(GpHatch *brush, GpHatchStyle *hatchstyle)
GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount(GpPathGradient *brush, INT *count)
GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient *brush, GDIPCONST REAL *factors, GDIPCONST REAL *positions, INT count)
GpStatus WINGDIPAPI GdipGetPathGradientPath(GpPathGradient *grad, GpPath *path)
GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount(GpPathGradient *brush, INT *count)
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
GpStatus WINGDIPAPI GdipTranslateLineTransform(GpLineGradient *brush, REAL dx, REAL dy, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus, REAL scale)
GpStatus WINGDIPAPI GdipResetTextureTransform(GpTexture *brush)
GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
GpStatus WINGDIPAPI GdipSetTextureWrapMode(GpTexture *brush, GpWrapMode wrapmode)
GpStatus WINGDIPAPI GdipGetLineBlend(GpLineGradient *brush, REAL *factors, REAL *positions, INT count)
GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient *grad, GpPointF *point)
GpStatus WINGDIPAPI GdipGetLinePresetBlend(GpLineGradient *brush, ARGB *blend, REAL *positions, INT count)
GpStatus WINGDIPAPI GdipGetLineBlendCount(GpLineGradient *brush, INT *count)
GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient *grad, GDIPCONST ARGB *argb, INT *count)
GpStatus WINGDIPAPI GdipCreateTexture(GpImage *image, GpWrapMode wrapmode, GpTexture **texture)
GpStatus WINGDIPAPI GdipGetBrushType(GpBrush *brush, GpBrushType *type)
GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend(GpPathGradient *brush, GDIPCONST ARGB *blend, GDIPCONST REAL *pos, INT count)
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height)
GpStatus WINGDIPAPI GdipCreateFromHWND(HWND hwnd, GpGraphics **graphics)
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height, GpGraphics *target, GpBitmap **bitmap)
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipCreateMatrix2(REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy, GpMatrix **matrix)
GpStatus WINGDIPAPI GdipIsMatrixEqual(GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, BOOL *result)
GpStatus WINGDIPAPI GdipGetMatrixElements(GDIPCONST GpMatrix *matrix, REAL *out)
GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy)
GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle, GpMatrixOrder order)
GpStatus WINGDIPAPI GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result)
GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix **matrix)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define wrap(journal, var)
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
@ LinearGradientModeHorizontal
@ LinearGradientModeVertical
void WINAPI GdiplusShutdown(ULONG_PTR)
GLuint GLuint GLsizei count
GLuint GLenum GLenum transform
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static void test_getgamma(void)
static void test_gradientgetrect(void)
static void test_pathgradientpresetblend(void)
static void test_pathgradientblend(void)
static void test_createHatchBrush(void)
static void test_getblend(void)
static void test_getHatchStyle(void)
static void test_createLineBrushFromRectWithAngle(void)
static void test_linelinearblend(void)
static GpPointF getblend_ptf[]
static void test_type(void)
static void test_lineblend(void)
static GpPointF getbounds_ptf[]
static void test_pathgradientcenterpoint(void)
static void test_texturewrap(void)
static void test_getbounds(void)
static GpPointF blendcount_ptf[]
#define expectf(expected, got)
static void test_gradientblendcount(void)
static void test_pathgradientpath(void)
static void test_gradientsurroundcolorcount(void)
static void test_constructor_destructor(void)
#define expectf2(expected, got)
static void test_transform(void)
#define WS_OVERLAPPEDWINDOW
TW_UINT32 TW_UINT16 TW_UINT16 MSG
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE hInstance, _In_ LPCSTR lpIconName)
HDC WINAPI GetDC(_In_opt_ HWND)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
BOOL WINAPI DestroyWindow(_In_ HWND)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)