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
September 2014
----- 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
301 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Don't include leading '?' in nsIURL:: GetSearch implementation.
by Alexandre Julliard
19 Sep '14
19 Sep '14
Module: wine Branch: master Commit: 47a7d835d4e62f45516f76464c7661b6a5482a9e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47a7d835d4e62f45516f76464…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 19 13:00:01 2014 +0200 mshtml: Don't include leading '?' in nsIURL::GetSearch implementation. --- dlls/mshtml/nsio.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 901b5b9..9335428 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -2627,10 +2627,27 @@ static nsresult NSAPI nsURL_SetFilePath(nsIFileURL *iface, const nsACString *aFi static nsresult NSAPI nsURL_GetQuery(nsIFileURL *iface, nsACString *aQuery) { nsWineURI *This = impl_from_nsIFileURL(iface); + WCHAR *ptr; + BSTR query; + nsresult nsres; + HRESULT hres; TRACE("(%p)->(%p)\n", This, aQuery); - return get_uri_string(This, Uri_PROPERTY_QUERY, aQuery); + if(!ensure_uri(This)) + return NS_ERROR_UNEXPECTED; + + hres = IUri_GetQuery(This->uri, &query); + if(FAILED(hres)) + return NS_ERROR_FAILURE; + + ptr = query; + if(ptr && *ptr == '?') + ptr++; + + nsres = return_wstr_nsacstr(aQuery, ptr, -1); + SysFreeString(query); + return nsres; } static nsresult NSAPI nsURL_SetQuery(nsIFileURL *iface, const nsACString *aQuery)
1
0
0
0
Nikolay Sivov : dwrite: Added IDWriteTypography implementation.
by Alexandre Julliard
19 Sep '14
19 Sep '14
Module: wine Branch: master Commit: c67f930a9f191d68890c8915612c396d2eacac81 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c67f930a9f191d68890c89156…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Sep 19 07:54:00 2014 +0400 dwrite: Added IDWriteTypography implementation. --- dlls/dwrite/dwrite_private.h | 1 + dlls/dwrite/layout.c | 127 +++++++++++++++++++++++++++++++++++++++++++ dlls/dwrite/main.c | 4 +- dlls/dwrite/tests/layout.c | 46 ++++++++++++++++ 4 files changed, 176 insertions(+), 2 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 77834cd..626230e 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -88,6 +88,7 @@ extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN; extern HRESULT create_textlayout(const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,IDWriteTextLayout**) DECLSPEC_HIDDEN; extern HRESULT create_trimmingsign(IDWriteInlineObject**) DECLSPEC_HIDDEN; +extern HRESULT create_typography(IDWriteTypography**) DECLSPEC_HIDDEN; extern HRESULT get_gdiinterop(IDWriteGdiInterop**) DECLSPEC_HIDDEN; extern HRESULT create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; extern HRESULT add_localizedstring(IDWriteLocalizedStrings*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 82525d8..0b33b92 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -122,6 +122,15 @@ struct dwrite_trimmingsign { LONG ref; }; +struct dwrite_typography { + IDWriteTypography IDWriteTypography_iface; + LONG ref; + + DWRITE_FONT_FEATURE *features; + UINT32 allocated; + UINT32 count; +}; + static const IDWriteTextFormatVtbl dwritetextformatvtbl; static void release_format_data(struct dwrite_textformat_data *data) @@ -152,6 +161,11 @@ static inline struct dwrite_trimmingsign *impl_from_IDWriteInlineObject(IDWriteI return CONTAINING_RECORD(iface, struct dwrite_trimmingsign, IDWriteInlineObject_iface); } +static inline struct dwrite_typography *impl_from_IDWriteTypography(IDWriteTypography *iface) +{ + return CONTAINING_RECORD(iface, struct dwrite_typography, IDWriteTypography_iface); +} + /* To be used in IDWriteTextLayout methods to validate and fix passed range */ static inline BOOL validate_text_range(struct dwrite_textlayout *layout, DWRITE_TEXT_RANGE *r) { @@ -1787,3 +1801,116 @@ HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *colle return S_OK; } + +static HRESULT WINAPI dwritetypography_QueryInterface(IDWriteTypography *iface, REFIID riid, void **obj) +{ + struct dwrite_typography *typography = impl_from_IDWriteTypography(iface); + + TRACE("(%p)->(%s %p)\n", typography, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IDWriteTypography) || IsEqualIID(riid, &IID_IUnknown)) { + *obj = iface; + IDWriteTypography_AddRef(iface); + return S_OK; + } + + *obj = NULL; + + return E_NOINTERFACE; +} + +static ULONG WINAPI dwritetypography_AddRef(IDWriteTypography *iface) +{ + struct dwrite_typography *typography = impl_from_IDWriteTypography(iface); + ULONG ref = InterlockedIncrement(&typography->ref); + TRACE("(%p)->(%d)\n", typography, ref); + return ref; +} + +static ULONG WINAPI dwritetypography_Release(IDWriteTypography *iface) +{ + struct dwrite_typography *typography = impl_from_IDWriteTypography(iface); + ULONG ref = InterlockedDecrement(&typography->ref); + + TRACE("(%p)->(%d)\n", typography, ref); + + if (!ref) { + heap_free(typography->features); + heap_free(typography); + } + + return ref; +} + +static HRESULT WINAPI dwritetypography_AddFontFeature(IDWriteTypography *iface, DWRITE_FONT_FEATURE feature) +{ + struct dwrite_typography *typography = impl_from_IDWriteTypography(iface); + + TRACE("(%p)->(%x %u)\n", typography, feature.nameTag, feature.parameter); + + if (typography->count == typography->allocated) { + DWRITE_FONT_FEATURE *ptr = heap_realloc(typography->features, 2*typography->allocated*sizeof(DWRITE_FONT_FEATURE)); + if (!ptr) + return E_OUTOFMEMORY; + + typography->features = ptr; + typography->allocated *= 2; + } + + typography->features[typography->count++] = feature; + return S_OK; +} + +static UINT32 WINAPI dwritetypography_GetFontFeatureCount(IDWriteTypography *iface) +{ + struct dwrite_typography *typography = impl_from_IDWriteTypography(iface); + TRACE("(%p)\n", typography); + return typography->count; +} + +static HRESULT WINAPI dwritetypography_GetFontFeature(IDWriteTypography *iface, UINT32 index, DWRITE_FONT_FEATURE *feature) +{ + struct dwrite_typography *typography = impl_from_IDWriteTypography(iface); + + TRACE("(%p)->(%u %p)\n", typography, index, feature); + + if (index >= typography->count) + return E_INVALIDARG; + + *feature = typography->features[index]; + return S_OK; +} + +static const IDWriteTypographyVtbl dwritetypographyvtbl = { + dwritetypography_QueryInterface, + dwritetypography_AddRef, + dwritetypography_Release, + dwritetypography_AddFontFeature, + dwritetypography_GetFontFeatureCount, + dwritetypography_GetFontFeature +}; + +HRESULT create_typography(IDWriteTypography **ret) +{ + struct dwrite_typography *typography; + + *ret = NULL; + + typography = heap_alloc(sizeof(*typography)); + if (!typography) + return E_OUTOFMEMORY; + + typography->IDWriteTypography_iface.lpVtbl = &dwritetypographyvtbl; + typography->ref = 1; + typography->allocated = 2; + typography->count = 0; + + typography->features = heap_alloc(typography->allocated*sizeof(DWRITE_FONT_FEATURE)); + if (!typography->features) { + heap_free(typography); + return E_OUTOFMEMORY; + } + + *ret = &typography->IDWriteTypography_iface; + return S_OK; +} diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c index bcddbba..c626201 100644 --- a/dlls/dwrite/main.c +++ b/dlls/dwrite/main.c @@ -696,8 +696,8 @@ static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory *iface, WCHA static HRESULT WINAPI dwritefactory_CreateTypography(IDWriteFactory *iface, IDWriteTypography **typography) { struct dwritefactory *This = impl_from_IDWriteFactory(iface); - FIXME("(%p)->(%p): stub\n", This, typography); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, typography); + return create_typography(typography); } static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory *iface, IDWriteGdiInterop **gdi_interop) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index b778a80..2e4618a 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -750,6 +750,51 @@ todo_wine IDWriteTextLayout_Release(layout); } +static void test_typography(void) +{ + DWRITE_FONT_FEATURE feature; + IDWriteTypography *typography; + UINT32 count; + HRESULT hr; + + hr = IDWriteFactory_CreateTypography(factory, &typography); + ok(hr == S_OK, "got 0x%08x\n", hr); + + feature.nameTag = DWRITE_FONT_FEATURE_TAG_KERNING; + feature.parameter = 1; + hr = IDWriteTypography_AddFontFeature(typography, feature); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = IDWriteTypography_GetFontFeatureCount(typography); + ok(count == 1, "got %u\n", count); + + /* duplicated features work just fine */ + feature.nameTag = DWRITE_FONT_FEATURE_TAG_KERNING; + feature.parameter = 0; + hr = IDWriteTypography_AddFontFeature(typography, feature); + ok(hr == S_OK, "got 0x%08x\n", hr); + + count = IDWriteTypography_GetFontFeatureCount(typography); + ok(count == 2, "got %u\n", count); + + memset(&feature, 0, sizeof(feature)); + hr = IDWriteTypography_GetFontFeature(typography, 0, &feature); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag); + ok(feature.parameter == 1, "got %u\n", feature.parameter); + + memset(&feature, 0, sizeof(feature)); + hr = IDWriteTypography_GetFontFeature(typography, 1, &feature); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(feature.nameTag == DWRITE_FONT_FEATURE_TAG_KERNING, "got tag %x\n", feature.nameTag); + ok(feature.parameter == 0, "got %u\n", feature.parameter); + + hr = IDWriteTypography_GetFontFeature(typography, 2, &feature); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + IDWriteTypography_Release(typography); +} + START_TEST(layout) { HRESULT hr; @@ -773,6 +818,7 @@ START_TEST(layout) test_fontweight(); test_SetInlineObject(); test_draw_sequence(); + test_typography(); IDWriteFactory_Release(factory); }
1
0
0
0
Henri Verbeet : wined3d: Use the texture resource in wined3d_surface_depth_fill().
by Alexandre Julliard
19 Sep '14
19 Sep '14
Module: wine Branch: master Commit: 8aa113750974dde5a6b3e0bb434eeee5c2d758dc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8aa113750974dde5a6b3e0bb4…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 19 10:41:49 2014 +0200 wined3d: Use the texture resource in wined3d_surface_depth_fill(). --- dlls/wined3d/surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 9603e21..73f964d 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1102,7 +1102,7 @@ static BOOL surface_convert_depth_to_float(const struct wined3d_surface *surface static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const RECT *rect, float depth) { - const struct wined3d_resource *resource = &surface->resource; + const struct wined3d_resource *resource = &surface->container->resource; struct wined3d_device *device = resource->device; const struct blit_shader *blitter;
1
0
0
0
Henri Verbeet : wined3d: Never pass a surface to wined3d_resource_is_offscreen().
by Alexandre Julliard
19 Sep '14
19 Sep '14
Module: wine Branch: master Commit: 4f2110b0ce758822f549c5a730938739e1b5a79e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4f2110b0ce758822f549c5a73…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 19 10:41:48 2014 +0200 wined3d: Never pass a surface to wined3d_resource_is_offscreen(). --- dlls/wined3d/arb_program_shader.c | 4 ++-- dlls/wined3d/context.c | 4 ++-- dlls/wined3d/resource.c | 3 --- dlls/wined3d/surface.c | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 4a61cc8..52b9d9d 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7645,7 +7645,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter, if (wined3d_settings.offscreen_rendering_mode != ORM_FBO && (src_surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE)) == WINED3D_LOCATION_DRAWABLE - && !wined3d_resource_is_offscreen(&src_surface->resource)) + && !wined3d_resource_is_offscreen(&src_surface->container->resource)) { /* Without FBO blits transferring from the drawable to the texture is * expensive, because we have to flip the data in sysmem. Since we can @@ -7662,7 +7662,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter, context_apply_blit_state(context, device); - if (!wined3d_resource_is_offscreen(&dst_surface->resource)) + if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect); arbfp_blit_set(device->blit_priv, context, src_surface); diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 693267e..b83ec78 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1590,7 +1590,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, ret->current_rt = target; ret->tid = GetCurrentThreadId(); - ret->render_offscreen = wined3d_resource_is_offscreen(&target->resource); + ret->render_offscreen = wined3d_resource_is_offscreen(&target->container->resource); ret->draw_buffers_mask = context_generate_rt_mask(GL_BACK); ret->valid = 1; @@ -3043,7 +3043,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d { BOOL old_render_offscreen = context->render_offscreen, render_offscreen; - render_offscreen = wined3d_resource_is_offscreen(&target->resource); + render_offscreen = wined3d_resource_is_offscreen(&target->container->resource); if (context->current_rt == target && render_offscreen == old_render_offscreen) return; /* To compensate the lack of format switching with some offscreen rendering methods and on onscreen buffers diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 772ce10..d40af56 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -305,9 +305,6 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) { struct wined3d_swapchain *swapchain; - if (resource->type == WINED3D_RTYPE_SURFACE) - resource = &surface_from_resource(resource)->container->resource; - /* Only texture resources can be onscreen. */ if (resource->type != WINED3D_RTYPE_TEXTURE) return TRUE; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 04ef3f0..9603e21 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1511,7 +1511,7 @@ static void surface_upload_data(struct wined3d_surface *surface, const struct wi if (srgb) internal = format->glGammaInternal; else if (surface->resource.usage & WINED3DUSAGE_RENDERTARGET - && wined3d_resource_is_offscreen(&surface->resource)) + && wined3d_resource_is_offscreen(&surface->container->resource)) internal = format->rtInternal; else internal = format->glInternal; @@ -1856,7 +1856,7 @@ static void surface_allocate_surface(struct wined3d_surface *surface, const stru if (srgb) internal = format->glGammaInternal; else if (surface->resource.usage & WINED3DUSAGE_RENDERTARGET - && wined3d_resource_is_offscreen(&surface->resource)) + && wined3d_resource_is_offscreen(&surface->container->resource)) internal = format->rtInternal; else internal = format->glInternal; @@ -3047,7 +3047,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc * There is no need to keep track of the current read buffer or reset it, every part of the code * that reads sets the read buffer as desired. */ - if (wined3d_resource_is_offscreen(&surface->resource)) + if (wined3d_resource_is_offscreen(&surface->container->resource)) { /* Mapping the primary render target which is not on a swapchain. * Read from the back buffer. */ @@ -3146,7 +3146,7 @@ void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) TRACE("Reading back offscreen render target %p.\n", surface); - if (wined3d_resource_is_offscreen(&surface->resource)) + if (wined3d_resource_is_offscreen(&surface->container->resource)) gl_info->gl_ops.gl.p_glReadBuffer(device->offscreenBuffer); else gl_info->gl_ops.gl.p_glReadBuffer(surface_get_gl_buffer(surface)); @@ -3513,7 +3513,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc /* Bind the target texture */ context_bind_texture(context, dst_surface->container->target, dst_surface->container->texture_rgb.name); - if (wined3d_resource_is_offscreen(&src_surface->resource)) + if (wined3d_resource_is_offscreen(&src_surface->container->resource)) { TRACE("Reading from an offscreen target\n"); upsidedown = !upsidedown; @@ -3619,7 +3619,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st context_apply_blit_state(context, device); wined3d_texture_load(dst_surface->container, context, FALSE); - src_offscreen = wined3d_resource_is_offscreen(&src_surface->resource); + src_offscreen = wined3d_resource_is_offscreen(&src_surface->container->resource); noBackBufferBackup = src_offscreen && wined3d_settings.offscreen_rendering_mode == ORM_FBO; if (!noBackBufferBackup && !src_surface->container->texture_rgb.name) { @@ -3919,7 +3919,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, /* Activate the destination context, set it up for blitting */ context_apply_blit_state(context, device); - if (!wined3d_resource_is_offscreen(&dst_surface->resource)) + if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect); device->blitter->set_shader(device->blit_priv, context, src_surface); @@ -4522,7 +4522,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, RECT r; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO - && wined3d_resource_is_offscreen(&surface->resource)) + && wined3d_resource_is_offscreen(&surface->container->resource)) { ERR("Trying to load offscreen surface into WINED3D_LOCATION_DRAWABLE.\n"); return WINED3DERR_INVALIDCALL; @@ -4550,7 +4550,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, BYTE *mem = NULL; if (wined3d_settings.offscreen_rendering_mode != ORM_FBO - && wined3d_resource_is_offscreen(&surface->resource) + && wined3d_resource_is_offscreen(&surface->container->resource) && (surface->locations & WINED3D_LOCATION_DRAWABLE)) { surface_load_fb_texture(surface, srgb); @@ -5856,7 +5856,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) { - if (!wined3d_resource_is_offscreen(&dst_surface->resource)) + if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) surface_load_location(dst_surface, dst_surface->container->resource.draw_binding); return WINED3D_OK; }
1
0
0
0
Henri Verbeet : d3d10core: Implement d3d10_device_GetPredication().
by Alexandre Julliard
19 Sep '14
19 Sep '14
Module: wine Branch: master Commit: a3daed9604fe80836eba2de8b453002eec7b0aab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a3daed9604fe80836eba2de8b…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 19 10:41:47 2014 +0200 d3d10core: Implement d3d10_device_GetPredication(). --- dlls/d3d10core/async.c | 2 +- dlls/d3d10core/device.c | 16 +++++++++++++++- dlls/d3d9/query.c | 2 +- dlls/wined3d/device.c | 8 ++++++++ dlls/wined3d/query.c | 17 +++++++++++++---- dlls/wined3d/wined3d.spec | 4 +++- dlls/wined3d/wined3d_private.h | 2 ++ include/wine/wined3d.h | 4 +++- 8 files changed, 46 insertions(+), 9 deletions(-) diff --git a/dlls/d3d10core/async.c b/dlls/d3d10core/async.c index 058b7bc..830b2b4 100644 --- a/dlls/d3d10core/async.c +++ b/dlls/d3d10core/async.c @@ -209,7 +209,7 @@ HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device, query->refcount = 1; if (FAILED(hr = wined3d_query_create(device->wined3d_device, - query_type_map[desc->Query], &query->wined3d_query))) + query_type_map[desc->Query], query, &query->wined3d_query))) { WARN("Failed to create wined3d query, hr %#x.\n", hr); return hr; diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index 7dc6543..aac53dd 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -980,7 +980,21 @@ static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device1 *iface, static void STDMETHODCALLTYPE d3d10_device_GetPredication(ID3D10Device1 *iface, ID3D10Predicate **predicate, BOOL *value) { - FIXME("iface %p, predicate %p, value %p stub!\n", iface, predicate, value); + struct d3d10_device *device = impl_from_ID3D10Device(iface); + struct wined3d_query *wined3d_predicate; + struct d3d10_query *predicate_impl; + + TRACE("iface %p, predicate %p, value %p.\n", iface, predicate, value); + + if (!(wined3d_predicate = wined3d_device_get_predication(device->wined3d_device, value))) + { + *predicate = NULL; + return; + } + + predicate_impl = wined3d_query_get_parent(wined3d_predicate); + *predicate = (ID3D10Predicate *)&predicate_impl->ID3D10Query_iface; + ID3D10Predicate_AddRef(*predicate); } static void STDMETHODCALLTYPE d3d10_device_GSGetShaderResources(ID3D10Device1 *iface, diff --git a/dlls/d3d9/query.c b/dlls/d3d9/query.c index 6af89f6..42b476c 100644 --- a/dlls/d3d9/query.c +++ b/dlls/d3d9/query.c @@ -189,7 +189,7 @@ HRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUER query->refcount = 1; wined3d_mutex_lock(); - hr = wined3d_query_create(device->wined3d_device, type, &query->wined3d_query); + hr = wined3d_query_create(device->wined3d_device, type, query, &query->wined3d_query); wined3d_mutex_unlock(); if (FAILED(hr)) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index cfe3b4c..a214442 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3354,6 +3354,14 @@ void CDECL wined3d_device_set_predication(struct wined3d_device *device, wined3d_query_decref(prev); } +struct wined3d_query * CDECL wined3d_device_get_predication(struct wined3d_device *device, BOOL *value) +{ + TRACE("device %p, value %p.\n", device, value); + + *value = device->state.predicate_value; + return device->state.predicate; +} + void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type) { diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index b01e124..e755764 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -421,6 +421,13 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, return S_OK; } +void * CDECL wined3d_query_get_parent(const struct wined3d_query *query) +{ + TRACE("query %p.\n", query); + + return query->parent; +} + enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query *query) { TRACE("query %p.\n", query); @@ -698,10 +705,13 @@ static const struct wined3d_query_ops timestamp_disjoint_query_ops = wined3d_timestamp_disjoint_query_ops_issue, }; -static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *device, enum wined3d_query_type type) +static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *device, + enum wined3d_query_type type, void *parent) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + query->parent = parent; + switch (type) { case WINED3D_QUERY_TYPE_OCCLUSION: @@ -797,7 +807,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de } HRESULT CDECL wined3d_query_create(struct wined3d_device *device, - enum wined3d_query_type type, struct wined3d_query **query) + enum wined3d_query_type type, void *parent, struct wined3d_query **query) { struct wined3d_query *object; HRESULT hr; @@ -808,8 +818,7 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, if (!object) return E_OUTOFMEMORY; - hr = query_init(object, device, type); - if (FAILED(hr)) + if (FAILED(hr = query_init(object, device, type, parent))) { WARN("Failed to initialize query, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index e0f9ebc..615a85d 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -67,6 +67,7 @@ @ cdecl wined3d_device_get_material(ptr ptr) @ cdecl wined3d_device_get_npatch_mode(ptr) @ cdecl wined3d_device_get_pixel_shader(ptr) +@ cdecl wined3d_device_get_predication(ptr ptr) @ cdecl wined3d_device_get_primitive_type(ptr ptr) @ cdecl wined3d_device_get_ps_cb(ptr long) @ cdecl wined3d_device_get_ps_consts_b(ptr long ptr long) @@ -169,10 +170,11 @@ @ cdecl wined3d_palette_incref(ptr) @ cdecl wined3d_palette_set_entries(ptr long long long ptr) -@ cdecl wined3d_query_create(ptr long ptr) +@ cdecl wined3d_query_create(ptr long ptr ptr) @ cdecl wined3d_query_decref(ptr) @ cdecl wined3d_query_get_data(ptr ptr long long) @ cdecl wined3d_query_get_data_size(ptr) +@ cdecl wined3d_query_get_parent(ptr) @ cdecl wined3d_query_get_type(ptr) @ cdecl wined3d_query_incref(ptr) @ cdecl wined3d_query_issue(ptr long) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 330fadd..30a3321 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2559,6 +2559,8 @@ struct wined3d_query_ops struct wined3d_query { LONG ref; + + void *parent; const struct wined3d_query_ops *query_ops; struct wined3d_device *device; enum query_state state; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 01f8e2a..bd41106 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2145,6 +2145,7 @@ HRESULT __cdecl wined3d_device_get_light_enable(const struct wined3d_device *dev void __cdecl wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material); float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device); struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device); +struct wined3d_query * __cdecl wined3d_device_get_predication(struct wined3d_device *device, BOOL *value); void __cdecl wined3d_device_get_primitive_type(const struct wined3d_device *device, enum wined3d_primitive_type *primitive_topology); struct wined3d_buffer * __cdecl wined3d_device_get_ps_cb(const struct wined3d_device *device, UINT idx); @@ -2304,10 +2305,11 @@ HRESULT __cdecl wined3d_palette_set_entries(struct wined3d_palette *palette, DWORD flags, DWORD start, DWORD count, const PALETTEENTRY *entries); HRESULT __cdecl wined3d_query_create(struct wined3d_device *device, - enum wined3d_query_type type, struct wined3d_query **query); + enum wined3d_query_type type, void *parent, struct wined3d_query **query); ULONG __cdecl wined3d_query_decref(struct wined3d_query *query); HRESULT __cdecl wined3d_query_get_data(struct wined3d_query *query, void *data, UINT data_size, DWORD flags); UINT __cdecl wined3d_query_get_data_size(const struct wined3d_query *query); +void * __cdecl wined3d_query_get_parent(const struct wined3d_query *query); enum wined3d_query_type __cdecl wined3d_query_get_type(const struct wined3d_query *query); ULONG __cdecl wined3d_query_incref(struct wined3d_query *query); HRESULT __cdecl wined3d_query_issue(struct wined3d_query *query, DWORD flags);
1
0
0
0
Henri Verbeet : d3d10core: Implement d3d10_device_SetPredication().
by Alexandre Julliard
19 Sep '14
19 Sep '14
Module: wine Branch: master Commit: fdf60e51fc389e5657dc4ffd4c205401b6364d9c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fdf60e51fc389e5657dc4ffd4…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 19 10:41:46 2014 +0200 d3d10core: Implement d3d10_device_SetPredication(). --- dlls/d3d10core/async.c | 8 ++++++++ dlls/d3d10core/d3d10core_private.h | 1 + dlls/d3d10core/device.c | 8 +++++++- dlls/wined3d/cs.c | 29 +++++++++++++++++++++++++++++ dlls/wined3d/device.c | 21 +++++++++++++++++++++ dlls/wined3d/wined3d.spec | 1 + dlls/wined3d/wined3d_private.h | 4 ++++ include/wine/wined3d.h | 2 ++ 8 files changed, 73 insertions(+), 1 deletion(-) diff --git a/dlls/d3d10core/async.c b/dlls/d3d10core/async.c index f41369b..058b7bc 100644 --- a/dlls/d3d10core/async.c +++ b/dlls/d3d10core/async.c @@ -171,6 +171,14 @@ static const struct ID3D10QueryVtbl d3d10_query_vtbl = d3d10_query_GetDesc, }; +struct d3d10_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d10_query_vtbl); + return CONTAINING_RECORD(iface, struct d3d10_query, ID3D10Query_iface); +} + HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device, const D3D10_QUERY_DESC *desc, BOOL predicate) { diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h index 0891ae0..71c4dc0 100644 --- a/dlls/d3d10core/d3d10core_private.h +++ b/dlls/d3d10core/d3d10core_private.h @@ -304,6 +304,7 @@ struct d3d10_query HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device, const D3D10_QUERY_DESC *desc, BOOL predicate) DECLSPEC_HIDDEN; +struct d3d10_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) DECLSPEC_HIDDEN; /* IDirect3D10Device1 */ struct d3d10_device diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index a5d806a..7dc6543 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -385,7 +385,13 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device1 *iface, static void STDMETHODCALLTYPE d3d10_device_SetPredication(ID3D10Device1 *iface, ID3D10Predicate *predicate, BOOL value) { - FIXME("iface %p, predicate %p, value %d stub!\n", iface, predicate, value); + struct d3d10_device *device = impl_from_ID3D10Device(iface); + struct d3d10_query *query; + + TRACE("iface %p, predicate %p, value %#x.\n", iface, predicate, value); + + query = unsafe_impl_from_ID3D10Query((ID3D10Query *)predicate); + wined3d_device_set_predication(device->wined3d_device, query ? query->wined3d_query : NULL, value); } static void STDMETHODCALLTYPE d3d10_device_GSSetShaderResources(ID3D10Device1 *iface, diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 205f3d8..bdd86c8 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -29,6 +29,7 @@ enum wined3d_cs_op WINED3D_CS_OP_PRESENT, WINED3D_CS_OP_CLEAR, WINED3D_CS_OP_DRAW, + WINED3D_CS_OP_SET_PREDICATION, WINED3D_CS_OP_SET_VIEWPORT, WINED3D_CS_OP_SET_SCISSOR_RECT, WINED3D_CS_OP_SET_RENDERTARGET_VIEW, @@ -84,6 +85,13 @@ struct wined3d_cs_draw BOOL indexed; }; +struct wined3d_cs_set_predication +{ + enum wined3d_cs_op opcode; + struct wined3d_query *predicate; + BOOL value; +}; + struct wined3d_cs_set_viewport { enum wined3d_cs_op opcode; @@ -317,6 +325,26 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun cs->ops->submit(cs); } +static void wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) +{ + const struct wined3d_cs_set_predication *op = data; + + cs->state.predicate = op->predicate; + cs->state.predicate_value = op->value; +} + +void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) +{ + struct wined3d_cs_set_predication *op; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_PREDICATION; + op->predicate = predicate; + op->value = value; + + cs->ops->submit(cs); +} + static void wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_set_viewport *op = data; @@ -880,6 +908,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, /* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw, + /* WINED3D_CS_OP_SET_PREDICATION */ wined3d_cs_exec_set_predication, /* WINED3D_CS_OP_SET_VIEWPORT */ wined3d_cs_exec_set_viewport, /* WINED3D_CS_OP_SET_SCISSOR_RECT */ wined3d_cs_exec_set_scissor_rect, /* WINED3D_CS_OP_SET_RENDERTARGET_VIEW */ wined3d_cs_exec_set_rendertarget_view, diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 44fa206..cfe3b4c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3333,6 +3333,27 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou return WINED3D_OK; } +void CDECL wined3d_device_set_predication(struct wined3d_device *device, + struct wined3d_query *predicate, BOOL value) +{ + struct wined3d_query *prev; + + TRACE("device %p, predicate %p, value %#x.\n", device, predicate, value); + + prev = device->update_state->predicate; + if (predicate) + { + FIXME("Predicated rendering not implemented.\n"); + wined3d_query_incref(predicate); + } + device->update_state->predicate = predicate; + device->update_state->predicate_value = value; + if (!device->recording) + wined3d_cs_emit_set_predication(device->cs, predicate, value); + if (prev) + wined3d_query_decref(prev); +} + void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index e064d1a..e0f9ebc 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -126,6 +126,7 @@ @ cdecl wined3d_device_set_multithreaded(ptr) @ cdecl wined3d_device_set_npatch_mode(ptr float) @ cdecl wined3d_device_set_pixel_shader(ptr ptr) +@ cdecl wined3d_device_set_predication(ptr ptr long) @ cdecl wined3d_device_set_primitive_type(ptr long) @ cdecl wined3d_device_set_ps_cb(ptr long ptr) @ cdecl wined3d_device_set_ps_consts_b(ptr long ptr long) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ff98ec0..330fadd 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1862,6 +1862,8 @@ struct wined3d_state INT base_vertex_index; INT load_base_vertex_index; /* Non-indexed drawing needs 0 here, indexed needs base_vertex_index. */ GLenum gl_primitive_type; + struct wined3d_query *predicate; + BOOL predicate_value; struct wined3d_shader *shader[WINED3D_SHADER_TYPE_COUNT]; struct wined3d_buffer *cb[WINED3D_SHADER_TYPE_COUNT][MAX_CONSTANT_BUFFERS]; @@ -2508,6 +2510,8 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, enum wined3d_format_id format_id) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) DECLSPEC_HIDDEN; +void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, + struct wined3d_query *predicate, BOOL value) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index fdbd65b..01f8e2a 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2237,6 +2237,8 @@ void __cdecl wined3d_device_set_material(struct wined3d_device *device, const st void __cdecl wined3d_device_set_multithreaded(struct wined3d_device *device); HRESULT __cdecl wined3d_device_set_npatch_mode(struct wined3d_device *device, float segments); void __cdecl wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader); +void __cdecl wined3d_device_set_predication(struct wined3d_device *device, + struct wined3d_query *predicate, BOOL value); void __cdecl wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_topology); void __cdecl wined3d_device_set_ps_cb(struct wined3d_device *device, UINT idx, struct wined3d_buffer *buffer);
1
0
0
0
Henri Verbeet : d3d10core: Create wined3d queries for queries.
by Alexandre Julliard
19 Sep '14
19 Sep '14
Module: wine Branch: master Commit: 686546b6d3d07902f6159f49f69a28b315c92054 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=686546b6d3d07902f6159f49f…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Sep 19 10:41:45 2014 +0200 d3d10core: Create wined3d queries for queries. --- dlls/d3d10core/async.c | 34 +++++++++++++++++++++++++++++++++- dlls/d3d10core/d3d10core_private.h | 4 +++- dlls/d3d10core/device.c | 4 ++-- dlls/d3d10core/tests/device.c | 5 +++-- include/wine/wined3d.h | 3 +++ 5 files changed, 44 insertions(+), 6 deletions(-) diff --git a/dlls/d3d10core/async.c b/dlls/d3d10core/async.c index 6d3442b..f41369b 100644 --- a/dlls/d3d10core/async.c +++ b/dlls/d3d10core/async.c @@ -171,10 +171,42 @@ static const struct ID3D10QueryVtbl d3d10_query_vtbl = d3d10_query_GetDesc, }; -HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device, BOOL predicate) +HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device, + const D3D10_QUERY_DESC *desc, BOOL predicate) { + HRESULT hr; + + static const enum wined3d_query_type query_type_map[] = + { + /* D3D10_QUERY_EVENT */ WINED3D_QUERY_TYPE_EVENT, + /* D3D10_QUERY_OCCLUSION */ WINED3D_QUERY_TYPE_OCCLUSION, + /* D3D10_QUERY_TIMESTAMP */ WINED3D_QUERY_TYPE_TIMESTAMP, + /* D3D10_QUERY_TIMESTAMP_DISJOINT */ WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT, + /* D3D10_QUERY_PIPELINE_STATISTICS */ WINED3D_QUERY_TYPE_PIPELINE_STATISTICS, + /* D3D10_QUERY_OCCLUSION_PREDICATE */ WINED3D_QUERY_TYPE_OCCLUSION, + /* D3D10_QUERY_SO_STATISTICS */ WINED3D_QUERY_TYPE_SO_STATISTICS, + /* D3D10_QUERY_SO_OVERFLOW_PREDICATE */ WINED3D_QUERY_TYPE_SO_OVERFLOW, + }; + + if (desc->Query > sizeof(query_type_map) / sizeof(*query_type_map)) + { + FIXME("Unhandled query type %#x.\n", desc->Query); + return E_INVALIDARG; + } + + if (desc->MiscFlags) + FIXME("Ignoring MiscFlags %#x.\n", desc->MiscFlags); + query->ID3D10Query_iface.lpVtbl = &d3d10_query_vtbl; query->refcount = 1; + + if (FAILED(hr = wined3d_query_create(device->wined3d_device, + query_type_map[desc->Query], &query->wined3d_query))) + { + WARN("Failed to create wined3d query, hr %#x.\n", hr); + return hr; + } + query->predicate = predicate; query->device = &device->ID3D10Device1_iface; ID3D10Device1_AddRef(query->device); diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h index 0e0fdfd..0891ae0 100644 --- a/dlls/d3d10core/d3d10core_private.h +++ b/dlls/d3d10core/d3d10core_private.h @@ -297,11 +297,13 @@ struct d3d10_query ID3D10Query ID3D10Query_iface; LONG refcount; + struct wined3d_query *wined3d_query; BOOL predicate; ID3D10Device1 *device; }; -HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device, BOOL predicate) DECLSPEC_HIDDEN; +HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device, + const D3D10_QUERY_DESC *desc, BOOL predicate) DECLSPEC_HIDDEN; /* IDirect3D10Device1 */ struct d3d10_device diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index 5bdb8af..a5d806a 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -1722,7 +1722,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device1 *iface, if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; - if (FAILED(hr = d3d10_query_init(object, device, FALSE))) + if (FAILED(hr = d3d10_query_init(object, device, desc, FALSE))) { WARN("Failed to initialize query, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -1756,7 +1756,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device1 *ifa if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; - if (FAILED(hr = d3d10_query_init(object, device, TRUE))) + if (FAILED(hr = d3d10_query_init(object, device, desc, TRUE))) { WARN("Failed to initialize predicate, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 67398fa..4b3a325 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -961,8 +961,9 @@ static void test_create_predicate(void) query_desc.Query = D3D10_QUERY_SO_OVERFLOW_PREDICATE; hr = ID3D10Device_CreatePredicate(device, &query_desc, &predicate); - ok(SUCCEEDED(hr), "Failed to create predicate, hr %#x.\n", hr); - ID3D10Predicate_Release(predicate); + todo_wine ok(SUCCEEDED(hr), "Failed to create predicate, hr %#x.\n", hr); + if (SUCCEEDED(hr)) + ID3D10Predicate_Release(predicate); refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 741e503..fdbd65b 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -694,6 +694,9 @@ enum wined3d_pool enum wined3d_query_type { + WINED3D_QUERY_TYPE_PIPELINE_STATISTICS = 1, + WINED3D_QUERY_TYPE_SO_STATISTICS = 2, + WINED3D_QUERY_TYPE_SO_OVERFLOW = 3, WINED3D_QUERY_TYPE_VCACHE = 4, WINED3D_QUERY_TYPE_RESOURCE_MANAGER = 5, WINED3D_QUERY_TYPE_VERTEX_STATS = 6,
1
0
0
0
Eric Kohl : rpcrt4: Fix buffer size calculation for arrays with embedded pointers.
by Alexandre Julliard
18 Sep '14
18 Sep '14
Module: wine Branch: master Commit: 23981241c1a496399e8fa67544e16b9eb32dea62 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23981241c1a496399e8fa6754…
Author: Eric Kohl <eric.kohl(a)t-online.de> Date: Thu Sep 18 14:22:20 2014 +0200 rpcrt4: Fix buffer size calculation for arrays with embedded pointers. --- dlls/rpcrt4/ndr_marshall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 3f1762a..0cb41bc 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -1211,7 +1211,7 @@ static unsigned char * EmbeddedPointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *bufptr = bufbase + *(const SHORT*)&info[2]; unsigned char *saved_memory = pStubMsg->Memory; - pStubMsg->Memory = pMemory; + pStubMsg->Memory = membase; PointerMarshall(pStubMsg, bufptr, *(unsigned char**)memptr, info+4); pStubMsg->Memory = saved_memory; } @@ -1365,7 +1365,7 @@ static void EmbeddedPointerBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *memptr = membase + *(const SHORT*)&info[0]; unsigned char *saved_memory = pStubMsg->Memory; - pStubMsg->Memory = pMemory; + pStubMsg->Memory = membase; PointerBufferSize(pStubMsg, *(unsigned char**)memptr, info+4); pStubMsg->Memory = saved_memory; } @@ -1497,7 +1497,7 @@ static void EmbeddedPointerFree(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *memptr = membase + *(const SHORT*)&info[0]; unsigned char *saved_memory = pStubMsg->Memory; - pStubMsg->Memory = pMemory; + pStubMsg->Memory = membase; PointerFree(pStubMsg, *(unsigned char**)memptr, info+4); pStubMsg->Memory = saved_memory; }
1
0
0
0
Vincent Povirk : gdiplus: Use integer math to apply color matrices.
by Alexandre Julliard
18 Sep '14
18 Sep '14
Module: wine Branch: master Commit: 57f1d4489f5b9490fc86adbe9229fa6643a760db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=57f1d4489f5b9490fc86adbe9…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Sep 17 16:17:11 2014 -0500 gdiplus: Use integer math to apply color matrices. --- dlls/gdiplus/graphics.c | 80 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 25 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 8fef111..169d92c 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -593,30 +593,47 @@ static ARGB blend_line_gradient(GpLineGradient* brush, REAL position) } } -static ARGB transform_color(ARGB color, const ColorMatrix *matrix) +static BOOL round_color_matrix(const ColorMatrix *matrix, int values[5][5]) { - REAL val[5], res[4]; + /* Convert floating point color matrix to int[5][5], return TRUE if it's an identity */ + BOOL identity = TRUE; + int i, j; + + for (i=0; i<4; i++) + for (j=0; j<5; j++) + { + if (matrix->m[j][i] != (i == j ? 1.0 : 0.0)) + identity = FALSE; + values[j][i] = gdip_round(matrix->m[j][i] * 256.0); + } + + return identity; +} + +static ARGB transform_color(ARGB color, int matrix[5][5]) +{ + int val[5], res[4]; int i, j; unsigned char a, r, g, b; - val[0] = ((color >> 16) & 0xff) / 255.0; /* red */ - val[1] = ((color >> 8) & 0xff) / 255.0; /* green */ - val[2] = (color & 0xff) / 255.0; /* blue */ - val[3] = ((color >> 24) & 0xff) / 255.0; /* alpha */ - val[4] = 1.0; /* translation */ + val[0] = ((color >> 16) & 0xff); /* red */ + val[1] = ((color >> 8) & 0xff); /* green */ + val[2] = (color & 0xff); /* blue */ + val[3] = ((color >> 24) & 0xff); /* alpha */ + val[4] = 255; /* translation */ for (i=0; i<4; i++) { - res[i] = 0.0; + res[i] = 0; for (j=0; j<5; j++) - res[i] += matrix->m[j][i] * val[j]; + res[i] += matrix[j][i] * val[j]; } - a = min(max(floorf(res[3]*255.0), 0.0), 255.0); - r = min(max(floorf(res[0]*255.0), 0.0), 255.0); - g = min(max(floorf(res[1]*255.0), 0.0), 255.0); - b = min(max(floorf(res[2]*255.0), 0.0), 255.0); + a = min(max(res[3] / 256, 0), 255); + r = min(max(res[0] / 256, 0), 255); + g = min(max(res[1] / 256, 0), 255); + b = min(max(res[2] / 256, 0), 255); return (a << 24) | (r << 16) | (g << 8) | b; } @@ -703,28 +720,41 @@ static void apply_image_attributes(const GpImageAttributes *attributes, LPBYTE d attributes->colormatrices[ColorAdjustTypeDefault].enabled) { const struct color_matrix *colormatrices; + int color_matrix[5][5]; + int gray_matrix[5][5]; + BOOL identity; if (attributes->colormatrices[type].enabled) colormatrices = &attributes->colormatrices[type]; else colormatrices = &attributes->colormatrices[ColorAdjustTypeDefault]; - for (x=0; x<width; x++) - for (y=0; y<height; y++) - { - ARGB *src_color; - src_color = (ARGB*)(data + stride * y + sizeof(ARGB) * x); + identity = round_color_matrix(&colormatrices->colormatrix, color_matrix); - if (colormatrices->flags == ColorMatrixFlagsDefault || - !color_is_gray(*src_color)) - { - *src_color = transform_color(*src_color, &colormatrices->colormatrix); - } - else if (colormatrices->flags == ColorMatrixFlagsAltGray) + if (colormatrices->flags == ColorMatrixFlagsAltGray) + identity = (round_color_matrix(&colormatrices->graymatrix, gray_matrix) && identity); + + if (!identity) + { + for (x=0; x<width; x++) + { + for (y=0; y<height; y++) { - *src_color = transform_color(*src_color, &colormatrices->graymatrix); + ARGB *src_color; + src_color = (ARGB*)(data + stride * y + sizeof(ARGB) * x); + + if (colormatrices->flags == ColorMatrixFlagsDefault || + !color_is_gray(*src_color)) + { + *src_color = transform_color(*src_color, color_matrix); + } + else if (colormatrices->flags == ColorMatrixFlagsAltGray) + { + *src_color = transform_color(*src_color, gray_matrix); + } } } + } } if (attributes->gamma_enabled[type] ||
1
0
0
0
Vincent Povirk : gdiplus: Skip resampling when drawing a bitmap with no scaling/rotation.
by Alexandre Julliard
18 Sep '14
18 Sep '14
Module: wine Branch: master Commit: 76a96b70f7379f28c12bbd8b7503f09231f93f90 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=76a96b70f7379f28c12bbd8b7…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Sep 17 14:45:28 2014 -0500 gdiplus: Skip resampling when drawing a bitmap with no scaling/rotation. --- dlls/gdiplus/graphics.c | 96 ++++++++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 37 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 7ee46ee..8fef111 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2857,6 +2857,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image else if (image->type == ImageTypeBitmap) { GpBitmap* bitmap = (GpBitmap*)image; + BOOL do_resampling = FALSE; BOOL use_software = FALSE; TRACE("graphics: %.2fx%.2f dpi, fmt %#x, scale %f, image: %.2fx%.2f dpi, fmt %#x, color %08x\n", @@ -2865,12 +2866,14 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image graphics->scale, image->xres, image->yres, bitmap->format, imageAttributes ? imageAttributes->outside_color : 0); - if (imageAttributes || graphics->alpha_hdc || - (graphics->image && graphics->image->type == ImageTypeBitmap) || - ptf[1].Y != ptf[0].Y || ptf[2].X != ptf[0].X || + if (ptf[1].Y != ptf[0].Y || ptf[2].X != ptf[0].X || ptf[1].X - ptf[0].X != srcwidth || ptf[2].Y - ptf[0].Y != srcheight || srcx < 0 || srcy < 0 || srcx + srcwidth > bitmap->width || srcy + srcheight > bitmap->height) + do_resampling = TRUE; + + if (imageAttributes || graphics->alpha_hdc || do_resampling || + (graphics->image && graphics->image->type == ImageTypeBitmap)) use_software = TRUE; if (use_software) @@ -2881,7 +2884,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image int i, x, y, src_stride, dst_stride; GpMatrix dst_to_src; REAL m11, m12, m21, m22, mdx, mdy; - LPBYTE src_data, dst_data; + LPBYTE src_data, dst_data, dst_dyn_data=NULL; BitmapData lockeddata; InterpolationMode interpolation = graphics->interpolation; PixelOffsetMode offset_mode = graphics->pixeloffset; @@ -2926,22 +2929,25 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image stat = GdipInvertMatrix(&dst_to_src); if (stat != Ok) return stat; - dst_data = GdipAlloc(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top)); - if (!dst_data) return OutOfMemory; - - dst_stride = sizeof(ARGB) * (dst_area.right - dst_area.left); - - get_bitmap_sample_size(interpolation, imageAttributes->wrap, - bitmap, srcx, srcy, srcwidth, srcheight, &src_area); + if (do_resampling) + { + get_bitmap_sample_size(interpolation, imageAttributes->wrap, + bitmap, srcx, srcy, srcwidth, srcheight, &src_area); + } + else + { + /* Make sure src_area is equal in size to dst_area. */ + src_area.X = srcx + dst_area.left - pti[0].x; + src_area.Y = srcy + dst_area.top - pti[0].y; + src_area.Width = dst_area.right - dst_area.left; + src_area.Height = dst_area.bottom - dst_area.top; + } TRACE("src_area: %d x %d\n", src_area.Width, src_area.Height); src_data = GdipAlloc(sizeof(ARGB) * src_area.Width * src_area.Height); if (!src_data) - { - GdipFree(dst_data); return OutOfMemory; - } src_stride = sizeof(ARGB) * src_area.Width; /* Read the bits we need from the source bitmap into an ARGB buffer. */ @@ -2960,7 +2966,6 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image if (stat != Ok) { GdipFree(src_data); - GdipFree(dst_data); return stat; } @@ -2968,40 +2973,57 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image src_area.Width, src_area.Height, src_stride, ColorAdjustTypeBitmap); - /* Transform the bits as needed to the destination. */ - GdipTransformMatrixPoints(&dst_to_src, dst_to_src_points, 3); + if (do_resampling) + { + /* Transform the bits as needed to the destination. */ + dst_data = dst_dyn_data = GdipAlloc(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top)); + if (!dst_data) + { + GdipFree(src_data); + return OutOfMemory; + } + + dst_stride = sizeof(ARGB) * (dst_area.right - dst_area.left); - x_dx = dst_to_src_points[1].X - dst_to_src_points[0].X; - x_dy = dst_to_src_points[1].Y - dst_to_src_points[0].Y; - y_dx = dst_to_src_points[2].X - dst_to_src_points[0].X; - y_dy = dst_to_src_points[2].Y - dst_to_src_points[0].Y; + GdipTransformMatrixPoints(&dst_to_src, dst_to_src_points, 3); - for (x=dst_area.left; x<dst_area.right; x++) - { - for (y=dst_area.top; y<dst_area.bottom; y++) + x_dx = dst_to_src_points[1].X - dst_to_src_points[0].X; + x_dy = dst_to_src_points[1].Y - dst_to_src_points[0].Y; + y_dx = dst_to_src_points[2].X - dst_to_src_points[0].X; + y_dy = dst_to_src_points[2].Y - dst_to_src_points[0].Y; + + for (x=dst_area.left; x<dst_area.right; x++) { - GpPointF src_pointf; - ARGB *dst_color; + for (y=dst_area.top; y<dst_area.bottom; y++) + { + GpPointF src_pointf; + ARGB *dst_color; - src_pointf.X = dst_to_src_points[0].X + x * x_dx + y * y_dx; - src_pointf.Y = dst_to_src_points[0].Y + x * x_dy + y * y_dy; + src_pointf.X = dst_to_src_points[0].X + x * x_dx + y * y_dx; + src_pointf.Y = dst_to_src_points[0].Y + x * x_dy + y * y_dy; - dst_color = (ARGB*)(dst_data + dst_stride * (y - dst_area.top) + sizeof(ARGB) * (x - dst_area.left)); + dst_color = (ARGB*)(dst_data + dst_stride * (y - dst_area.top) + sizeof(ARGB) * (x - dst_area.left)); - if (src_pointf.X >= srcx && src_pointf.X < srcx + srcwidth && src_pointf.Y >= srcy && src_pointf.Y < srcy+srcheight) - *dst_color = resample_bitmap_pixel(&src_area, src_data, bitmap->width, bitmap->height, &src_pointf, - imageAttributes, interpolation, offset_mode); - else - *dst_color = 0; + if (src_pointf.X >= srcx && src_pointf.X < srcx + srcwidth && src_pointf.Y >= srcy && src_pointf.Y < srcy+srcheight) + *dst_color = resample_bitmap_pixel(&src_area, src_data, bitmap->width, bitmap->height, &src_pointf, + imageAttributes, interpolation, offset_mode); + else + *dst_color = 0; + } } } - - GdipFree(src_data); + else + { + dst_data = src_data; + dst_stride = src_stride; + } stat = alpha_blend_pixels(graphics, dst_area.left, dst_area.top, dst_data, dst_area.right - dst_area.left, dst_area.bottom - dst_area.top, dst_stride); - GdipFree(dst_data); + GdipFree(src_data); + + GdipFree(dst_dyn_data); return stat; }
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
31
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
Results per page:
10
25
50
100
200