22 #include "wine/port.h" 44 if (((pts[
i].
x + 0x8000) & ~0xffff) || ((pts[
i].
y + 0x8000) & ~0xffff))
59 dest_short[
i].
x = pts[
i].
x;
60 dest_short[
i].
y = pts[
i].
y;
62 return dest_short +
count;
148 struct gdi_path *
path;
159 free_gdi_path(
path );
234 double angleStart, angleEnd;
235 double xinterStart, yinterStart, xinterEnd, yinterEnd;
274 angleStart =
atan2( -(
double)ystart, (
double)xstart);
275 angleEnd =
atan2( -(
double)yend, (
double)xend);
279 xinterStart = (
right -
left + 1)/2 *
cos(angleStart) + xCentre;
280 yinterStart = -(
bottom -
top + 1)/2 *
sin(angleStart) + yCentre;
281 xinterEnd = (
right -
left + 1)/2 *
cos(angleEnd) + xCentre;
282 yinterEnd = -(
bottom -
top + 1)/2 *
sin(angleEnd) + yCentre;
284 if(angleStart < 0) angleStart += 2 *
M_PI;
285 if(angleEnd < 0) angleEnd += 2 *
M_PI;
286 if(angleEnd < angleStart) angleEnd += 2 *
M_PI;
288 bounds.
left =
min(xinterStart, xinterEnd);
289 bounds.
top =
min(yinterStart, yinterEnd);
290 bounds.
right =
max(xinterStart, xinterEnd);
291 bounds.
bottom =
max(yinterStart, yinterEnd);
293 for(
i = 0;
i <= 8;
i++) {
294 if(
i *
M_PI / 2 < angleStart)
296 if(
i *
M_PI / 2 > angleEnd)
320 if(bounds.
left > xCentre) bounds.
left = xCentre;
321 else if(bounds.
right < xCentre) bounds.
right = xCentre;
322 if(bounds.
top > yCentre) bounds.
top = yCentre;
323 else if(bounds.
bottom < yCentre) bounds.
bottom = yCentre;
645 for(poly = 0; poly < polys; poly++) {
646 cptl += counts[poly];
647 if(counts[poly] < 2) bounds_valid =
FALSE;
649 if(!cptl) bounds_valid =
FALSE;
660 emr->emr.iType =
iType;
663 emr->emr.nSize =
size;
664 if(bounds_valid && !physDev->
path)
673 memcpy( emr->aPolyCounts, counts, polys *
sizeof(
DWORD) );
678 if(
ret && !bounds_valid)
756 emr.
iMode = fillType;
899 const UINT textAlign =
dc->textAlign;
900 const INT graphicsMode =
dc->GraphicsMode;
902 FLOAT exScale, eyScale;
916 SIZE wndext, vportext;
920 exScale = 100.0 * ((
FLOAT)horzSize / (
FLOAT)horzRes) /
922 eyScale = 100.0 * ((
FLOAT)vertSize / (
FLOAT)vertRes) /
958 textWidth += lpDx[
i];
961 textHeight = strSize.
cy;
970 textWidth += charSize.
cx;
971 textHeight =
max(textHeight, charSize.
cy);
1037 ULONG i,
pt,
size, num_pts = ngrad * (
mode == GRADIENT_FILL_TRIANGLE ? 3 : 2);
1038 const ULONG *pts = (
const ULONG *)grad_array;
1044 if (!emr)
return FALSE;
1046 for (
i = 0;
i < num_pts;
i++)
1052 emr->rclBounds.left = emr->rclBounds.right = vert_array[
pt].
x;
1053 emr->rclBounds.top = emr->rclBounds.bottom = vert_array[
pt].
y;
1058 emr->rclBounds.left = vert_array[
pt].
x;
1059 else if (vert_array[
pt].
x > emr->rclBounds.right)
1060 emr->rclBounds.right = vert_array[
pt].
x;
1062 emr->rclBounds.top = vert_array[
pt].
y;
1063 else if (vert_array[
pt].
y > emr->rclBounds.bottom)
1064 emr->rclBounds.bottom = vert_array[
pt].
y;
1067 emr->rclBounds.right--;
1068 emr->rclBounds.bottom--;
1070 emr->emr.iType = EMR_GRADIENTFILL;
1071 emr->emr.nSize =
size;
1075 memcpy( emr->Ver, vert_array, nvert *
sizeof(vert_array[0]) );
1076 memcpy( emr->Ver + nvert, pts, num_pts *
sizeof(pts[0]) );
static const RECTL empty_bounds
#define ERROR_INVALID_PARAMETER
BOOL EMFDRV_Chord(PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
BOOL WINAPI GetCurrentPositionEx(_In_ HDC, _Out_ LPPOINT)
BOOL EMFDRV_InvertRgn(PHYSDEV dev, HRGN hrgn)
GLint GLint GLsizei width
BOOL EMFDRV_FrameRgn(PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, INT height)
valarray< _Tp > atan2(const valarray< _Tp > &__x, const valarray< _Tp > &__y)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
BOOL EMFDRV_Pie(PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
BOOL EMFDRV_Polyline(PHYSDEV dev, const POINT *pt, INT count)
BOOL EMFDRV_Polygon(PHYSDEV dev, const POINT *pt, INT count)
#define EMR_STROKEANDFILLPATH
GLsizei const GLchar ** path
static BOOL EMFDRV_PaintInvertRgn(PHYSDEV dev, HRGN hrgn, DWORD iType)
GLuint GLuint GLsizei count
*nSize LPSTR _Inout_ LPDWORD nSize
BOOL EMFDRV_LineTo(PHYSDEV dev, INT x, INT y)
BOOL EMFDRV_AngleArc(PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep)
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint x
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus)
static BOOL can_use_short_points(const POINT *pts, UINT count)
COLORREF EMFDRV_SetPixel(PHYSDEV dev, INT x, INT y, COLORREF color)
BOOL EMFDRV_PolyPolyline(PHYSDEV dev, const POINT *pt, const DWORD *counts, DWORD polys)
BOOL EMFDRV_Arc(PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
static void * store_points(POINTL *dest, const POINT *pts, UINT count, BOOL short_points)
UINT WINAPI GetTextAlign(_In_ HDC)
BOOL EMFDRV_PolyBezierTo(PHYSDEV dev, const POINT *pts, DWORD count)
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
BOOL EMFDRV_Ellipse(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
BOOL EMFDRV_PolyDraw(PHYSDEV dev, const POINT *pts, const BYTE *types, DWORD count)
BOOL EMFDRV_ExtFloodFill(PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType)
BOOL EMFDRV_StrokePath(PHYSDEV dev)
BOOL EMFDRV_PaintRgn(PHYSDEV dev, HRGN hrgn)
BOOL EMFDRV_MoveTo(PHYSDEV dev, INT x, INT y)
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
BOOL EMFDRV_FillPath(PHYSDEV dev)
#define offsetof(TYPE, MEMBER)
BOOL EMFDRV_StrokeAndFillPath(PHYSDEV dev)
static BOOL EMFDRV_ArcChordPie(PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend, DWORD iType)
static BOOL emfdrv_stroke_and_fill_path(PHYSDEV dev, INT type)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI GetViewportExtEx(_In_ HDC, _Out_ LPSIZE)
int WINAPI GetGraphicsMode(_In_ HDC)
BOOL EMFDRV_PolylineTo(PHYSDEV dev, const POINT *pt, INT count)
BOOL WINAPI GetWindowExtEx(_In_ HDC, _Out_ LPSIZE)
const char * wine_dbgstr_rect(const RECT *rect)
int WINAPI GetPath(_In_ HDC hdc, _Out_writes_opt_(cpt) LPPOINT apt, _Out_writes_opt_(cpt) LPBYTE aj, int cpt)
GLsizei const GLfloat * points
static const unsigned char enhmetafile[]
BOOL EMFDRV_PolyBezier(PHYSDEV dev, const POINT *pts, DWORD count)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define memcpy(s1, s2, n)
GLint GLint GLsizei GLsizei height
BOOL EMFDRV_RoundRect(PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height)
static BOOL EMFDRV_PolyPolylinegon(PHYSDEV dev, const POINT *pt, const INT *counts, UINT polys, DWORD iType)
char ACPI_OBJECT_TYPE * Types
WINEDC * get_physdev_dc(PHYSDEV dev)
#define FIELD_OFFSET(t, f)
BOOL EMFDRV_ExtTextOut(PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx)
GLint GLint GLint GLint GLint GLint y
BOOL EMFDRV_ArcTo(PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
BOOL EMFDRV_GradientFill(PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert, void *grad_array, ULONG ngrad, ULONG mode)
BOOL EMFDRV_PolyPolygon(PHYSDEV dev, const POINT *pt, const INT *counts, UINT polys)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
GLdouble GLdouble GLdouble GLdouble top
#define EMR_POLYPOLYLINE16
static void get_points_bounds(RECTL *bounds, const POINT *pts, UINT count, DC *dc)
static BOOL EMFDRV_Polylinegon(PHYSDEV dev, const POINT *pt, INT count, DWORD iType)
BOOL EMFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)
#define HeapFree(x, y, z)
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
BOOL EMFDRV_FillRgn(PHYSDEV dev, HRGN hrgn, HBRUSH hbrush)