Commit 343b114c authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit 16.2.5 upon wine-2.0

parent 3ba38c06
......@@ -1964,6 +1964,7 @@ static void widen_dashed_figure(GpPath *path, GpPen *pen, int start, int end,
REAL dash_pos=0.0;
int dash_index=0;
const REAL *dash_pattern;
REAL *dash_pattern_scaled;
int dash_count;
GpPointF *tmp_points;
REAL segment_dy;
......@@ -2002,6 +2003,12 @@ static void widen_dashed_figure(GpPath *path, GpPen *pen, int start, int end,
break;
}
dash_pattern_scaled = heap_alloc(dash_count * sizeof(REAL));
if (!dash_pattern_scaled) return;
for (i = 0; i < dash_count; i++)
dash_pattern_scaled[i] = pen->width * dash_pattern[i];
tmp_points = heap_alloc_zero((end - start + 2) * sizeof(GpPoint));
if (!tmp_points) return; /* FIXME */
......@@ -2050,7 +2057,7 @@ static void widen_dashed_figure(GpPath *path, GpPen *pen, int start, int end,
}
}
if (dash_pattern[dash_index] - dash_pos > segment_length - segment_pos)
if (dash_pattern_scaled[dash_index] - dash_pos > segment_length - segment_pos)
{
/* advance to next segment */
if ((dash_index % 2) == 0)
......@@ -2064,7 +2071,7 @@ static void widen_dashed_figure(GpPath *path, GpPen *pen, int start, int end,
else
{
/* advance to next dash in pattern */
segment_pos += dash_pattern[dash_index] - dash_pos;
segment_pos += dash_pattern_scaled[dash_index] - dash_pos;
dash_pos = 0.0;
if (++dash_index == dash_count)
dash_index = 0;
......@@ -2076,8 +2083,7 @@ static void widen_dashed_figure(GpPath *path, GpPen *pen, int start, int end,
if (dash_index % 2 == 0 && num_tmp_points != 0)
{
/* last dash overflows last segment */
tmp_points[num_tmp_points] = path->pathdata.Points[end];
widen_open_figure(tmp_points, pen, 0, num_tmp_points,
widen_open_figure(tmp_points, pen, 0, num_tmp_points-1,
draw_start_cap ? pen->startcap : LineCapFlat, pen->customstart,
closed ? LineCapFlat : pen->endcap, pen->customend, last_point);
}
......
......@@ -1065,6 +1065,17 @@ static path_test_t widenline_wide_path[] = {
{5.0, 20.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0} /*3*/
};
static path_test_t widenline_dash_path[] = {
{5.0, 0.0, PathPointTypeStart, 0, 0}, /*0*/
{35.0, 0.0, PathPointTypeLine, 0, 0}, /*1*/
{35.0, 10.0, PathPointTypeLine, 0, 0}, /*2*/
{5.0, 10.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*3*/
{45.0, 0.0, PathPointTypeStart, 0, 0}, /*4*/
{50.0, 0.0, PathPointTypeLine, 0, 0}, /*5*/
{50.0, 10.0, PathPointTypeLine, 0, 0}, /*6*/
{45.0, 10.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*7*/
};
static void test_widen(void)
{
GpStatus status;
......@@ -1139,6 +1150,22 @@ static void test_widen(void)
status = GdipScaleMatrix(m, 1.0, 0.5, MatrixOrderAppend);
expect(Ok, status);
/* dashed line */
status = GdipResetPath(path);
expect(Ok, status);
status = GdipAddPathLine(path, 5.0, 5.0, 50.0, 5.0);
expect(Ok, status);
status = GdipSetPenDashStyle(pen, DashStyleDash);
expect(Ok, status);
status = GdipWidenPath(path, pen, m, 1.0);
expect(Ok, status);
ok_path(path, widenline_dash_path, sizeof(widenline_dash_path)/sizeof(path_test_t), FALSE);
status = GdipSetPenDashStyle(pen, DashStyleSolid);
expect(Ok, status);
/* pen width in UnitWorld */
GdipDeletePen(pen);
status = GdipCreatePen1(0xffffffff, 10.0, UnitWorld, &pen);
......
......@@ -390,7 +390,8 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i
if (!(flags & WINED3D_MAP_READONLY))
sub_resource->unmap_dirtify = TRUE;
if (texture->flags & WINED3D_TEXTURE_PIN_SYSMEM)
if (texture->flags & WINED3D_TEXTURE_PIN_SYSMEM && ((flags & WINED3D_MAP_DISCARD)
|| (sub_resource->locations & texture->resource.map_binding)))
return resource->resource_ops->resource_sub_resource_map(resource,
sub_resource_idx, map_desc, box, flags);
}
......
......@@ -1807,7 +1807,8 @@ static void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsig
struct wined3d_texture_sub_resource *sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx);
struct wined3d_bo_address bo_data;
if (device->d3d_initialized && !(texture->flags & WINED3D_TEXTURE_PIN_SYSMEM))
if (device->d3d_initialized && !((texture->flags & WINED3D_TEXTURE_PIN_SYSMEM)
&& (sub_resource->locations & texture->resource.map_binding)))
context = context_acquire(device, NULL);
if (flags & WINED3D_MAP_DISCARD)
......
......@@ -375,9 +375,6 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d
RECT rect = physDev->dc_rect;
OffsetRect( &rect, -physDev->dc_rect.left, -physDev->dc_rect.top );
/* The GL drawable may be lagged behind if we don't flush first, so
* flush the display make sure we copy up-to-date data */
XFlush( gdi_display );
XSetFunction( gdi_display, physDev->gc, GXcopy );
XCopyArea( gdi_display, data->gl_drawable, physDev->drawable, physDev->gc,
0, 0, rect.right, rect.bottom,
......
......@@ -420,6 +420,12 @@ static const char *(*pglXQueryCurrentRendererStringMESA)(int attribute);
static Bool (*pglXQueryRendererIntegerMESA)(Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
static const char *(*pglXQueryRendererStringMESA)(Display *dpy, int screen, int renderer, int attribute);
/* OpenML GLX Extensions */
static Bool (*pglXWaitForSbcOML)( Display *dpy, GLXDrawable drawable,
INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc );
static INT64 (*pglXSwapBuffersMscOML)( Display *dpy, GLXDrawable drawable,
INT64 target_msc, INT64 divisor, INT64 remainder );
/* Standard OpenGL */
static void (*pglFinish)(void);
static void (*pglFlush)(void);
......@@ -771,6 +777,12 @@ static BOOL WINAPI init_opengl( INIT_ONCE *once, void *param, void **context )
pglXQueryRendererStringMESA = pglXGetProcAddressARB( (const GLubyte *)"glXQueryRendererStringMESA" );
}
if (has_extension( WineGLInfo.glxExtensions, "GLX_OML_sync_control" ))
{
pglXWaitForSbcOML = pglXGetProcAddressARB( (const GLubyte *)"glXWaitForSbcOML" );
pglXSwapBuffersMscOML = pglXGetProcAddressARB( (const GLubyte *)"glXSwapBuffersMscOML" );
}
X11DRV_WineGL_LoadExtensions();
init_pixel_formats( gdi_display );
return TRUE;
......@@ -3319,6 +3331,7 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc )
struct x11drv_escape_flush_gl_drawable escape;
struct gl_drawable *gl;
struct wgl_context *ctx = NtCurrentTeb()->glContext;
INT64 ust, msc, sbc, target_sbc = 0;
TRACE("(%p)\n", hdc);
......@@ -3351,6 +3364,12 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc )
gl->rect.right - gl->rect.left, gl->rect.bottom - gl->rect.top );
break;
}
if (pglXSwapBuffersMscOML)
{
pglFlush();
target_sbc = pglXSwapBuffersMscOML( gdi_display, gl->drawable, 0, 0, 0 );
break;
}
pglXSwapBuffers(gdi_display, gl->drawable);
break;
case DC_GL_CHILD_WIN:
......@@ -3358,10 +3377,19 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc )
escape.gl_drawable = gl->window;
/* fall through */
default:
if (pglXSwapBuffersMscOML)
{
pglFlush();
target_sbc = pglXSwapBuffersMscOML( gdi_display, gl->drawable, 0, 0, 0 );
break;
}
pglXSwapBuffers(gdi_display, gl->drawable);
break;
}
if (escape.gl_drawable && pglXWaitForSbcOML)
pglXWaitForSbcOML( gdi_display, gl->drawable, target_sbc, &ust, &msc, &sbc );
release_gl_drawable( gl );
if (escape.gl_drawable) ExtEscape( ctx->hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL );
......
......@@ -4993,6 +4993,7 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
static const GUID wsarecvmsg_guid = WSAID_WSARECVMSG;
static const GUID wsasendmsg_guid = WSAID_WSASENDMSG;
total = sizeof(void*);
if ( IsEqualGUID(&connectex_guid, in_buff) )
{
*(LPFN_CONNECTEX *)out_buff = WS2_ConnectEx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment