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
May 2012
----- 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
737 discussions
Start a n
N
ew thread
Alexandre Julliard : wined3d: CreateDIBSection doesn' t need a DC for the DIB_RGB_COLORS case.
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: c054d7bc6f0e63a71b8d7b46aeed1f9d5c875315 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c054d7bc6f0e63a71b8d7b46a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 2 12:02:33 2012 +0200 wined3d: CreateDIBSection doesn't need a DC for the DIB_RGB_COLORS case. --- dlls/wined3d/surface.c | 14 +------------- 1 files changed, 1 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index a80cab2..148c014 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -377,8 +377,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) BITMAPINFO *b_info; int extraline = 0; DWORD *masks; - UINT usage; - HDC dc; TRACE("surface %p.\n", surface); @@ -441,7 +439,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) switch (surface->resource.format->id) { case WINED3DFMT_B8G8R8_UNORM: - usage = DIB_RGB_COLORS; b_info->bmiHeader.biCompression = BI_RGB; break; @@ -457,7 +454,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) case WINED3DFMT_B10G10R10A2_UNORM: case WINED3DFMT_B5G6R5_UNORM: case WINED3DFMT_R16G16B16A16_UNORM: - usage = 0; b_info->bmiHeader.biCompression = BI_BITFIELDS; masks[0] = format->red_mask; masks[1] = format->green_mask; @@ -467,21 +463,13 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) default: /* Don't know palette */ b_info->bmiHeader.biCompression = BI_RGB; - usage = 0; break; } - if (!(dc = GetDC(0))) - { - HeapFree(GetProcessHeap(), 0, b_info); - return HRESULT_FROM_WIN32(GetLastError()); - } - TRACE("Creating a DIB section with size %dx%dx%d, size=%d.\n", b_info->bmiHeader.biWidth, b_info->bmiHeader.biHeight, b_info->bmiHeader.biBitCount, b_info->bmiHeader.biSizeImage); - surface->dib.DIBsection = CreateDIBSection(dc, b_info, usage, &surface->dib.bitmap_data, 0, 0); - ReleaseDC(0, dc); + surface->dib.DIBsection = CreateDIBSection(0, b_info, DIB_RGB_COLORS, &surface->dib.bitmap_data, 0, 0); if (!surface->dib.DIBsection) {
1
0
0
0
Alexandre Julliard : gphoto2.ds: CreateDIBSection doesn' t need a DC for the DIB_RGB_COLORS case.
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: a0a95eb0cac36fb3963efe6795c3fc17d2681547 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a0a95eb0cac36fb3963efe679…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 2 12:02:28 2012 +0200 gphoto2.ds: CreateDIBSection doesn't need a DC for the DIB_RGB_COLORS case. --- dlls/gphoto2.ds/ds_image.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dlls/gphoto2.ds/ds_image.c b/dlls/gphoto2.ds/ds_image.c index c870ec4..632ff66 100644 --- a/dlls/gphoto2.ds/ds_image.c +++ b/dlls/gphoto2.ds/ds_image.c @@ -383,7 +383,6 @@ TW_UINT16 GPHOTO2_ImageNativeXferGet (pTW_IDENTITY pOrigin, BITMAPINFO bmpInfo; LPBYTE bits; JSAMPROW samprow, oldsamprow; - HDC dc; FIXME("DG_IMAGE/DAT_IMAGENATIVEXFER/MSG_GET: implemented, but expect program crash due to DIB.\n"); @@ -425,8 +424,7 @@ TW_UINT16 GPHOTO2_ImageNativeXferGet (pTW_IDENTITY pOrigin, bmpInfo.bmiHeader.biYPelsPerMeter = 0; bmpInfo.bmiHeader.biClrUsed = 0; bmpInfo.bmiHeader.biClrImportant = 0; - hDIB = CreateDIBSection ((dc = GetDC(activeDS.hwndOwner)), &bmpInfo, - DIB_RGB_COLORS, (LPVOID)&bits, 0, 0); + hDIB = CreateDIBSection (0, &bmpInfo, DIB_RGB_COLORS, (LPVOID)&bits, 0, 0); if (!hDIB) { FIXME("Failed creating DIB.\n"); gp_file_unref (activeDS.file); @@ -454,7 +452,6 @@ TW_UINT16 GPHOTO2_ImageNativeXferGet (pTW_IDENTITY pOrigin, HeapFree (GetProcessHeap(), 0, samprow); gp_file_unref (activeDS.file); activeDS.file = NULL; - ReleaseDC (activeDS.hwndOwner, dc); *pHandle = (UINT_PTR)hDIB; activeDS.twCC = TWCC_SUCCESS; activeDS.currentState = 7; @@ -568,7 +565,6 @@ _get_gphoto2_file_as_DIB( struct jpeg_source_mgr xjsm; struct jpeg_decompress_struct jd; struct jpeg_error_mgr jerr; - HDC dc; BITMAPINFO bmpInfo; LPBYTE bits; JSAMPROW samprow, oldsamprow; @@ -636,7 +632,7 @@ _get_gphoto2_file_as_DIB( bmpInfo.bmiHeader.biYPelsPerMeter = 0; bmpInfo.bmiHeader.biClrUsed = 0; bmpInfo.bmiHeader.biClrImportant = 0; - *hDIB = CreateDIBSection ((dc = GetDC(hwnd)), &bmpInfo, DIB_RGB_COLORS, (LPVOID)&bits, 0, 0); + *hDIB = CreateDIBSection(0, &bmpInfo, DIB_RGB_COLORS, (LPVOID)&bits, 0, 0); if (!*hDIB) { FIXME("Failed creating DIB.\n"); gp_file_unref (file); @@ -659,7 +655,6 @@ _get_gphoto2_file_as_DIB( bits = (LPBYTE)(((UINT_PTR)bits + 3) & ~3); samprow = oldsamprow; } - if (hwnd) ReleaseDC (hwnd, dc); HeapFree (GetProcessHeap(), 0, samprow); gp_file_unref (file); return TWRC_SUCCESS;
1
0
0
0
Alexandre Julliard : gdiplus: CreateDIBSection doesn' t need a DC for the DIB_RGB_COLORS case.
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: 039c85346c323e1145b5a5f2e5334328ac37baa9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=039c85346c323e1145b5a5f2e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 2 12:02:17 2012 +0200 gdiplus: CreateDIBSection doesn't need a DC for the DIB_RGB_COLORS case. --- dlls/gdiplus/gdiplus.c | 7 +------ dlls/gdiplus/graphics.c | 8 +------- dlls/gdiplus/image.c | 19 ++----------------- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 9c3478b..56d8330 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -265,7 +265,6 @@ COLORREF ARGB2COLORREF(ARGB color) HBITMAP ARGB2BMP(ARGB color) { - HDC hdc; BITMAPINFO bi; HBITMAP result; RGBQUAD *bits; @@ -273,8 +272,6 @@ HBITMAP ARGB2BMP(ARGB color) if ((color & 0xff000000) == 0xff000000) return 0; - hdc = CreateCompatibleDC(NULL); - bi.bmiHeader.biSize = sizeof(bi.bmiHeader); bi.bmiHeader.biWidth = 1; bi.bmiHeader.biHeight = 1; @@ -287,15 +284,13 @@ HBITMAP ARGB2BMP(ARGB color) bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; - result = CreateDIBSection(hdc, &bi, DIB_RGB_COLORS, (void*)&bits, NULL, 0); + result = CreateDIBSection(0, &bi, DIB_RGB_COLORS, (void*)&bits, NULL, 0); bits[0].rgbReserved = alpha = (color>>24)&0xff; bits[0].rgbRed = ((color>>16)&0xff)*alpha/255; bits[0].rgbGreen = ((color>>8)&0xff)*alpha/255; bits[0].rgbBlue = (color&0xff)*alpha/255; - DeleteDC(hdc); - return result; } diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 92bc27e..a5e3eb2 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -131,15 +131,10 @@ static COLORREF get_gdi_brush_color(const GpBrush *brush) static HBITMAP create_hatch_bitmap(const GpHatch *hatch) { HBITMAP hbmp; - HDC hdc; BITMAPINFOHEADER bmih; DWORD *bits; int x, y; - hdc = CreateCompatibleDC(0); - - if (!hdc) return 0; - bmih.biSize = sizeof(bmih); bmih.biWidth = 8; bmih.biHeight = 8; @@ -148,7 +143,7 @@ static HBITMAP create_hatch_bitmap(const GpHatch *hatch) bmih.biCompression = BI_RGB; bmih.biSizeImage = 0; - hbmp = CreateDIBSection(hdc, (BITMAPINFO *)&bmih, DIB_RGB_COLORS, (void **)&bits, NULL, 0); + hbmp = CreateDIBSection(0, (BITMAPINFO *)&bmih, DIB_RGB_COLORS, (void **)&bits, NULL, 0); if (hbmp) { const char *hatch_data; @@ -175,7 +170,6 @@ static HBITMAP create_hatch_bitmap(const GpHatch *hatch) } } - DeleteDC(hdc); return hbmp; } diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 825ca02..ba8b979 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1372,7 +1372,6 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap, GpStatus stat; HBITMAP result; UINT width, height; - HDC hdc; BITMAPINFOHEADER bih; LPBYTE bits; BitmapData lockeddata; @@ -1395,11 +1394,7 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap, bih.biClrUsed = 0; bih.biClrImportant = 0; - hdc = CreateCompatibleDC(NULL); - if (!hdc) return GenericError; - - result = CreateDIBSection(hdc, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void**)&bits, - NULL, 0); + result = CreateDIBSection(0, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void**)&bits, NULL, 0); if (result) { @@ -1415,8 +1410,6 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap, else stat = GenericError; - DeleteDC(hdc); - if (stat != Ok && result) { DeleteObject(result); @@ -1694,7 +1687,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, BITMAPINFO* pbmi; HBITMAP hbitmap=NULL; INT row_size, dib_stride; - HDC hdc; BYTE *bits=NULL, *own_bits=NULL; REAL xres, yres; GpStatus stat; @@ -1739,15 +1731,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, pbmi->bmiHeader.biClrUsed = 0; pbmi->bmiHeader.biClrImportant = 0; - hdc = CreateCompatibleDC(NULL); - if (!hdc) { - GdipFree(pbmi); - return GenericError; - } - - hbitmap = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); + hbitmap = CreateDIBSection(0, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); - DeleteDC(hdc); GdipFree(pbmi); if (!hbitmap) return GenericError;
1
0
0
0
Jacek Caban : mshtml: Added IHTMLWindow2::get_history implementation.
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: d2e8d448113720a2f1f851f5fab3d0729a83c4f9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d2e8d448113720a2f1f851f5f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 2 10:28:09 2012 +0200 mshtml: Added IHTMLWindow2::get_history implementation. --- dlls/mshtml/htmlwindow.c | 16 ++++- dlls/mshtml/mshtml_private.h | 4 + dlls/mshtml/omnavigator.c | 169 +++++++++++++++++++++++++++++++++++++++++- dlls/mshtml/tests/dom.c | 23 ++++++ 4 files changed, 208 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index a0cf108..2f792f9 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -690,8 +690,20 @@ static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocatio static HRESULT WINAPI HTMLWindow2_get_history(IHTMLWindow2 *iface, IOmHistory **p) { HTMLWindow *This = impl_from_IHTMLWindow2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + if(!This->history) { + HRESULT hres; + + hres = create_history(&This->history); + if(FAILED(hres)) + return hres; + } + + IOmHistory_AddRef(This->history); + *p = This->history; + return S_OK; } static HRESULT WINAPI HTMLWindow2_close(IHTMLWindow2 *iface) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 3376084..cdf34cd 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -88,6 +88,7 @@ typedef struct event_target_t event_target_t; XDIID(DispHTMLGenericElement) \ XDIID(DispHTMLFrameElement) \ XDIID(DispHTMLHeadElement) \ + XDIID(DispHTMLHistory) \ XDIID(DispHTMLIFrame) \ XDIID(DispHTMLImg) \ XDIID(DispHTMLInputElement) \ @@ -180,6 +181,7 @@ typedef struct event_target_t event_target_t; XIID(IHTMLWindow3) \ XIID(IHTMLWindow4) \ XIID(IHTMLWindow6) \ + XIID(IOmHistory) \ XIID(IOmNavigator) typedef enum { @@ -333,6 +335,7 @@ struct HTMLWindow { HTMLImageElementFactory *image_factory; HTMLLocation *location; IHTMLScreen *screen; + IOmHistory *history; global_prop_t *global_props; DWORD global_prop_cnt; @@ -641,6 +644,7 @@ HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow*) DECLSPEC_HI HRESULT HTMLLocation_Create(HTMLWindow*,HTMLLocation**) DECLSPEC_HIDDEN; IOmNavigator *OmNavigator_Create(void) DECLSPEC_HIDDEN; HRESULT HTMLScreen_Create(IHTMLScreen**) DECLSPEC_HIDDEN; +HRESULT create_history(IOmHistory**) DECLSPEC_HIDDEN; void HTMLDocument_HTMLDocument3_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_HTMLDocument5_Init(HTMLDocument*) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 2ae9811..ff64a63 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -44,9 +44,169 @@ typedef struct { HTMLMimeTypesCollection *mime_types; } OmNavigator; -static inline OmNavigator *impl_from_IOmNavigator(IOmNavigator *iface) +typedef struct { + DispatchEx dispex; + IOmHistory IOmHistory_iface; + + LONG ref; +} OmHistory; + +static inline OmHistory *impl_from_IOmHistory(IOmHistory *iface) { - return CONTAINING_RECORD(iface, OmNavigator, IOmNavigator_iface); + return CONTAINING_RECORD(iface, OmHistory, IOmHistory_iface); +} + +static HRESULT WINAPI OmHistory_QueryInterface(IOmHistory *iface, REFIID riid, void **ppv) +{ + OmHistory *This = impl_from_IOmHistory(iface); + + *ppv = NULL; + + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = &This->IOmHistory_iface; + }else if(IsEqualGUID(&IID_IOmHistory, riid)) { + TRACE("(%p)->(IID_IOmHistory %p)\n", This, ppv); + *ppv = &This->IOmHistory_iface; + }else if(dispex_query_interface(&This->dispex, riid, ppv)) { + return *ppv ? S_OK : E_NOINTERFACE; + } + + if(*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + return E_NOINTERFACE; +} + +static ULONG WINAPI OmHistory_AddRef(IOmHistory *iface) +{ + OmHistory *This = impl_from_IOmHistory(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI OmHistory_Release(IOmHistory *iface) +{ + OmHistory *This = impl_from_IOmHistory(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + release_dispex(&This->dispex); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI OmHistory_GetTypeInfoCount(IOmHistory *iface, UINT *pctinfo) +{ + OmHistory *This = impl_from_IOmHistory(iface); + FIXME("(%p)->(%p)\n", This, pctinfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI OmHistory_GetTypeInfo(IOmHistory *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + OmHistory *This = impl_from_IOmHistory(iface); + + return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI OmHistory_GetIDsOfNames(IOmHistory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + OmHistory *This = impl_from_IOmHistory(iface); + + return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames, + lcid, rgDispId); +} + +static HRESULT WINAPI OmHistory_Invoke(IOmHistory *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + OmHistory *This = impl_from_IOmHistory(iface); + + return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI OmHistory_get_length(IOmHistory *iface, short *p) +{ + OmHistory *This = impl_from_IOmHistory(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI OmHistory_back(IOmHistory *iface, VARIANT *pvargdistance) +{ + OmHistory *This = impl_from_IOmHistory(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance)); + return E_NOTIMPL; +} + +static HRESULT WINAPI OmHistory_forward(IOmHistory *iface, VARIANT *pvargdistance) +{ + OmHistory *This = impl_from_IOmHistory(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance)); + return E_NOTIMPL; +} + +static HRESULT WINAPI OmHistory_go(IOmHistory *iface, VARIANT *pvargdistance) +{ + OmHistory *This = impl_from_IOmHistory(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(pvargdistance)); + return E_NOTIMPL; +} + +static const IOmHistoryVtbl OmHistoryVtbl = { + OmHistory_QueryInterface, + OmHistory_AddRef, + OmHistory_Release, + OmHistory_GetTypeInfoCount, + OmHistory_GetTypeInfo, + OmHistory_GetIDsOfNames, + OmHistory_Invoke, + OmHistory_get_length, + OmHistory_back, + OmHistory_forward, + OmHistory_go +}; + +static const tid_t OmHistory_iface_tids[] = { + IOmHistory_tid, + 0 +}; +static dispex_static_data_t OmHistory_dispex = { + NULL, + DispHTMLHistory_tid, + NULL, + OmHistory_iface_tids +}; + + +HRESULT create_history(IOmHistory **ret) +{ + OmHistory *history; + + history = heap_alloc_zero(sizeof(*history)); + if(!history) + return E_OUTOFMEMORY; + + init_dispex(&history->dispex, (IUnknown*)&history->IOmHistory_iface, &OmHistory_dispex); + history->IOmHistory_iface.lpVtbl = &OmHistoryVtbl; + history->ref = 1; + + *ret = &history->IOmHistory_iface; + return S_OK; } struct HTMLPluginsCollection { @@ -347,6 +507,11 @@ static HRESULT create_mime_types_collection(OmNavigator *navigator, HTMLMimeType return S_OK; } +static inline OmNavigator *impl_from_IOmNavigator(IOmNavigator *iface) +{ + return CONTAINING_RECORD(iface, OmNavigator, IOmNavigator_iface); +} + static HRESULT WINAPI OmNavigator_QueryInterface(IOmNavigator *iface, REFIID riid, void **ppv) { OmNavigator *This = impl_from_IOmNavigator(iface); diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index fcc2654..f095cc2 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -4477,6 +4477,28 @@ static void test_body_funs(IHTMLBodyElement *body) VariantClear(&vDefaultbg); } +static void test_history(IHTMLWindow2 *window) +{ + IOmHistory *history, *history2; + HRESULT hres; + + history = NULL; + hres = IHTMLWindow2_get_history(window, &history); + ok(hres == S_OK, "get_history failed: %08x\n", hres); + ok(history != NULL, "history = NULL\n"); + + test_disp((IUnknown*)history, &DIID_DispHTMLHistory, "[object]"); + + history2 = NULL; + hres = IHTMLWindow2_get_history(window, &history2); + ok(hres == S_OK, "get_history failed: %08x\n", hres); + ok(history2 != NULL, "history2 = NULL\n"); + ok(iface_cmp((IUnknown*)history, (IUnknown*)history2), "history != history2\n"); + + IOmHistory_Release(history2); + IOmHistory_Release(history); +} + static void test_window(IHTMLDocument2 *doc) { IHTMLWindow2 *window, *window2, *self, *parent; @@ -4564,6 +4586,7 @@ static void test_window(IHTMLDocument2 *doc) test_screen(window); test_window_status(window); set_window_status(window, "Test!"); + test_history(window); IHTMLWindow2_Release(window); }
1
0
0
0
Jacek Caban : mshtml.idl: Added DispHTMLHistory declaration.
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: fdeb816fc9047355c56f2b876bf219176c398380 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fdeb816fc9047355c56f2b876…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 2 10:27:56 2012 +0200 mshtml.idl: Added DispHTMLHistory declaration. --- include/mshtml.idl | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/include/mshtml.idl b/include/mshtml.idl index a6a9954..d599eba 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -10209,6 +10209,33 @@ interface IHTMLLocation : IDispatch } /***************************************************************************** + * DispHTMLHistory dispinterface + */ +[ + hidden, + uuid(3050f549-98b5-11cf-bb82-00aa00bdce0b) +] +dispinterface DispHTMLHistory +{ +properties: +methods: + [propget, id(DISPID_IOMHISTORY_LENGTH)] + short length(); + + [id(DISPID_IOMHISTORY_BACK)] + void back([optional, in] VARIANT *pvargdistance); + + [id(DISPID_IOMHISTORY_FORWARD)] + void forward([optional, in] VARIANT *pvargdistance); + + [id(DISPID_IOMHISTORY_GO)] + void go([optional, in] VARIANT *pvargdistance); + + [propget, id(DISPID_IHTMLDOMCONSTRUCTOR_CONSTRUCTOR), hidden] + IDispatch *constructor(); +} + +/***************************************************************************** * DispHTMLLocation dispinterface */ [
1
0
0
0
Andrew Eikum : dsound: Don' t derive the secondary position from the primary position.
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: 4354be123cae5637b3a465d2a45e99d81a1a48ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4354be123cae5637b3a465d2a…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Tue May 1 15:01:32 2012 -0500 dsound: Don't derive the secondary position from the primary position. --- dlls/dsound/buffer.c | 11 +--- dlls/dsound/dsound_private.h | 7 +- dlls/dsound/mixer.c | 160 ++++++++--------------------------------- 3 files changed, 38 insertions(+), 140 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4354be123cae5637b3a46…
1
0
0
0
Andrew Eikum : dsound: Convert from fixed to floating point.
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: f393a98a8a6cbb585101ac0338723151a6e135c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f393a98a8a6cbb585101ac033…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Tue May 1 15:01:06 2012 -0500 dsound: Convert from fixed to floating point. --- dlls/dsound/buffer.c | 4 +- dlls/dsound/dsound_private.h | 7 ++--- dlls/dsound/mixer.c | 47 ++++++++++++++++++++++------------------- dlls/dsound/primary.c | 2 +- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index 630d60e..376fff3 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -252,7 +252,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency(IDirectSoundBuffer8 *i oldFreq = This->freq; This->freq = freq; if (freq != oldFreq) { - This->freqAdjust = ((DWORD64)This->freq << DSOUND_FREQSHIFT) / This->device->pwfx->nSamplesPerSec; + This->freqAdjust = This->freq / (float)This->device->pwfx->nSamplesPerSec; This->nAvgBytesPerSec = freq * This->pwfx->nBlockAlign; DSOUND_RecalcFormat(This); } @@ -912,7 +912,7 @@ HRESULT IDirectSoundBufferImpl_Create( dsb->buf_mixpos = dsb->sec_mixpos = 0; dsb->state = STATE_STOPPED; - dsb->freqAdjust = ((DWORD64)dsb->freq << DSOUND_FREQSHIFT) / device->pwfx->nSamplesPerSec; + dsb->freqAdjust = dsb->freq / (float)device->pwfx->nSamplesPerSec; dsb->nAvgBytesPerSec = dsb->freq * dsbd->lpwfxFormat->nBlockAlign; diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 5d1d62a..7577610 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -182,7 +182,8 @@ struct IDirectSoundBufferImpl DSVOLUMEPAN volpan; DSBUFFERDESC dsbd; /* used for frequency conversion (PerfectPitch) */ - ULONG freqneeded, freqAdjust, freqAcc, freqAccNext; + ULONG freqneeded; + float freqAcc, freqAccNext, freqAdjust; /* used for mixing */ DWORD primary_mixpos, buf_mixpos, sec_mixpos; /* IDirectSoundNotify fields */ @@ -296,7 +297,7 @@ void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len void DSOUND_RecalcVolPan(PDSVOLUMEPAN volpan) DECLSPEC_HIDDEN; void DSOUND_AmpFactorToVolPan(PDSVOLUMEPAN volpan) DECLSPEC_HIDDEN; void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) DECLSPEC_HIDDEN; -DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD secpos, DWORD secmixpos, DWORD* overshot) DECLSPEC_HIDDEN; +DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD secpos, DWORD secmixpos, float *overshot) DECLSPEC_HIDDEN; void CALLBACK DSOUND_timer(UINT timerID, UINT msg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) DECLSPEC_HIDDEN; @@ -315,8 +316,6 @@ HRESULT DSOUND_CaptureCreate8(REFIID riid, LPDIRECTSOUNDCAPTURE8 *ppDSC8) DECLSP #define STATE_CAPTURING 2 #define STATE_STOPPING 3 -#define DSOUND_FREQSHIFT (20) - extern CRITICAL_SECTION DSOUND_renderers_lock DECLSPEC_HIDDEN; extern CRITICAL_SECTION DSOUND_capturers_lock DECLSPEC_HIDDEN; extern struct list DSOUND_capturers DECLSPEC_HIDDEN; diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 5fa15b2..dddd1e3 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -115,23 +115,21 @@ DWORD DSOUND_bufpos_to_mixpos(const DirectSoundDevice* device, DWORD pos) * secmixpos is used to decide which freqAcc is needed * overshot tells what the 'actual' secpos is now (optional) */ -DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD secpos, DWORD secmixpos, DWORD* overshot) +DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD secpos, DWORD secmixpos, float* overshot) { DWORD64 framelen = secpos / dsb->pwfx->nBlockAlign; - DWORD64 freqAdjust = dsb->freqAdjust; - DWORD64 acc, freqAcc; + float acc, freqAcc; if (secpos < secmixpos) freqAcc = dsb->freqAccNext; - else freqAcc = dsb->freqAcc; - acc = (framelen << DSOUND_FREQSHIFT) + (freqAdjust - 1 - freqAcc); - acc /= freqAdjust; + else + freqAcc = dsb->freqAcc; + acc = ceil((framelen - freqAcc) / dsb->freqAdjust); if (overshot) { - DWORD64 oshot = acc * freqAdjust + freqAcc; - assert(oshot >= framelen << DSOUND_FREQSHIFT); - oshot -= framelen << DSOUND_FREQSHIFT; - *overshot = (DWORD)oshot; + *overshot = acc * dsb->freqAdjust + freqAcc; + assert(*overshot >= framelen); + *overshot -= framelen; assert(*overshot < dsb->freqAdjust); } return (DWORD)acc * dsb->device->pwfx->nBlockAlign; @@ -146,8 +144,7 @@ static DWORD DSOUND_bufpos_to_secpos(const IDirectSoundBufferImpl *dsb, DWORD bu DWORD64 acc; framelen = bufpos/oAdv; - acc = framelen * (DWORD64)dsb->freqAdjust + (DWORD64)dsb->freqAcc; - acc = acc >> DSOUND_FREQSHIFT; + acc = ((DWORD64)framelen) * dsb->freqAdjust + dsb->freqAcc; pos = (DWORD)acc * iAdv; if (pos >= dsb->buflen) { /* FIXME: can this happen at all? */ @@ -167,7 +164,7 @@ static void DSOUND_RecalcFreqAcc(IDirectSoundBufferImpl *dsb) if (!dsb->freqneeded) return; dsb->freqAcc = dsb->freqAccNext; dsb->tmp_buffer_len = DSOUND_secpos_to_bufpos(dsb, dsb->buflen, 0, &dsb->freqAccNext); - TRACE("New freqadjust: %04x, new buflen: %d\n", dsb->freqAccNext, dsb->tmp_buffer_len); + TRACE("New freqadjust: %f, new buflen: %d\n", dsb->freqAccNext, dsb->tmp_buffer_len); } /** @@ -298,27 +295,33 @@ void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len } } +static inline float get_current_sample(const IDirectSoundBufferImpl *dsb, + DWORD mixpos, DWORD channel) +{ + if (mixpos >= dsb->buflen && !(dsb->playflags & DSBPLAY_LOOPING)) + return 0.0f; + return dsb->get(dsb, mixpos % dsb->buflen, channel); +} + /** * Copy frames from the given input buffer to the given output buffer. * Translate 8 <-> 16 bits and mono <-> stereo */ static inline void cp_fields(const IDirectSoundBufferImpl *dsb, - UINT ostride, UINT count, UINT freqAcc) + UINT ostride, UINT count, float freqAcc) { DWORD ipos = dsb->sec_mixpos; UINT istride = dsb->pwfx->nBlockAlign; - UINT adj = dsb->freqAdjust; - ULONG adv; DWORD opos = 0; while (count-- > 0) { DWORD channel; for (channel = 0; channel < dsb->mix_channels; channel++) - dsb->put(dsb, opos, channel, dsb->get(dsb, ipos, channel)); - freqAcc += adj; - adv = (freqAcc >> DSOUND_FREQSHIFT); - freqAcc &= (1 << DSOUND_FREQSHIFT) - 1; - ipos += adv * istride; + dsb->put(dsb, opos, channel, + get_current_sample(dsb, ipos, channel)); + freqAcc += dsb->freqAdjust; + ipos += ((DWORD)freqAcc) * istride; + freqAcc -= truncf(freqAcc); opos += ostride; } } @@ -355,7 +358,7 @@ static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD tmp_l { INT oAdvance = dsb->device->pwfx->nBlockAlign; INT size = tmp_len / oAdvance; - DWORD freqAcc; + float freqAcc; if (dsb->device->tmp_buffer_len < tmp_len || !dsb->device->tmp_buffer) { diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 4851ac2..c39da8a 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -535,7 +535,7 @@ opened: /* **** */ RtlAcquireResourceExclusive(&(*dsb)->lock, TRUE); - (*dsb)->freqAdjust = ((DWORD64)(*dsb)->freq << DSOUND_FREQSHIFT) / device->pwfx->nSamplesPerSec; + (*dsb)->freqAdjust = (*dsb)->freq / (float)device->pwfx->nSamplesPerSec; DSOUND_RecalcFormat((*dsb)); (*dsb)->primary_mixpos = 0;
1
0
0
0
Henri Verbeet : wined3d: Figure out the index data pointer inside drawPrimitive().
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: a8a201cf61b39f79be980c4f193905bf8c0276c4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8a201cf61b39f79be980c4f1…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue May 1 20:25:28 2012 +0200 wined3d: Figure out the index data pointer inside drawPrimitive(). We want to do this after context_apply_draw_state(), when resource locations are all setup. --- dlls/wined3d/device.c | 9 ++------- dlls/wined3d/drawprim.c | 24 +++++++++++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 030add2..0b0b600 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4008,14 +4008,11 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { - struct wined3d_buffer *index_buffer; - GLuint vbo; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); - index_buffer = device->stateBlock->state.index_buffer; - if (!index_buffer) + if (!device->stateBlock->state.index_buffer) { /* D3D9 returns D3DERR_INVALIDCALL when DrawIndexedPrimitive is called * without an index buffer set. (The first time at least...) @@ -4036,7 +4033,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic device_invalidate_state(device, STATE_INDEXBUFFER); device->stateBlock->state.user_stream = FALSE; } - vbo = index_buffer->buffer_object; if (!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] && device->stateBlock->state.load_base_vertex_index != device->stateBlock->state.base_vertex_index) @@ -4045,8 +4041,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic device_invalidate_state(device, STATE_BASEVERTEXINDEX); } - drawPrimitive(device, index_count, start_idx, TRUE, - vbo ? NULL : index_buffer->resource.allocatedMemory); + drawPrimitive(device, index_count, start_idx, TRUE, NULL); return WINED3D_OK; } diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 136c8f5..18b8f3f 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -669,14 +669,24 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId BOOL emulation = FALSE; const struct wined3d_stream_info *stream_info = &device->strided_streams; struct wined3d_stream_info stridedlcl; - UINT idx_size; + UINT idx_size = 0; - if (!indexed) - idx_size = 0; - else if (state->index_format == WINED3DFMT_R16_UINT) - idx_size = 2; - else - idx_size = 4; + if (indexed) + { + if (!state->user_stream) + { + struct wined3d_buffer *index_buffer = state->index_buffer; + if (!index_buffer->buffer_object) + idxData = index_buffer->resource.allocatedMemory; + else + idxData = NULL; + } + + if (state->index_format == WINED3DFMT_R16_UINT) + idx_size = 2; + else + idx_size = 4; + } if (!use_vs(state)) {
1
0
0
0
Henri Verbeet : wined3d: Figure out the index size inside drawPrimitive().
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: 64e41dae8ad9bc6a8d9432d235e8ed8137ed2464 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=64e41dae8ad9bc6a8d9432d23…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue May 1 20:25:27 2012 +0200 wined3d: Figure out the index size inside drawPrimitive(). --- dlls/wined3d/device.c | 30 +++++++++++------------------- dlls/wined3d/drawprim.c | 18 +++++++++++++----- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 2f48027..030add2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4002,14 +4002,13 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT /* Account for the loading offset due to index buffers. Instead of * reloading all sources correct it with the startvertex parameter. */ - drawPrimitive(device, vertex_count, start_vertex, 0, NULL); + drawPrimitive(device, vertex_count, start_vertex, FALSE, NULL); return WINED3D_OK; } HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { struct wined3d_buffer *index_buffer; - UINT index_size = 2; GLuint vbo; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; @@ -4039,11 +4038,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic } vbo = index_buffer->buffer_object; - if (device->stateBlock->state.index_format == WINED3DFMT_R16_UINT) - index_size = 2; - else - index_size = 4; - if (!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] && device->stateBlock->state.load_base_vertex_index != device->stateBlock->state.base_vertex_index) { @@ -4051,7 +4045,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic device_invalidate_state(device, STATE_BASEVERTEXINDEX); } - drawPrimitive(device, index_count, start_idx, index_size, + drawPrimitive(device, index_count, start_idx, TRUE, vbo ? NULL : index_buffer->resource.allocatedMemory); return WINED3D_OK; @@ -4090,7 +4084,7 @@ HRESULT CDECL wined3d_device_draw_primitive_up(struct wined3d_device *device, UI /* TODO: Only mark dirty if drawing from a different UP address */ device_invalidate_state(device, STATE_STREAMSRC); - drawPrimitive(device, vertex_count, 0, 0, NULL); + drawPrimitive(device, vertex_count, 0, FALSE, NULL); /* MSDN specifies stream zero settings must be set to NULL */ stream->buffer = NULL; @@ -4108,7 +4102,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive_up(struct wined3d_device *de { struct wined3d_stream_state *stream; struct wined3d_buffer *vb, *ib; - UINT index_size; TRACE("device %p, index_count %u, index_data %p, index_data_format %s, stream_data %p, stream_stride %u.\n", device, index_count, index_data, debug_d3dformat(index_data_format_id), stream_data, stream_stride); @@ -4119,11 +4112,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive_up(struct wined3d_device *de return WINED3DERR_INVALIDCALL; } - if (index_data_format_id == WINED3DFMT_R16_UINT) - index_size = 2; - else - index_size = 4; - stream = &device->stateBlock->state.streams[0]; vb = stream->buffer; stream->buffer = (struct wined3d_buffer *)stream_data; @@ -4132,6 +4120,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive_up(struct wined3d_device *de stream->offset = 0; stream->stride = stream_stride; device->stateBlock->state.user_stream = TRUE; + device->stateBlock->state.index_format = index_data_format_id; /* Set to 0 as per msdn. Do it now due to the stream source loading during drawPrimitive */ device->stateBlock->state.base_vertex_index = 0; @@ -4144,7 +4133,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive_up(struct wined3d_device *de device_invalidate_state(device, STATE_STREAMSRC); device_invalidate_state(device, STATE_INDEXBUFFER); - drawPrimitive(device, index_count, 0, index_size, index_data); + drawPrimitive(device, index_count, 0, TRUE, index_data); /* MSDN specifies stream zero settings and index buffer must be set to NULL */ stream->buffer = NULL; @@ -4174,7 +4163,7 @@ HRESULT CDECL wined3d_device_draw_primitive_strided(struct wined3d_device *devic device->stateBlock->state.base_vertex_index = 0; device->up_strided = strided_data; - drawPrimitive(device, vertex_count, 0, 0, NULL); + drawPrimitive(device, vertex_count, 0, FALSE, NULL); device->up_strided = NULL; /* Invalidate the states again to make sure the values from the stateblock @@ -4191,7 +4180,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive_strided(struct wined3d_devic UINT index_count, const struct wined3d_strided_data *strided_data, UINT vertex_count, const void *index_data, enum wined3d_format_id index_data_format_id) { - UINT index_size = index_data_format_id == WINED3DFMT_R32_UINT ? 4 : 2; + enum wined3d_format_id prev_idx_format; /* Mark the state dirty until we have nicer tracking * its fine to change baseVertexIndex because that call is only called by ddraw which does not need @@ -4201,11 +4190,14 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive_strided(struct wined3d_devic device_invalidate_state(device, STATE_STREAMSRC); device_invalidate_state(device, STATE_INDEXBUFFER); + prev_idx_format = device->stateBlock->state.index_format; + device->stateBlock->state.index_format = index_data_format_id; device->stateBlock->state.user_stream = TRUE; device->stateBlock->state.base_vertex_index = 0; device->up_strided = strided_data; - drawPrimitive(device, index_count, 0, index_size, index_data); + drawPrimitive(device, index_count, 0, TRUE, index_data); device->up_strided = NULL; + device->stateBlock->state.index_format = prev_idx_format; device_invalidate_state(device, STATE_VDECL); device_invalidate_state(device, STATE_STREAMSRC); diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 3a2b26b..136c8f5 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -575,7 +575,7 @@ static void remove_vbos(const struct wined3d_gl_info *gl_info, } /* Routine common to the draw primitive and draw indexed primitive routines */ -void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartIdx, UINT idxSize, const void *idxData) +void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartIdx, BOOL indexed, const void *idxData) { const struct wined3d_state *state = &device->stateBlock->state; struct wined3d_context *context; @@ -669,6 +669,14 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId BOOL emulation = FALSE; const struct wined3d_stream_info *stream_info = &device->strided_streams; struct wined3d_stream_info stridedlcl; + UINT idx_size; + + if (!indexed) + idx_size = 0; + else if (state->index_format == WINED3DFMT_R16_UINT) + idx_size = 2; + else + idx_size = 4; if (!use_vs(state)) { @@ -719,23 +727,23 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId TRACE("Using immediate mode with vertex shaders for half float emulation\n"); } drawStridedSlowVs(context->gl_info, state, stream_info, - index_count, glPrimType, idxData, idxSize, StartIdx); + index_count, glPrimType, idxData, idx_size, StartIdx); } else { drawStridedSlow(device, context, stream_info, index_count, - glPrimType, idxData, idxSize, StartIdx); + glPrimType, idxData, idx_size, StartIdx); } } else if (device->instancedDraw) { /* Instancing emulation with mixing immediate mode and arrays */ drawStridedInstanced(context->gl_info, state, stream_info, - index_count, glPrimType, idxData, idxSize, StartIdx, base_vertex_index); + index_count, glPrimType, idxData, idx_size, StartIdx, base_vertex_index); } else { - drawStridedFast(context->gl_info, glPrimType, index_count, idxSize, idxData, StartIdx, base_vertex_index); + drawStridedFast(context->gl_info, glPrimType, index_count, idx_size, idxData, StartIdx, base_vertex_index); } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 1e5f87c..94da438 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -932,7 +932,7 @@ struct wined3d_stream_info /* Routine common to the draw primitive and draw indexed primitive routines */ void drawPrimitive(struct wined3d_device *device, UINT index_count, - UINT start_idx, UINT idxBytes, const void *idxData) DECLSPEC_HIDDEN; + UINT start_idx, BOOL indexed, const void *idxData) DECLSPEC_HIDDEN; DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN; typedef void (WINE_GLAPI *glAttribFunc)(const void *data);
1
0
0
0
Henri Verbeet : d3d9: Properly retrieve an interface pointer in d3d9_texture_3d_GetVolumeLevel() .
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: 5d56abdb55eab1f18d12a16c6dac8c9f3792476c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d56abdb55eab1f18d12a16c6…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue May 1 20:25:26 2012 +0200 d3d9: Properly retrieve an interface pointer in d3d9_texture_3d_GetVolumeLevel(). --- dlls/d3d9/texture.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index c9114ef..8f83ef7 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -1160,6 +1160,7 @@ static HRESULT WINAPI d3d9_texture_3d_GetVolumeLevel(IDirect3DVolumeTexture9 *if { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); struct wined3d_resource *sub_resource; + IDirect3DVolume9Impl *volume_impl; TRACE("iface %p, level %u, volume %p.\n", iface, level, volume); @@ -1170,7 +1171,8 @@ static HRESULT WINAPI d3d9_texture_3d_GetVolumeLevel(IDirect3DVolumeTexture9 *if return D3DERR_INVALIDCALL; } - *volume = wined3d_resource_get_parent(sub_resource); + volume_impl = wined3d_resource_get_parent(sub_resource); + *volume = &volume_impl->IDirect3DVolume9_iface; IDirect3DVolume9_AddRef(*volume); wined3d_mutex_unlock();
1
0
0
0
← Newer
1
...
67
68
69
70
71
72
73
74
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
Results per page:
10
25
50
100
200