winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2016
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
777 discussions
Start a n
N
ew thread
Vincent Povirk : gdiplus/tests: Add metafile test for SetClipRect.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 5ef00ff17e61b544aa0091a7766afeea4094c902 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5ef00ff17e61b544aa0091a77…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 16 16:00:27 2016 -0500 gdiplus/tests: Add metafile test for SetClipRect. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/tests/metafile.c | 109 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index a9d54a7..a965d4c 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -1869,6 +1869,114 @@ static void test_containers(void) expect(Ok, stat); } +static const emfplus_record clipping_records[] = { + {0, EMR_HEADER}, + {0, EmfPlusRecordTypeHeader}, + {0, EmfPlusRecordTypeSave}, + {0, EmfPlusRecordTypeSetClipRect}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeRestore}, + {0, EmfPlusRecordTypeSetClipRect}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeEndOfFile}, + {0, EMR_EOF}, + {0} +}; + +static void test_clipping(void) +{ + GpStatus stat; + GpMetafile *metafile; + GpGraphics *graphics; + GpBitmap *bitmap; + GpBrush *brush; + ARGB color; + HDC hdc; + static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; + static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; + static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; + GraphicsState state; + + hdc = CreateCompatibleDC(0); + + stat = GdipRecordMetafile(hdc, EmfTypeEmfPlusOnly, &frame, MetafileFrameUnitPixel, description, &metafile); + expect(Ok, stat); + + DeleteDC(hdc); + + if (stat != Ok) + return; + + stat = GdipGetImageGraphicsContext((GpImage*)metafile, &graphics); + expect(Ok, stat); + + stat = GdipSaveGraphics(graphics, &state); + expect(Ok, stat); + + stat = GdipSetClipRect(graphics, 30, 30, 10, 10, CombineModeReplace); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff000000, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 0, 0, 100, 100); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipRestoreGraphics(graphics, state); + expect(Ok, stat); + + stat = GdipSetClipRect(graphics, 30, 30, 10, 10, CombineModeXor); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff0000ff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 30, 30, 20, 10); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + check_metafile(metafile, clipping_records, "clipping metafile", dst_points, &frame, UnitPixel); + + sync_metafile(&metafile, "clipping.emf"); + + stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, stat); + + play_metafile(metafile, graphics, clipping_records, "clipping playback", dst_points, &frame, UnitPixel); + + stat = GdipBitmapGetPixel(bitmap, 80, 80, &color); + expect(Ok, stat); + expect(0, color); + + stat = GdipBitmapGetPixel(bitmap, 35, 35, &color); + expect(Ok, stat); + expect(0xff000000, color); + + stat = GdipBitmapGetPixel(bitmap, 45, 35, &color); + expect(Ok, stat); + expect(0xff0000ff, color); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + stat = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, stat); + + stat = GdipDisposeImage((GpImage*)metafile); + expect(Ok, stat); +} + START_TEST(metafile) { struct GdiplusStartupInput gdiplusStartupInput; @@ -1904,6 +2012,7 @@ START_TEST(metafile) test_converttoemfplus(); test_frameunit(); test_containers(); + test_clipping(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Vincent Povirk : gdiplus: Implement playback/recording for SetClipRect.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 3f6faddd565b3465c17da6748e069a3ceb320316 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f6faddd565b3465c17da6748…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 16 16:00:26 2016 -0500 gdiplus: Implement playback/recording for SetClipRect. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/gdiplus_private.h | 6 +++ dlls/gdiplus/graphics.c | 12 ++++-- dlls/gdiplus/metafile.c | 83 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 96 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 4ad49ca..678daed 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -81,6 +81,9 @@ extern REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi) DECLSPEC_HIDDEN; extern REAL pixels_to_units(REAL pixels, GpUnit unit, REAL dpi) DECLSPEC_HIDDEN; extern REAL units_scale(GpUnit from, GpUnit to, REAL dpi) DECLSPEC_HIDDEN; +extern GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_space, + GpCoordinateSpace src_space, GpMatrix *matrix) DECLSPEC_HIDDEN; + extern GpStatus graphics_from_image(GpImage *image, GpGraphics **graphics) DECLSPEC_HIDDEN; extern GpStatus METAFILE_GetGraphicsContext(GpMetafile* metafile, GpGraphics **result) DECLSPEC_HIDDEN; @@ -89,6 +92,8 @@ extern GpStatus METAFILE_ReleaseDC(GpMetafile* metafile, HDC hdc) DECLSPEC_HIDDE extern GpStatus METAFILE_GraphicsClear(GpMetafile* metafile, ARGB color) DECLSPEC_HIDDEN; extern GpStatus METAFILE_FillRectangles(GpMetafile* metafile, GpBrush* brush, GDIPCONST GpRectF* rects, INT count) DECLSPEC_HIDDEN; +extern GpStatus METAFILE_SetClipRect(GpMetafile* metafile, + REAL x, REAL y, REAL width, REAL height, CombineMode mode) DECLSPEC_HIDDEN; extern GpStatus METAFILE_SetPageTransform(GpMetafile* metafile, GpUnit unit, REAL scale) DECLSPEC_HIDDEN; extern GpStatus METAFILE_SetWorldTransform(GpMetafile* metafile, GDIPCONST GpMatrix* transform) DECLSPEC_HIDDEN; extern GpStatus METAFILE_ScaleWorldTransform(GpMetafile* metafile, REAL sx, REAL sy, MatrixOrder order) DECLSPEC_HIDDEN; @@ -372,6 +377,7 @@ struct GpMetafile{ GpUnit page_unit; REAL page_scale; GpRegion *base_clip; /* clip region in device space for all metafile output */ + GpRegion *clip; /* clip region within the metafile */ struct list containers; }; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 370fa88..84afee1 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -51,9 +51,6 @@ static GpStatus draw_driver_string(GpGraphics *graphics, GDIPCONST UINT16 *text, GDIPCONST GpBrush *brush, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix); -static GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_space, - GpCoordinateSpace src_space, GpMatrix *matrix); - /* Converts from gdiplus path point type to gdi path point type. */ static BYTE convert_path_point_type(BYTE type) { @@ -5642,6 +5639,13 @@ GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics *graphics, REAL x, REAL y, if(graphics->busy) return ObjectBusy; + if (graphics->image && graphics->image->type == ImageTypeMetafile) + { + status = METAFILE_SetClipRect((GpMetafile*)graphics->image, x, y, width, height, mode); + if (status != Ok) + return status; + } + rect.X = x; rect.Y = y; rect.Width = width; @@ -5983,7 +5987,7 @@ GpStatus WINGDIPAPI GdipGetClip(GpGraphics *graphics, GpRegion *region) return Ok; } -static GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_space, +GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_space, GpCoordinateSpace src_space, GpMatrix *matrix) { GpStatus stat = Ok; diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index a854e55..02cacb2 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -70,6 +70,12 @@ typedef struct EmfPlusFillRects DWORD Count; } EmfPlusFillRects; +typedef struct EmfPlusSetClipRect +{ + EmfPlusRecordHeader Header; + GpRectF ClipRect; +} EmfPlusSetClipRect; + typedef struct EmfPlusSetPageTransform { EmfPlusRecordHeader Header; @@ -137,6 +143,7 @@ typedef struct container GpMatrix world_transform; GpUnit page_unit; REAL page_scale; + GpRegion *clip; } container; static GpStatus METAFILE_AllocateRecord(GpMetafile *metafile, DWORD size, void **result) @@ -588,6 +595,32 @@ GpStatus METAFILE_FillRectangles(GpMetafile* metafile, GpBrush* brush, return Ok; } +GpStatus METAFILE_SetClipRect(GpMetafile* metafile, REAL x, REAL y, REAL width, REAL height, CombineMode mode) +{ + if (metafile->metafile_type == MetafileTypeEmfPlusOnly || metafile->metafile_type == MetafileTypeEmfPlusDual) + { + EmfPlusSetClipRect *record; + GpStatus stat; + + stat = METAFILE_AllocateRecord(metafile, + sizeof(EmfPlusSetClipRect), + (void**)&record); + if (stat != Ok) + return stat; + + record->Header.Type = EmfPlusRecordTypeSetClipRect; + record->Header.Flags = (mode & 0xf) << 8; + record->ClipRect.X = x; + record->ClipRect.Y = y; + record->ClipRect.Width = width; + record->ClipRect.Height = height; + + METAFILE_WriteRecords(metafile); + } + + return Ok; +} + GpStatus METAFILE_SetPageTransform(GpMetafile* metafile, GpUnit unit, REAL scale) { if (metafile->metafile_type == MetafileTypeEmfPlusOnly || metafile->metafile_type == MetafileTypeEmfPlusDual) @@ -1014,7 +1047,11 @@ static void METAFILE_PlaybackReleaseDC(GpMetafile *metafile) static GpStatus METAFILE_PlaybackUpdateClip(GpMetafile *metafile) { - return GdipCombineRegionRegion(metafile->playback_graphics->clip, metafile->base_clip, CombineModeReplace); + GpStatus stat; + stat = GdipCombineRegionRegion(metafile->playback_graphics->clip, metafile->base_clip, CombineModeReplace); + if (stat == Ok) + stat = GdipCombineRegionRegion(metafile->playback_graphics->clip, metafile->clip, CombineModeIntersect); + return stat; } static GpStatus METAFILE_PlaybackUpdateWorldTransform(GpMetafile *metafile) @@ -1166,6 +1203,32 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile, return stat; } + case EmfPlusRecordTypeSetClipRect: + { + EmfPlusSetClipRect *record = (EmfPlusSetClipRect*)header; + CombineMode mode = (CombineMode)((flags >> 8) & 0xf); + GpRegion *region; + GpMatrix world_to_device; + + if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(*record)) + return InvalidParameter; + + stat = GdipCreateRegionRect(&record->ClipRect, ®ion); + + if (stat == Ok) + { + get_graphics_transform(real_metafile->playback_graphics, + CoordinateSpaceDevice, CoordinateSpaceWorld, &world_to_device); + + GdipTransformRegion(region, &world_to_device); + + GdipCombineRegionRegion(real_metafile->clip, region, mode); + + GdipDeleteRegion(region); + } + + return METAFILE_PlaybackUpdateClip(real_metafile); + } case EmfPlusRecordTypeSetPageTransform: { EmfPlusSetPageTransform *record = (EmfPlusSetPageTransform*)header; @@ -1257,6 +1320,13 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile, if (!cont) return OutOfMemory; + stat = GdipCloneRegion(metafile->clip, &cont->clip); + if (stat != Ok) + { + heap_free(cont); + return stat; + } + if (recordType == EmfPlusRecordTypeBeginContainerNoParams) stat = GdipBeginContainer2(metafile->playback_graphics, &cont->state); else @@ -1264,6 +1334,7 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile, if (stat != Ok) { + GdipDeleteRegion(cont->clip); heap_free(cont); return stat; } @@ -1310,6 +1381,7 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile, while ((cont2 = LIST_ENTRY(list_head(&real_metafile->containers), container, entry)) != cont) { list_remove(&cont2->entry); + GdipDeleteRegion(cont2->clip); heap_free(cont2); } @@ -1321,8 +1393,10 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile, *real_metafile->world_transform = cont->world_transform; real_metafile->page_unit = cont->page_unit; real_metafile->page_scale = cont->page_scale; + GdipCombineRegionRegion(real_metafile->clip, cont->clip, CombineModeReplace); list_remove(&cont->entry); + GdipDeleteRegion(cont->clip); heap_free(cont); } @@ -1453,6 +1527,9 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics, stat = GdipGetClip(graphics, real_metafile->base_clip); if (stat == Ok) + stat = GdipCreateRegion(&real_metafile->clip); + + if (stat == Ok) stat = GdipCreatePath(FillModeAlternate, &dst_path); if (stat == Ok) @@ -1506,10 +1583,14 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics, GdipDeleteRegion(real_metafile->base_clip); real_metafile->base_clip = NULL; + GdipDeleteRegion(real_metafile->clip); + real_metafile->clip = NULL; + while (list_head(&real_metafile->containers)) { container* cont = LIST_ENTRY(list_head(&real_metafile->containers), container, entry); list_remove(&cont->entry); + GdipDeleteRegion(cont->clip); heap_free(cont); }
1
0
0
0
Bruno Jesus : dinput/tests: Test for DIDOI_ASPECTPOSITION on joystick axes.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 03181015c372588ae7950555207416f584b21283 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=03181015c372588ae79505552…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Tue Aug 16 17:28:38 2016 -0300 dinput/tests: Test for DIDOI_ASPECTPOSITION on joystick axes. Signed-off-by: Bruno Jesus <00cpxxx(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/tests/joystick.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c index 4882744..35ec2d9 100644 --- a/dlls/dinput/tests/joystick.c +++ b/dlls/dinput/tests/joystick.c @@ -142,6 +142,10 @@ static BOOL CALLBACK EnumAxes(const DIDEVICEOBJECTINSTANCEA *pdidoi, void *pCont hr = IDirectInputDevice_SetProperty(info->pJoystick, DIPROP_DEADZONE, &dipdw.diph); ok(hr==DI_OK,"IDirectInputDevice_SetProperty() failed: %08x\n", hr); + /* ensure DIDOI_ASPECTPOSITION is set for axes objects */ + ok(pdidoi->dwFlags & DIDOI_ASPECTPOSITION, "Missing DIDOI_ASPECTPOSITION, flags are 0x%x\n", + pdidoi->dwFlags); + info->axis++; } else if (IsEqualIID(&pdidoi->guidType, &GUID_POV)) info->pov++;
1
0
0
0
Andrew Church : dinput: Report DIDOI_ASPECTPOSITION flag for axes objects.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 5ce8a1a91b5462bc90629385d618ceb6b75cd2c9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5ce8a1a91b5462bc90629385d…
Author: Andrew Church <achurch(a)achurch.org> Date: Tue Aug 16 17:28:34 2016 -0300 dinput: Report DIDOI_ASPECTPOSITION flag for axes objects. Signed-off-by: Bruno Jesus <00cpxxx(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index 9425c0b..1c4b436 100644 --- a/dlls/dinput/joystick.c +++ b/dlls/dinput/joystick.c @@ -495,9 +495,10 @@ HRESULT WINAPI JoystickWGenericImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, res = IDirectInputDevice2WImpl_GetObjectInfo(iface, pdidoi, dwObj, dwHow); if (res != DI_OK) return res; - if (pdidoi->dwType & DIDFT_AXIS) + if (pdidoi->dwType & DIDFT_AXIS) { sprintfW(pdidoi->tszName, axisW, DIDFT_GETINSTANCE(pdidoi->dwType)); - else if (pdidoi->dwType & DIDFT_POV) + pdidoi->dwFlags |= DIDOI_ASPECTPOSITION; + } else if (pdidoi->dwType & DIDFT_POV) sprintfW(pdidoi->tszName, povW, DIDFT_GETINSTANCE(pdidoi->dwType)); else if (pdidoi->dwType & DIDFT_BUTTON) sprintfW(pdidoi->tszName, buttonW, DIDFT_GETINSTANCE(pdidoi->dwType));
1
0
0
0
Nikolay Sivov : user32: Handle invalid dialog handles in IsDialogMessage() .
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 17987c589fc4587b0adfb9de841adf1201efa111 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=17987c589fc4587b0adfb9de8…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Aug 16 10:38:32 2016 +0300 user32: Handle invalid dialog handles in IsDialogMessage(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/dialog.c | 3 +++ dlls/user32/tests/dialog.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index 0663693..8b77ae2 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -1152,6 +1152,9 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg ) { INT dlgCode; + if (!IsWindow( hwndDlg )) + return FALSE; + if (CallMsgFilterW( msg, MSGF_DIALOGBOX )) return TRUE; hwndDlg = WIN_GetFullHandle( hwndDlg ); diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c index a6cd1be..a37c678 100644 --- a/dlls/user32/tests/dialog.c +++ b/dlls/user32/tests/dialog.c @@ -710,8 +710,23 @@ static void test_WM_NEXTDLGCTL(void) DestroyWindow(g_hwndTestDlg); } +static LRESULT CALLBACK hook_proc(INT code, WPARAM wParam, LPARAM lParam) +{ + ok(0, "unexpected hook called, code %d\n", code); + return CallNextHookEx(NULL, code, wParam, lParam); +} + +static BOOL g_MSGF_DIALOGBOX; +static LRESULT CALLBACK hook_proc2(INT code, WPARAM wParam, LPARAM lParam) +{ + ok(code == MSGF_DIALOGBOX, "unexpected hook called, code %d\n", code); + g_MSGF_DIALOGBOX = code == MSGF_DIALOGBOX; + return CallNextHookEx(NULL, code, wParam, lParam); +} + static void test_IsDialogMessage(void) { + HHOOK hook; MSG msg; g_hwndMain = CreateWindowA("IsDialogMessageWindowClass", "IsDialogMessageWindowClass", @@ -723,11 +738,34 @@ static void test_IsDialogMessage(void) assert (g_hwndButton1); assert (g_hwndButtonCancel); + if (0) + { + /* crashes on Windows */ + IsDialogMessageA(NULL, NULL); + IsDialogMessageA(g_hwndMain, NULL); + } + /* The focus should initially be nowhere. The first TAB should take it * to the first button. The second TAB should take it to the Cancel * button. */ + + /* valid window, invalid message window */ + hook = SetWindowsHookExA(WH_MSGFILTER, hook_proc2, NULL, GetCurrentThreadId()); + FormTabMsg (&msg, (HWND)0xbeefbeef); + ok (!IsDialogMessageA(g_hwndMain, &msg), "expected failure\n"); + ok(g_MSGF_DIALOGBOX, "hook wasn't called\n"); + g_MSGF_DIALOGBOX = FALSE; + UnhookWindowsHookEx(hook); + + hook = SetWindowsHookExA(WH_MSGFILTER, hook_proc, NULL, GetCurrentThreadId()); FormTabMsg (&msg, g_hwndMain); + + ok (!IsDialogMessageA(NULL, &msg), "expected failure\n"); + ok (!IsDialogMessageA((HWND)0xbeefbeef, &msg), "expected failure\n"); + + UnhookWindowsHookEx(hook); + ok (IsDialogMessageA(g_hwndMain, &msg), "Did not handle first TAB\n"); ok ((GetFocus() == g_hwndButton1), "Focus did not move to first button\n"); FormTabMsg (&msg, g_hwndButton1); @@ -737,6 +775,18 @@ static void test_IsDialogMessage(void) FormEnterMsg (&msg, g_hwndButtonCancel); ok (IsDialogMessageA(g_hwndMain, &msg), "Did not handle the ENTER\n"); ok (g_terminated, "ENTER did not terminate\n"); + + /* matching but invalid window handles, NULL */ + hook = SetWindowsHookExA(WH_MSGFILTER, hook_proc, NULL, GetCurrentThreadId()); + + FormTabMsg (&msg, NULL); + ok (!IsDialogMessageA(msg.hwnd, &msg), "expected failure\n"); + + /* matching but invalid window handles, not NULL */ + FormTabMsg (&msg, (HWND)0xbeefbeef); + ok (!IsDialogMessageA(msg.hwnd, &msg), "expected failure\n"); + + UnhookWindowsHookEx(hook); }
1
0
0
0
Huw Davies : gdi32: Exponentially grow successive point buffers.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 9fe77b4d7bf326b5eb26b960a3ec68cfb1e479b0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9fe77b4d7bf326b5eb26b960a…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Aug 16 15:09:30 2016 +0100 gdi32: Exponentially grow successive point buffers. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/region.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c index a4cf733..e9bed18 100644 --- a/dlls/gdi32/region.c +++ b/dlls/gdi32/region.c @@ -173,31 +173,28 @@ static inline BOOL is_in_rect( const RECT *rect, int x, int y ) } /* - * number of points to buffer before sending them off - * to scanlines() : Must be an even number - */ -#define NUMPTSTOBUFFER 200 - -/* * used to allocate buffers for points and link * the buffers together */ struct point_block { - POINT pts[NUMPTSTOBUFFER]; - int count; + int count, size; struct point_block *next; + POINT pts[1]; /* Variable sized array - must be last. */ }; static struct point_block *add_point( struct point_block *block, int x, int y ) { - if (block->count == NUMPTSTOBUFFER) + if (block->count == block->size) { - struct point_block *new = HeapAlloc( GetProcessHeap(), 0, sizeof(*new) ); + struct point_block *new; + int size = block->size * 2; + new = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( struct point_block, pts[size] ) ); if (!new) return NULL; block->next = new; new->count = 0; + new->size = size; new->next = NULL; block = new; } @@ -2676,6 +2673,9 @@ static WINEREGION *REGION_PtsToRegion( struct point_block *FirstPtBlock ) return reg; } +/* Number of points in the first point buffer. Must be an even number. */ +#define NUMPTSTOBUFFER 200 + /*********************************************************************** * CreatePolyPolygonRgn (GDI32.@) */ @@ -2692,7 +2692,8 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, EdgeTableEntry *pETEs; /* EdgeTableEntries pool */ ScanLineListBlock SLLBlock; /* header for scanlinelist */ BOOL fixWAET = FALSE; - struct point_block FirstPtBlock, *block; /* PtBlock buffers */ + char first_blk_buf[FIELD_OFFSET( struct point_block, pts[NUMPTSTOBUFFER] )]; + struct point_block *first_block = (struct point_block *)first_blk_buf, *block; struct edge_table_entry *active, *next; INT poly, total; @@ -2721,9 +2722,10 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, REGION_CreateEdgeTable(Count, nbpolygons, Pts, &ET, pETEs, &SLLBlock); list_init( &AET ); pSLL = ET.scanlines.next; - block = &FirstPtBlock; - FirstPtBlock.count = 0; - FirstPtBlock.next = NULL; + block = first_block; + first_block->count = 0; + first_block->size = NUMPTSTOBUFFER; + first_block->next = NULL; if (mode != WINDING) { /* @@ -2802,13 +2804,13 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, } } - if (!(obj = REGION_PtsToRegion( &FirstPtBlock ))) goto done; + if (!(obj = REGION_PtsToRegion( first_block ))) goto done; if (!(hrgn = alloc_gdi_handle( obj, OBJ_REGION, ®ion_funcs ))) free_region( obj ); done: REGION_FreeStorage(SLLBlock.next); - free_point_blocks( FirstPtBlock.next ); + free_point_blocks( first_block->next ); HeapFree( GetProcessHeap(), 0, pETEs ); return hrgn; }
1
0
0
0
Alistair Leslie-Hughes : d3dx11: Add D3DX11CreateTextureFromMemory stub.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 77568fd0326941a6cd212e7ac29a8f900c3521fa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=77568fd0326941a6cd212e7ac…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Aug 16 05:47:15 2016 +0000 d3dx11: Add D3DX11CreateTextureFromMemory stub. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx11_42/d3dx11_42.spec | 2 +- dlls/d3dx11_43/async.c | 10 ++++++++++ dlls/d3dx11_43/d3dx11_43.spec | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index cb02a95..45e8482 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -22,7 +22,7 @@ @ stub D3DX11CreateShaderResourceViewFromResourceW @ stub D3DX11CreateTextureFromFileA @ stub D3DX11CreateTextureFromFileW -@ stub D3DX11CreateTextureFromMemory +@ stdcall D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) @ stub D3DX11CreateTextureFromResourceA @ stub D3DX11CreateTextureFromResourceW @ stub D3DX11CreateThreadPump diff --git a/dlls/d3dx11_43/async.c b/dlls/d3dx11_43/async.c index b33c235..6eb2a10 100644 --- a/dlls/d3dx11_43/async.c +++ b/dlls/d3dx11_43/async.c @@ -65,3 +65,13 @@ HRESULT WINAPI D3DX11CompileFromFileW(const WCHAR *filename, const D3D10_SHADER_ return E_NOTIMPL; } + +HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *data, + SIZE_T data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, + ID3D11Resource **texture, HRESULT *hresult) +{ + FIXME("device %p, data %p, data_size %lu, load_info %p, pump %p, texture %p, hresult %p stub.\n", + device, data, data_size, load_info, pump, texture, hresult); + + return E_NOTIMPL; +} diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index 69c12fb..7c3a598 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -22,7 +22,7 @@ @ stub D3DX11CreateShaderResourceViewFromResourceW @ stub D3DX11CreateTextureFromFileA @ stub D3DX11CreateTextureFromFileW -@ stub D3DX11CreateTextureFromMemory +@ stdcall D3DX11CreateTextureFromMemory(ptr ptr long ptr ptr ptr ptr) @ stub D3DX11CreateTextureFromResourceA @ stub D3DX11CreateTextureFromResourceW @ stub D3DX11CreateThreadPump
1
0
0
0
Józef Kucia : d3d11: Remove redundant 'break' statement.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 51afeca5aa2f9bc0b78d7cc69799587ca6a1d678 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=51afeca5aa2f9bc0b78d7cc69…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Aug 15 16:00:23 2016 +0200 d3d11: Remove redundant 'break' statement. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/shader.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c index dab2b9b..1da1293 100644 --- a/dlls/d3d11/shader.c +++ b/dlls/d3d11/shader.c @@ -108,7 +108,6 @@ static HRESULT shdr_handler(const char *data, DWORD data_size, DWORD tag, void * else { TRACE("Skipping feature level 9 shader code on feature level %#x.\n", ctx->feature_level); - break; } break;
1
0
0
0
Józef Kucia : dxgi/tests: Check fullscreen state in test_create_swapchain().
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 20b39d41e124231f8ab97baf2848b8b1fc4448ae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=20b39d41e124231f8ab97baf2…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Aug 15 16:00:22 2016 +0200 dxgi/tests: Check fullscreen state in test_create_swapchain(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dxgi/tests/device.c | 300 ++++++++++++++++++++++++----------------------- 1 file changed, 155 insertions(+), 145 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=20b39d41e124231f8ab97…
1
0
0
0
Józef Kucia : dxgi: Properly switch to fullscreen mode when creating fullscreen swapchains.
by Alexandre Julliard
17 Aug '16
17 Aug '16
Module: wine Branch: master Commit: 0d92a9a7a429f5727c997d814155acdd8f4095fe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0d92a9a7a429f5727c997d814…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Aug 15 16:00:21 2016 +0200 dxgi: Properly switch to fullscreen mode when creating fullscreen swapchains. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dxgi/swapchain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index 172b0f4..0057aa2 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -485,6 +485,8 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device wined3d_mutex_lock(); wined3d_private_store_init(&swapchain->private_store); + swapchain->fullscreen = !desc->windowed; + desc->windowed = TRUE; if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, swapchain, &dxgi_swapchain_wined3d_parent_ops, &swapchain->wined3d_swapchain))) { @@ -492,10 +494,10 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device goto cleanup; } - swapchain->fullscreen = !desc->windowed; swapchain->target = NULL; if (swapchain->fullscreen) { + desc->windowed = FALSE; if (FAILED(hr = wined3d_swapchain_set_fullscreen(swapchain->wined3d_swapchain, desc, NULL))) {
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
78
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Results per page:
10
25
50
100
200