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 2007
----- 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
3 participants
1085 discussions
Start a n
N
ew thread
Evan Stade : gdiplus: Added GdipMeasureString.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: a51cf1d35ab635206a2ba3652059a34cc067756e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a51cf1d35ab635206a2ba3652…
Author: Evan Stade <estade(a)gmail.com> Date: Wed Aug 15 16:21:52 2007 -0700 gdiplus: Added GdipMeasureString. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 93 +++++++++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 + 3 files changed, 96 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index b31c6ed..615bb90 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -441,7 +441,7 @@ @ stdcall GdipLoadImageFromStreamICM(ptr ptr) @ stub GdipMeasureCharacterRanges @ stub GdipMeasureDriverString -@ stub GdipMeasureString +@ stdcall GdipMeasureString(ptr ptr long ptr ptr ptr ptr ptr ptr) @ stub GdipMultiplyLineTransform @ stdcall GdipMultiplyMatrix(ptr ptr long) @ stub GdipMultiplyPathGradientTransform diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index f63e073..c8a732d 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1709,6 +1709,99 @@ GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix return Ok; } +GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, + GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, + GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, RectF *bounds, + INT *codepointsfitted, INT *linesfilled) +{ + HFONT oldfont; + WCHAR* stringdup; + INT sum = 0, height = 0, fit, fitcpy, max_width = 0, i, j, lret, nwidth; + SIZE size; + + if(!graphics || !string || !font || !rect) + return InvalidParameter; + + if(format || codepointsfitted || linesfilled){ + FIXME("not implemented for given parameters\n"); + if(format) + TRACE("format attr is %d\n", format->attr); + return NotImplemented; + } + + if(length == -1) length = lstrlenW(string); + + stringdup = GdipAlloc(length * sizeof(WCHAR)); + if(!stringdup) return OutOfMemory; + + oldfont = SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw)); + nwidth = roundr(rect->Width); + + for(i = 0, j = 0; i < length; i++){ + if(!isprintW(string[i]) && (string[i] != '\n')) + continue; + + stringdup[j] = string[i]; + j++; + } + + stringdup[j] = 0; + length = j; + + while(sum < length){ + GetTextExtentExPointW(graphics->hdc, stringdup + sum, length - sum, + nwidth, &fit, NULL, &size); + fitcpy = fit; + + if(fit == 0) + break; + + for(lret = 0; lret < fit; lret++) + if(*(stringdup + sum + lret) == '\n') + break; + + /* Line break code (may look strange, but it imitates windows). */ + if(lret < fit) + fit = lret; /* this is not an off-by-one error */ + else if(fit < (length - sum)){ + if(*(stringdup + sum + fit) == ' ') + while(*(stringdup + sum + fit) == ' ') + fit++; + else + while(*(stringdup + sum + fit - 1) != ' '){ + fit--; + + if(*(stringdup + sum + fit) == '\t') + break; + + if(fit == 0){ + fit = fitcpy; + break; + } + } + } + + GetTextExtentExPointW(graphics->hdc, stringdup + sum, fit, + nwidth, &j, NULL, &size); + + sum += fit + (lret < fitcpy ? 1 : 0); + height += size.cy; + max_width = max(max_width, size.cx); + + if(height > roundr(rect->Height)) + break; + } + + bounds->X = rect->X; + bounds->Y = rect->Y; + bounds->Width = (REAL)max_width; + bounds->Height = min((REAL)height, rect->Height); + + DeleteObject(SelectObject(graphics->hdc, oldfont)); + + return Ok; +} + GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics *graphics, GraphicsState state) { static int calls; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index f63d895..872ac9b 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -94,6 +94,8 @@ GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*); GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*); GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics*,TextRenderingHint*); GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics*,GpMatrix*); +GpStatus WINGDIPAPI GdipMeasureString(GpGraphics*,GDIPCONST WCHAR*,INT, + GDIPCONST GpFont*,GDIPCONST RectF*,GDIPCONST GpStringFormat*,RectF*,INT*,INT*); GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics*,GraphicsState); GpStatus WINGDIPAPI GdipRotateWorldTransform(GpGraphics*,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics*,GraphicsState*);
1
0
0
0
Andrew Talbot : riched20: Constify some variables.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: 291dd7a090bbd07d76070d054b8d3ef409351f9c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=291dd7a090bbd07d76070d054…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Wed Aug 15 21:35:51 2007 +0100 riched20: Constify some variables. --- dlls/riched20/editor.h | 36 ++++++++++++++++++------------------ dlls/riched20/run.c | 8 ++++---- dlls/riched20/string.c | 36 ++++++++++++++++++------------------ 3 files changed, 40 insertions(+), 40 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=291dd7a090bbd07d76070…
1
0
0
0
Stefan Dösinger : wined3d: Fix WINED3DFMT_A4L4.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: 028729d102db18fec9c4ae214a9b864a469384cc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=028729d102db18fec9c4ae214…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Aug 11 20:02:01 2007 +0200 wined3d: Fix WINED3DFMT_A4L4. --- dlls/wined3d/device.c | 16 ++++++++++++ dlls/wined3d/surface.c | 51 +++++++++++++++++++++++---------------- dlls/wined3d/wined3d_private.h | 23 ++++++++++++++++++ 3 files changed, 69 insertions(+), 21 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 9e988e5..7b9d92e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5153,6 +5153,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface, int offset = 0; int rowoffset = 0; /* how many bytes to add onto the end of a row to wraparound to the beginning of the next */ glDescriptor *glDescription = NULL; + GLenum dummy; + int bpp; + CONVERT_TYPES convert = NO_CONVERSION; WINED3DSURFACE_DESC winedesc; @@ -5178,6 +5181,19 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface, return WINED3DERR_INVALIDCALL; } + /* This call loads the opengl surface directly, instead of copying the surface to the + * destination's sysmem copy. If surface conversion is needed, use BltFast instead to + * copy in sysmem and use regular surface loading. + */ + d3dfmt_get_conv((IWineD3DSurfaceImpl *) pDestinationSurface, FALSE, TRUE, + &dummy, &dummy, &dummy, &convert, &bpp, FALSE); + if(convert != NO_CONVERSION) { + return IWineD3DSurface_BltFast(pDestinationSurface, + pDestPoint ? pDestPoint->x : 0, + pDestPoint ? pDestPoint->y : 0, + pSourceSurface, (RECT *) pSourceRect, 0); + } + if (destFormat == WINED3DFMT_UNKNOWN) { TRACE("(%p) : Converting destination surface from WINED3DFMT_UNKNOWN to the source format\n", This); IWineD3DSurface_SetFormat(pDestinationSurface, srcFormat); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 464e5c8..5ba1dec 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -32,26 +32,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); #define GLINFO_LOCATION This->resource.wineD3DDevice->adapter->gl_info -typedef enum { - NO_CONVERSION, - CONVERT_PALETTED, - CONVERT_PALETTED_CK, - CONVERT_CK_565, - CONVERT_CK_5551, - CONVERT_CK_4444, - CONVERT_CK_4444_ARGB, - CONVERT_CK_1555, - CONVERT_555, - CONVERT_CK_RGB24, - CONVERT_CK_8888, - CONVERT_CK_8888_ARGB, - CONVERT_RGB32_888, - CONVERT_V8U8, - CONVERT_X8L8V8U8, - CONVERT_Q8W8V8U8, - CONVERT_V16U16 -} CONVERT_TYPES; - HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UINT height, UINT outpitch, CONVERT_TYPES convert, IWineD3DSurfaceImpl *surf); static void surface_download_data(IWineD3DSurfaceImpl *This) { @@ -1484,7 +1464,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC) { IWineD3DSurface Internal (No mapping to directx api) parts follow ****************************************************** */ -static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode) { +HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode) { BOOL colorkey_active = need_alpha_ck && (This->CKeyFlags & WINEDDSD_CKSRCBLT); const GlPixelFormatDesc *glDesc; getFormatDescEntry(This->resource.format, &GLINFO_LOCATION, &glDesc); @@ -1615,6 +1595,18 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO */ break; + case WINED3DFMT_A4L4: + /* A4L4 exists as an internal gl format, but for some reason there is not + * format+type combination to load it. Thus convert it to A8L8, then load it + * with A4L4 internal, but A8L8 format+type + */ + *convert = CONVERT_A4L4; + *format = GL_LUMINANCE_ALPHA; + *internal = GL_LUMINANCE4_ALPHA4; + *type = GL_UNSIGNED_BYTE; + *target_bpp = 2; + break; + default: break; } @@ -1801,6 +1793,23 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN break; } + case CONVERT_A4L4: + { + unsigned int x, y; + unsigned char *Source; + unsigned char *Dest; + for(y = 0; y < height; y++) { + Source = (unsigned char *) (src + y * pitch); + Dest = (unsigned char *) (dst + y * outpitch); + for (x = 0; x < width; x++ ) { + unsigned char color = (*Source++); + /* A */ Dest[1] = (color & 0xf0) << 0; + /* L */ Dest[0] = (color & 0x0f) << 4; + Dest += 2; + } + } + break; + } default: ERR("Unsupported conversation type %d\n", convert); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 445ecea..7a9170a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1220,6 +1220,29 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD3DCl BOOL CalculateTexRect(IWineD3DSurfaceImpl *This, RECT *Rect, float glTexCoord[4]); +typedef enum { + NO_CONVERSION, + CONVERT_PALETTED, + CONVERT_PALETTED_CK, + CONVERT_CK_565, + CONVERT_CK_5551, + CONVERT_CK_4444, + CONVERT_CK_4444_ARGB, + CONVERT_CK_1555, + CONVERT_555, + CONVERT_CK_RGB24, + CONVERT_CK_8888, + CONVERT_CK_8888_ARGB, + CONVERT_RGB32_888, + CONVERT_V8U8, + CONVERT_X8L8V8U8, + CONVERT_Q8W8V8U8, + CONVERT_V16U16, + CONVERT_A4L4 +} CONVERT_TYPES; + +HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode); + /***************************************************************************** * IWineD3DVertexDeclaration implementation structure */
1
0
0
0
Stefan Dösinger : wined3d: Reinstall the internal reference on the current index buffer.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: b220905e4a0d884ae0802541d00d5480e0023b0e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b220905e4a0d884ae0802541d…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Aug 14 14:46:38 2007 +0200 wined3d: Reinstall the internal reference on the current index buffer. --- dlls/d3d9/tests/visual.c | 86 +++++++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/device.c | 9 ++++- dlls/wined3d/stateblock.c | 1 + 3 files changed, 95 insertions(+), 1 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index dfaee3b..cc13413 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -1479,6 +1479,91 @@ static void maxmip_test(IDirect3DDevice9 *device) IDirect3DTexture9_Release(texture); } +static void release_buffer_test(IDirect3DDevice9 *device) +{ + IDirect3DVertexBuffer9 *vb = NULL; + IDirect3DIndexBuffer9 *ib = NULL; + HRESULT hr; + BYTE *data; + long ref; + + static const struct vertex quad[] = { + {-1.0, -1.0, 0.1, 0xffff0000}, + {-1.0, 1.0, 0.1, 0xffff0000}, + { 1.0, 1.0, 0.1, 0xffff0000}, + + {-1.0, -1.0, 0.1, 0xff00ff00}, + {-1.0, 1.0, 0.1, 0xff00ff00}, + { 1.0, 1.0, 0.1, 0xff00ff00} + }; + short indices[] = {3, 4, 5}; + + /* Index and vertex buffers should always be createable */ + hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), 0, D3DFVF_XYZ | D3DFVF_DIFFUSE, + D3DPOOL_MANAGED, &vb, NULL); + ok(hr == D3D_OK, "CreateVertexBuffer failed with %s\n", DXGetErrorString9(hr)); + if(!vb) { + skip("Failed to create a vertex buffer\n"); + return; + } + hr = IDirect3DDevice9_CreateIndexBuffer(device, sizeof(indices), 0, D3DFMT_INDEX16, D3DPOOL_DEFAULT, &ib, NULL); + ok(hr == D3D_OK, "IDirect3DDevice9_CreateIndexBuffer failed with %s\n", DXGetErrorString9(hr)); + if(!ib) { + skip("Failed to create an index buffer\n"); + return; + } + + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad), (void **) &data, 0); + ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Lock failed with %s\n", DXGetErrorString9(hr)); + memcpy(data, quad, sizeof(quad)); + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Unlock failed with %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DIndexBuffer9_Lock(ib, 0, sizeof(indices), (void **) &data, 0); + ok(hr == D3D_OK, "IDirect3DIndexBuffer9_Lock failed with %s\n", DXGetErrorString9(hr)); + memcpy(data, indices, sizeof(indices)); + hr = IDirect3DIndexBuffer9_Unlock(ib); + ok(hr == D3D_OK, "IDirect3DIndexBuffer9_Unlock failed with %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_SetIndices(device, ib); + ok(hr == D3D_OK, "IDirect3DIndexBuffer8_Unlock failed with %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad[0])); + ok(hr == D3D_OK, "IDirect3DIndexBuffer8_Unlock failed with %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %s\n", DXGetErrorString9(hr)); + + /* Now destroy the bound index buffer and draw again */ + ref = IDirect3DIndexBuffer9_Release(ib); + ok(ref == 0, "Index Buffer reference count is %08ld\n", ref); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); + ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); + if(SUCCEEDED(hr)) + { + /* Deliberately using minvertexindex = 0 and numVertices = 6 to prevent d3d from + * making assumptions about the indices or vertices + */ + hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 3, 3, 0, 1); + ok(hr == D3D_OK, "IDirect3DDevice9_DrawIndexedPrimitive failed with %08x\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x\n", hr); + } + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); + + hr = IDirect3DDevice9_SetIndices(device, NULL); + ok(hr == D3D_OK, "IDirect3DIndexBuffer9_Unlock failed with %08x\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); + ok(hr == D3D_OK, "IDirect3DIndexBuffer9_Unlock failed with %08x\n", hr); + + /* Index buffer was already destroyed as part of the test */ + IDirect3DVertexBuffer9_Release(vb); +} + START_TEST(visual) { IDirect3DDevice9 *device_ptr; @@ -1553,6 +1638,7 @@ START_TEST(visual) skip("No mipmap support\n"); } offscreen_test(device_ptr); + release_buffer_test(device_ptr); if (caps.VertexShaderVersion >= D3DVS_VERSION(2, 0)) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 43d801f..9e988e5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2796,6 +2796,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWine if(oldIdxs != pIndexData) { IWineD3DDeviceImpl_MarkStateDirty(This, STATE_INDEXBUFFER); + if(pIndexData) IWineD3DIndexBuffer_AddRef(pIndexData); + if(oldIdxs) IWineD3DIndexBuffer_Release(oldIdxs); } return WINED3D_OK; } @@ -4785,6 +4787,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice * UINT VertexStreamZeroStride) { int idxStride; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + IWineD3DIndexBuffer *ib; TRACE("(%p) : Type=(%d,%s), MinVtxIdx=%d, NumVIdx=%d, PCount=%d, pidxdata=%p, IdxFmt=%d, pVtxdata=%p, stride=%d\n", This, PrimitiveType, debug_d3dprimitivetype(PrimitiveType), @@ -4815,7 +4818,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice * /* MSDN specifies stream zero settings and index buffer must be set to NULL */ This->stateBlock->streamSource[0] = NULL; This->stateBlock->streamStride[0] = 0; - This->stateBlock->pIndexData = NULL; + ib = This->stateBlock->pIndexData; + if(ib) { + IWineD3DIndexBuffer_Release(ib); + This->stateBlock->pIndexData = NULL; + } /* No need to mark the stream source state dirty here. Either the app calls UP drawing again, or it has to call * SetStreamSource to specify a vertex buffer */ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index b7b64a5..772bd78 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -262,6 +262,7 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) { } } } + if(This->pIndexData) IWineD3DIndexBuffer_Release(This->pIndexData); }
1
0
0
0
Stefan Dösinger : wined3d: Release the stateblock before destroying the swapchain.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: 7ebf3d92b578d70b4073c8d365aea5cfdafb1447 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7ebf3d92b578d70b4073c8d36…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Aug 14 14:44:41 2007 +0200 wined3d: Release the stateblock before destroying the swapchain. --- dlls/wined3d/device.c | 38 +++++++++++++++++++------------------- 1 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index bdc2c94..43d801f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1975,6 +1975,25 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D IWineD3DDevice_SetTexture(iface, WINED3DVERTEXTEXTURESAMPLER0 + sampler, NULL); } + /* Release the update stateblock */ + if(IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->updateStateBlock) > 0){ + if(This->updateStateBlock != This->stateBlock) + FIXME("(%p) Something's still holding the Update stateblock\n",This); + } + This->updateStateBlock = NULL; + + { /* because were not doing proper internal refcounts releasing the primary state block + causes recursion with the extra checks in ResourceReleased, to avoid this we have + to set this->stateBlock = NULL; first */ + IWineD3DStateBlock *stateBlock = (IWineD3DStateBlock *)This->stateBlock; + This->stateBlock = NULL; + + /* Release the stateblock */ + if(IWineD3DStateBlock_Release(stateBlock) > 0){ + FIXME("(%p) Something's still holding the Update stateblock\n",This); + } + } + /* Release the buffers (with sanity checks)*/ TRACE("Releasing the depth stencil buffer at %p\n", This->stencilBufferTarget); if(This->stencilBufferTarget != NULL && (IWineD3DSurface_Release(This->stencilBufferTarget) >0)){ @@ -2008,25 +2027,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D This->swapchains = NULL; This->NumberOfSwapChains = 0; - /* Release the update stateblock */ - if(IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->updateStateBlock) > 0){ - if(This->updateStateBlock != This->stateBlock) - FIXME("(%p) Something's still holding the Update stateblock\n",This); - } - This->updateStateBlock = NULL; - - { /* because were not doing proper internal refcounts releasing the primary state block - causes recursion with the extra checks in ResourceReleased, to avoid this we have - to set this->stateBlock = NULL; first */ - IWineD3DStateBlock *stateBlock = (IWineD3DStateBlock *)This->stateBlock; - This->stateBlock = NULL; - - /* Release the stateblock */ - if(IWineD3DStateBlock_Release(stateBlock) > 0){ - FIXME("(%p) Something's still holding the Update stateblock\n",This); - } - } - HeapFree(GetProcessHeap(), 0, This->render_targets); HeapFree(GetProcessHeap(), 0, This->fbo_color_attachments); HeapFree(GetProcessHeap(), 0, This->draw_buffers);
1
0
0
0
Stefan Dösinger : wined3d: Do not advertize A8R3R3B2 support.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: 18936a1b891b30cffc46c9ae9b98378ff0c21cb7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18936a1b891b30cffc46c9ae9…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Aug 11 17:29:10 2007 +0200 wined3d: Do not advertize A8R3R3B2 support. --- dlls/wined3d/directx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index bef0c3f..3889554 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1691,7 +1691,6 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt case WINED3DFMT_A4R4G4B4: case WINED3DFMT_R3G3B2: case WINED3DFMT_A8: - case WINED3DFMT_A8R3G3B2: case WINED3DFMT_X4R4G4B4: case WINED3DFMT_A8B8G8R8: case WINED3DFMT_X8B8G8R8: @@ -1762,6 +1761,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt /* Not supported */ case WINED3DFMT_G16R16: case WINED3DFMT_A16B16G16R16: + case WINED3DFMT_A8R3G3B2: TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */ return WINED3DERR_NOTAVAILABLE;
1
0
0
0
Paul Vriens : shell32/tests: Use GetModuleHandle instead of LoadLibrary.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: 444a8e5190a6b9c446f268a2172a3b6e8ff2a9d9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=444a8e5190a6b9c446f268a21…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Wed Aug 15 21:00:06 2007 +0200 shell32/tests: Use GetModuleHandle instead of LoadLibrary. --- dlls/shell32/tests/shellpath.c | 70 +++++++++++++++++++--------------------- dlls/shell32/tests/string.c | 4 +-- 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index 402ff42..2821b4f 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -73,7 +73,7 @@ struct shellExpectedValues { BYTE pidlType; }; -static HMODULE hShell32; +static HRESULT (WINAPI *pDllGetVersion)(DLLVERSIONINFO *); static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR); static HRESULT (WINAPI *pSHGetFolderLocation)(HWND, int, HANDLE, DWORD, LPITEMIDLIST *); @@ -152,45 +152,42 @@ static const struct shellExpectedValues optionalShellValues[] = { static void loadShell32(void) { - hShell32 = LoadLibraryA("shell32"); - if (hShell32) + HMODULE hShell32 = GetModuleHandleA("shell32"); + +#define GET_PROC(func) \ + p ## func = (void*)GetProcAddress(hShell32, #func); \ + if(!p ## func) \ + trace("GetProcAddress(%s) failed\n", #func); + + GET_PROC(DllGetVersion) + GET_PROC(SHGetFolderPathA) + GET_PROC(SHGetFolderLocation) + GET_PROC(SHGetSpecialFolderPathA) + GET_PROC(SHGetSpecialFolderLocation) + GET_PROC(ILFindLastID) + if (!pILFindLastID) + pILFindLastID = (void *)GetProcAddress(hShell32, (LPCSTR)16); + GET_PROC(SHFileOperationA) + GET_PROC(SHGetMalloc) + + ok(pSHGetMalloc != NULL, "shell32 is missing SHGetMalloc\n"); + if (pSHGetMalloc) { - HRESULT (WINAPI *pDllGetVersion)(DLLVERSIONINFO *); - - pSHGetFolderPathA = (void *)GetProcAddress(hShell32, - "SHGetFolderPathA"); - pSHGetFolderLocation = (void *)GetProcAddress(hShell32, - "SHGetFolderLocation"); - pSHGetSpecialFolderPathA = (void *)GetProcAddress(hShell32, - "SHGetSpecialFolderPathA"); - pSHGetSpecialFolderLocation = (void *)GetProcAddress(hShell32, - "SHGetSpecialFolderLocation"); - pDllGetVersion = (void *)GetProcAddress(hShell32, "DllGetVersion"); - pILFindLastID = (void *)GetProcAddress(hShell32, "ILFindLastID"); - if (!pILFindLastID) - pILFindLastID = (void *)GetProcAddress(hShell32, (LPCSTR)16); - pSHFileOperationA = (void *)GetProcAddress(hShell32, - "SHFileOperationA"); - pSHGetMalloc = (void *)GetProcAddress(hShell32, "SHGetMalloc"); - - ok(pSHGetMalloc != NULL, "shell32 is missing SHGetMalloc\n"); - if (pSHGetMalloc) - { - HRESULT hr = pSHGetMalloc(&pMalloc); + HRESULT hr = pSHGetMalloc(&pMalloc); - ok(SUCCEEDED(hr), "SHGetMalloc failed: 0x%08x\n", hr); - ok(pMalloc != NULL, "SHGetMalloc returned a NULL IMalloc\n"); - } + ok(SUCCEEDED(hr), "SHGetMalloc failed: 0x%08x\n", hr); + ok(pMalloc != NULL, "SHGetMalloc returned a NULL IMalloc\n"); + } - if (pDllGetVersion) - { - shellVersion.cbSize = sizeof(shellVersion); - pDllGetVersion(&shellVersion); - if (winetest_interactive) - printf("shell32 version is %d.%d\n", - shellVersion.dwMajorVersion, shellVersion.dwMinorVersion); - } + if (pDllGetVersion) + { + shellVersion.cbSize = sizeof(shellVersion); + pDllGetVersion(&shellVersion); + if (winetest_interactive) + printf("shell32 version is %d.%d\n", + shellVersion.dwMajorVersion, shellVersion.dwMinorVersion); } +#undef GET_PROC } #ifndef CSIDL_PROFILES @@ -892,7 +889,6 @@ START_TEST(shellpath) if (!init()) return; loadShell32(); - if (!hShell32) return; if (myARGC >= 3) doChild(myARGV[2]); diff --git a/dlls/shell32/tests/string.c b/dlls/shell32/tests/string.c index acd3101..c748f35 100644 --- a/dlls/shell32/tests/string.c +++ b/dlls/shell32/tests/string.c @@ -100,9 +100,7 @@ START_TEST(string) { CoInitialize(0); - hShell32 = LoadLibraryA("shell32.dll"); - if (!hShell32) - return; + hShell32 = GetModuleHandleA("shell32.dll"); pStrRetToStrNAW = (void*)GetProcAddress(hShell32, (LPSTR)96); if (pStrRetToStrNAW)
1
0
0
0
Stefan Dösinger : wined3d: Fix WINED3DFMT_R3G3B2.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: 56a7486235968826a31ba2cf5a8dcb47580f5abe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=56a7486235968826a31ba2cf5…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Aug 11 17:26:29 2007 +0200 wined3d: Fix WINED3DFMT_R3G3B2. --- dlls/wined3d/utils.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 84af4ee..dfc1fc6 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -153,7 +153,7 @@ static const GlPixelFormatDescTemplate gl_formats_template[] = { {WINED3DFMT_X1R5G5B5 ,GL_RGB5_A1 ,GL_RGB5_A1 ,GL_BGRA ,GL_UNSIGNED_SHORT_1_5_5_5_REV }, {WINED3DFMT_A1R5G5B5 ,GL_RGB5_A1 ,GL_RGB5_A1 ,GL_BGRA ,GL_UNSIGNED_SHORT_1_5_5_5_REV }, {WINED3DFMT_A4R4G4B4 ,GL_RGBA4 ,GL_SRGB8_ALPHA8_EXT ,GL_BGRA ,GL_UNSIGNED_SHORT_4_4_4_4_REV }, - {WINED3DFMT_R3G3B2 ,GL_R3_G3_B2 ,GL_R3_G3_B2 ,GL_RGB ,GL_UNSIGNED_BYTE_2_3_3_REV }, + {WINED3DFMT_R3G3B2 ,GL_R3_G3_B2 ,GL_R3_G3_B2 ,GL_RGB ,GL_UNSIGNED_BYTE_3_3_2 }, {WINED3DFMT_A8 ,GL_ALPHA8 ,GL_ALPHA8 ,GL_ALPHA ,GL_UNSIGNED_BYTE }, {WINED3DFMT_A8R3G3B2 ,0 ,0 ,0 ,0 }, {WINED3DFMT_X4R4G4B4 ,GL_RGB4 ,GL_RGB4 ,GL_BGRA ,GL_UNSIGNED_SHORT_4_4_4_4_REV },
1
0
0
0
Lei Zhang : riched20: Add missing scroll bar update.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: 13ae5f8e8c6a5034613874a189ce0625f11dc56b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=13ae5f8e8c6a5034613874a18…
Author: Lei Zhang <thestig(a)google.com> Date: Wed Aug 15 10:45:07 2007 -0700 riched20: Add missing scroll bar update. --- dlls/riched20/caret.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index f38f700..f5fbf00 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -230,7 +230,8 @@ ME_MoveCaret(ME_TextEditor *editor) { int x, y, height; - ME_WrapMarkedParagraphs(editor); + if (ME_WrapMarkedParagraphs(editor)) + ME_UpdateScrollBar(editor); ME_GetCursorCoordinates(editor, &editor->pCursors[0], &x, &y, &height); if(editor->bHaveFocus) {
1
0
0
0
Lei Zhang : riched20: Properly calculate control display height.
by Alexandre Julliard
16 Aug '07
16 Aug '07
Module: wine Branch: master Commit: 0d4707c284808df6d87eeb5908df29693889eccc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0d4707c284808df6d87eeb590…
Author: Lei Zhang <thestig(a)google.com> Date: Wed Aug 15 10:39:43 2007 -0700 riched20: Properly calculate control display height. --- dlls/riched20/editor.c | 1 + dlls/riched20/editstr.h | 1 + dlls/riched20/paint.c | 2 +- dlls/riched20/wrap.c | 2 ++ 4 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 740828f..f46c4b2 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1131,6 +1131,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { ed->pCursors[1].pRun = ME_FindItemFwd(ed->pBuffer->pFirst, diRun); ed->pCursors[1].nOffset = 0; ed->nLastTotalLength = ed->nTotalLength = 0; + ed->nHeight = 0; ed->nUDArrowX = -1; ed->nSequence = 0; ed->rgbBackColor = -1; diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index 7bb91d5..b86aeba 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -291,6 +291,7 @@ typedef struct tagME_TextEditor int nCursors; SIZE sizeWindow; int nTotalLength, nLastTotalLength; + int nHeight; int nUDArrowX; int nSequence; COLORREF rgbBackColor; diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 676543e..215477b 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -460,7 +460,7 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) hWnd = editor->hWnd; si.cbSize = sizeof(si); bScrollBarWasVisible = ME_GetYScrollVisible(editor); - bScrollBarWillBeVisible = editor->nTotalLength > editor->sizeWindow.cy; + bScrollBarWillBeVisible = editor->nHeight > editor->sizeWindow.cy; if (bScrollBarWasVisible != bScrollBarWillBeVisible) { diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c index af6e9a9..c8b5710 100644 --- a/dlls/riched20/wrap.c +++ b/dlls/riched20/wrap.c @@ -429,11 +429,13 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) { ME_InitContext(&c, editor, hDC); c.pt.x = 0; c.pt.y = 0; + editor->nHeight = 0; item = editor->pBuffer->pFirst->next; while(item != editor->pBuffer->pLast) { BOOL bRedraw = FALSE; assert(item->type == diParagraph); + editor->nHeight = max(editor->nHeight, item->member.para.nYPos); if ((item->member.para.nFlags & MEPF_REWRAP) || (item->member.para.nYPos != c.pt.y)) bRedraw = TRUE;
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
...
109
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200